From 55d05d87fc0edea29af30c09f192ce139189c459 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 20 May 2024 19:26:06 +0000 Subject: [PATCH] CodeGen from PR 29165 in Azure/azure-rest-api-specs Merge c47598914662cd9df9c7f794b24d66959ac10c44 into db2f049580ad55549ce9a34635ab58bc5a27c814 --- .../support/armsupport/CHANGELOG.md | 4 + .../support/armsupport/README.md | 4 +- .../support/armsupport/autorest.md | 7 +- .../armsupport/chattranscripts_client.go | 8 +- .../chattranscripts_client_example_test.go | 134 - .../chattranscriptsnosubscription_client.go | 10 +- ...riptsnosubscription_client_example_test.go | 134 - .../support/armsupport/client_factory.go | 30 + .../armsupport/communications_client.go | 18 +- .../communications_client_example_test.go | 291 -- .../communicationsnosubscription_client.go | 20 +- ...tionsnosubscription_client_example_test.go | 291 -- .../support/armsupport/constants.go | 2 +- .../armsupport/fake/chattranscripts_server.go | 2 +- .../chattranscriptsnosubscription_server.go | 2 +- .../armsupport/fake/communications_server.go | 2 +- .../communicationsnosubscription_server.go | 2 +- .../support/armsupport/fake/files_server.go | 2 +- .../fake/filesnosubscription_server.go | 2 +- .../armsupport/fake/fileworkspaces_server.go | 2 +- .../fileworkspacesnosubscription_server.go | 2 +- .../fake/lookupresourceid_server.go | 88 + .../armsupport/fake/operations_server.go | 2 +- .../fake/problemclassifications_server.go | 41 +- ...lemclassificationsnosubscription_server.go | 100 + .../support/armsupport/fake/server_factory.go | 84 +- .../fake/serviceclassifications_server.go | 95 + ...iceclassificationsnosubscription_server.go | 88 + .../armsupport/fake/services_server.go | 2 +- .../support/armsupport/fake/tickets_server.go | 2 +- .../fake/ticketsnosubscription_server.go | 2 +- .../support/armsupport/files_client.go | 16 +- .../armsupport/files_client_example_test.go | 143 - .../armsupport/filesnosubscription_client.go | 16 +- ...filesnosubscription_client_example_test.go | 143 - .../armsupport/fileworkspaces_client.go | 8 +- .../fileworkspaces_client_example_test.go | 64 - .../fileworkspacesnosubscription_client.go | 8 +- ...pacesnosubscription_client_example_test.go | 64 - sdk/resourcemanager/support/armsupport/go.mod | 14 +- sdk/resourcemanager/support/armsupport/go.sum | 17 - .../armsupport/lookupresourceid_client.go | 92 + .../support/armsupport/models.go | 126 +- .../support/armsupport/models_serde.go | 311 ++ .../support/armsupport/operations_client.go | 4 +- .../operations_client_example_test.go | 127 - .../support/armsupport/options.go | 29 + .../problemclassifications_client.go | 83 +- ...blemclassifications_client_example_test.go | 126 - ...lemclassificationsnosubscription_client.go | 101 + .../support/armsupport/responses.go | 30 + .../serviceclassifications_client.go | 103 + ...iceclassificationsnosubscription_client.go | 93 + .../support/armsupport/services_client.go | 10 +- .../services_client_example_test.go | 151 - .../support/armsupport/tickets_client.go | 22 +- .../armsupport/tickets_client_example_test.go | 2876 ----------------- .../ticketsnosubscription_client.go | 22 +- ...cketsnosubscription_client_example_test.go | 1461 --------- 59 files changed, 1551 insertions(+), 6182 deletions(-) delete mode 100644 sdk/resourcemanager/support/armsupport/chattranscripts_client_example_test.go delete mode 100644 sdk/resourcemanager/support/armsupport/chattranscriptsnosubscription_client_example_test.go delete mode 100644 sdk/resourcemanager/support/armsupport/communications_client_example_test.go delete mode 100644 sdk/resourcemanager/support/armsupport/communicationsnosubscription_client_example_test.go create mode 100644 sdk/resourcemanager/support/armsupport/fake/lookupresourceid_server.go create mode 100644 sdk/resourcemanager/support/armsupport/fake/problemclassificationsnosubscription_server.go create mode 100644 sdk/resourcemanager/support/armsupport/fake/serviceclassifications_server.go create mode 100644 sdk/resourcemanager/support/armsupport/fake/serviceclassificationsnosubscription_server.go delete mode 100644 sdk/resourcemanager/support/armsupport/files_client_example_test.go delete mode 100644 sdk/resourcemanager/support/armsupport/filesnosubscription_client_example_test.go delete mode 100644 sdk/resourcemanager/support/armsupport/fileworkspaces_client_example_test.go delete mode 100644 sdk/resourcemanager/support/armsupport/fileworkspacesnosubscription_client_example_test.go create mode 100644 sdk/resourcemanager/support/armsupport/lookupresourceid_client.go delete mode 100644 sdk/resourcemanager/support/armsupport/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/support/armsupport/problemclassifications_client_example_test.go create mode 100644 sdk/resourcemanager/support/armsupport/problemclassificationsnosubscription_client.go create mode 100644 sdk/resourcemanager/support/armsupport/serviceclassifications_client.go create mode 100644 sdk/resourcemanager/support/armsupport/serviceclassificationsnosubscription_client.go delete mode 100644 sdk/resourcemanager/support/armsupport/services_client_example_test.go delete mode 100644 sdk/resourcemanager/support/armsupport/tickets_client_example_test.go delete mode 100644 sdk/resourcemanager/support/armsupport/ticketsnosubscription_client_example_test.go diff --git a/sdk/resourcemanager/support/armsupport/CHANGELOG.md b/sdk/resourcemanager/support/armsupport/CHANGELOG.md index 7e4d94538906..0486849b12d3 100644 --- a/sdk/resourcemanager/support/armsupport/CHANGELOG.md +++ b/sdk/resourcemanager/support/armsupport/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 2.0.0-beta.4 (2024-05-20) +### Other Changes + + ## 1.3.0 (2024-04-26) ### Features Added diff --git a/sdk/resourcemanager/support/armsupport/README.md b/sdk/resourcemanager/support/armsupport/README.md index cf8740045815..c5e420bcee7e 100644 --- a/sdk/resourcemanager/support/armsupport/README.md +++ b/sdk/resourcemanager/support/armsupport/README.md @@ -1,6 +1,6 @@ # Azure Support Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2) The `armsupport` module provides operations for working with Azure Support. @@ -20,7 +20,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Support module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2 ``` ## Authorization diff --git a/sdk/resourcemanager/support/armsupport/autorest.md b/sdk/resourcemanager/support/armsupport/autorest.md index 9ea84dc1743e..d25ed47cd210 100644 --- a/sdk/resourcemanager/support/armsupport/autorest.md +++ b/sdk/resourcemanager/support/armsupport/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/support/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/support/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.3.0 -tag: package-2024-04 +module-version: 2.0.0-beta.4 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/support/armsupport/chattranscripts_client.go b/sdk/resourcemanager/support/armsupport/chattranscripts_client.go index f6b511b0f317..05d977f30f13 100644 --- a/sdk/resourcemanager/support/armsupport/chattranscripts_client.go +++ b/sdk/resourcemanager/support/armsupport/chattranscripts_client.go @@ -46,7 +46,7 @@ func NewChatTranscriptsClient(subscriptionID string, credential azcore.TokenCred // Get - Returns chatTranscript details for a support ticket under a subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - chatTranscriptName - ChatTranscript name. // - options - ChatTranscriptsClientGetOptions contains the optional parameters for the ChatTranscriptsClient.Get method. @@ -92,7 +92,7 @@ func (client *ChatTranscriptsClient) getCreateRequest(ctx context.Context, suppo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *ChatTranscriptsClient) getHandleResponse(resp *http.Response) (Cha // NewListPager - Lists all chat transcripts for a support ticket under subscription // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - options - ChatTranscriptsClientListOptions contains the optional parameters for the ChatTranscriptsClient.NewListPager // method. @@ -152,7 +152,7 @@ func (client *ChatTranscriptsClient) listCreateRequest(ctx context.Context, supp return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/support/armsupport/chattranscripts_client_example_test.go b/sdk/resourcemanager/support/armsupport/chattranscripts_client_example_test.go deleted file mode 100644 index e61c0048a19d..000000000000 --- a/sdk/resourcemanager/support/armsupport/chattranscripts_client_example_test.go +++ /dev/null @@ -1,134 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListChatTranscriptsForSubscriptionSupportTicket.json -func ExampleChatTranscriptsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewChatTranscriptsClient().NewListPager("testticket", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ChatTranscriptsListResult = armsupport.ChatTranscriptsListResult{ - // Value: []*armsupport.ChatTranscriptDetails{ - // { - // Name: to.Ptr("55989c71-1727-4cd9-abad-ddb8770f71cd"), - // Type: to.Ptr("Microsoft.Support/chatTranscripts"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/2207120020000085/chatTranscripts/55989c71-1727-4cd9-abad-ddb8770f71cd"), - // Properties: &armsupport.ChatTranscriptDetailsProperties{ - // Messages: []*armsupport.MessageProperties{ - // { - // Body: to.Ptr("Hi"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // ContentType: to.Ptr(armsupport.TranscriptContentType("text")), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-24T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("support engineer"), - // }, - // { - // Body: to.Ptr("hi"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionInbound), - // ContentType: to.Ptr(armsupport.TranscriptContentType("text")), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-24T20:19:16.000Z"); return t}()), - // Sender: to.Ptr("user"), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-22T22:46:35.000Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("f15051e3-a2f2-489f-9e64-8cfa203f44f8"), - // Type: to.Ptr("Microsoft.Support/chatTranscripts"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/2207120020000085/chatTranscripts/f15051e3-a2f2-489f-9e64-8cfa203f44f8"), - // Properties: &armsupport.ChatTranscriptDetailsProperties{ - // Messages: []*armsupport.MessageProperties{ - // { - // Body: to.Ptr("Hi again"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // ContentType: to.Ptr(armsupport.TranscriptContentType("text")), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-25T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("support engineer 2"), - // }, - // { - // Body: to.Ptr("hello"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionInbound), - // ContentType: to.Ptr(armsupport.TranscriptContentType("text")), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-25T20:19:16.000Z"); return t}()), - // Sender: to.Ptr("user"), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-22T22:46:35.000Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetchatTranscriptDetailsForSubscriptionSupportTicket.json -func ExampleChatTranscriptsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewChatTranscriptsClient().Get(ctx, "testticket", "69586795-45e9-45b5-bd9e-c9bb237d3e44", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ChatTranscriptDetails = armsupport.ChatTranscriptDetails{ - // Name: to.Ptr("testmessage"), - // Type: to.Ptr("Microsoft.Support/chatTranscripts"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket/chatTranscripts/69586795-45e9-45b5-bd9e-c9bb237d3e44"), - // Properties: &armsupport.ChatTranscriptDetailsProperties{ - // Messages: []*armsupport.MessageProperties{ - // { - // Body: to.Ptr("Hi again"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // ContentType: to.Ptr(armsupport.TranscriptContentType("text")), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-23T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("support engineer 2"), - // }, - // { - // Body: to.Ptr("hello"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionInbound), - // ContentType: to.Ptr(armsupport.TranscriptContentType("text")), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-23T20:19:16.000Z"); return t}()), - // Sender: to.Ptr("user"), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/support/armsupport/chattranscriptsnosubscription_client.go b/sdk/resourcemanager/support/armsupport/chattranscriptsnosubscription_client.go index 050d19038cfc..fbaa51320ad6 100644 --- a/sdk/resourcemanager/support/armsupport/chattranscriptsnosubscription_client.go +++ b/sdk/resourcemanager/support/armsupport/chattranscriptsnosubscription_client.go @@ -43,7 +43,7 @@ func NewChatTranscriptsNoSubscriptionClient(credential azcore.TokenCredential, o // Get - Returns chatTranscript details for a no subscription support ticket. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - chatTranscriptName - ChatTranscript name. // - options - ChatTranscriptsNoSubscriptionClientGetOptions contains the optional parameters for the ChatTranscriptsNoSubscriptionClient.Get @@ -86,7 +86,7 @@ func (client *ChatTranscriptsNoSubscriptionClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -103,8 +103,8 @@ func (client *ChatTranscriptsNoSubscriptionClient) getHandleResponse(resp *http. // NewListPager - Lists all chat transcripts for a support ticket // -// Generated from API version 2024-04-01 -// - supportTicketName - Support ticket name +// Generated from API version 2023-06-01-preview +// - supportTicketName - Support ticket name. // - options - ChatTranscriptsNoSubscriptionClientListOptions contains the optional parameters for the ChatTranscriptsNoSubscriptionClient.NewListPager // method. func (client *ChatTranscriptsNoSubscriptionClient) NewListPager(supportTicketName string, options *ChatTranscriptsNoSubscriptionClientListOptions) *runtime.Pager[ChatTranscriptsNoSubscriptionClientListResponse] { @@ -142,7 +142,7 @@ func (client *ChatTranscriptsNoSubscriptionClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/support/armsupport/chattranscriptsnosubscription_client_example_test.go b/sdk/resourcemanager/support/armsupport/chattranscriptsnosubscription_client_example_test.go deleted file mode 100644 index e02e78efd72a..000000000000 --- a/sdk/resourcemanager/support/armsupport/chattranscriptsnosubscription_client_example_test.go +++ /dev/null @@ -1,134 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListChatTranscriptsForSupportTicket.json -func ExampleChatTranscriptsNoSubscriptionClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewChatTranscriptsNoSubscriptionClient().NewListPager("testticket", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ChatTranscriptsListResult = armsupport.ChatTranscriptsListResult{ - // Value: []*armsupport.ChatTranscriptDetails{ - // { - // Name: to.Ptr("55989c71-1727-4cd9-abad-ddb8770f71cd"), - // Type: to.Ptr("Microsoft.Support/chatTranscripts"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/2207120020000085/chatTranscripts/55989c71-1727-4cd9-abad-ddb8770f71cd"), - // Properties: &armsupport.ChatTranscriptDetailsProperties{ - // Messages: []*armsupport.MessageProperties{ - // { - // Body: to.Ptr("Hi"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // ContentType: to.Ptr(armsupport.TranscriptContentType("text")), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-24T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("support engineer"), - // }, - // { - // Body: to.Ptr("hi"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionInbound), - // ContentType: to.Ptr(armsupport.TranscriptContentType("text")), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-24T20:19:16.000Z"); return t}()), - // Sender: to.Ptr("user"), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-22T22:46:35.000Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("f15051e3-a2f2-489f-9e64-8cfa203f44f8"), - // Type: to.Ptr("Microsoft.Support/chatTranscripts"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/2207120020000085/chatTranscripts/f15051e3-a2f2-489f-9e64-8cfa203f44f8"), - // Properties: &armsupport.ChatTranscriptDetailsProperties{ - // Messages: []*armsupport.MessageProperties{ - // { - // Body: to.Ptr("Hi again"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // ContentType: to.Ptr(armsupport.TranscriptContentType("text")), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-25T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("support engineer 2"), - // }, - // { - // Body: to.Ptr("hello"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionInbound), - // ContentType: to.Ptr(armsupport.TranscriptContentType("text")), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-25T20:19:16.000Z"); return t}()), - // Sender: to.Ptr("user"), - // }}, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-08-22T22:46:35.000Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetchatTranscriptDetailsForSupportTicket.json -func ExampleChatTranscriptsNoSubscriptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewChatTranscriptsNoSubscriptionClient().Get(ctx, "testticket", "b371192a-b094-4a71-b093-7246029b0a54", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ChatTranscriptDetails = armsupport.ChatTranscriptDetails{ - // Name: to.Ptr("testmessage"), - // Type: to.Ptr("Microsoft.Support/chatTranscripts"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket/chatTranscripts/b371192a-b094-4a71-b093-7246029b0a54"), - // Properties: &armsupport.ChatTranscriptDetailsProperties{ - // Messages: []*armsupport.MessageProperties{ - // { - // Body: to.Ptr("Hi again"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // ContentType: to.Ptr(armsupport.TranscriptContentType("text")), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-25T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("support engineer 2"), - // }, - // { - // Body: to.Ptr("hello"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionInbound), - // ContentType: to.Ptr(armsupport.TranscriptContentType("text")), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-25T20:19:16.000Z"); return t}()), - // Sender: to.Ptr("user"), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/support/armsupport/client_factory.go b/sdk/resourcemanager/support/armsupport/client_factory.go index dcf60781e551..401c023595a2 100644 --- a/sdk/resourcemanager/support/armsupport/client_factory.go +++ b/sdk/resourcemanager/support/armsupport/client_factory.go @@ -96,6 +96,13 @@ func (c *ClientFactory) NewFilesNoSubscriptionClient() *FilesNoSubscriptionClien } } +// NewLookUpResourceIDClient creates a new instance of LookUpResourceIDClient. +func (c *ClientFactory) NewLookUpResourceIDClient() *LookUpResourceIDClient { + return &LookUpResourceIDClient{ + internal: c.internal, + } +} + // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { return &OperationsClient{ @@ -106,6 +113,29 @@ func (c *ClientFactory) NewOperationsClient() *OperationsClient { // NewProblemClassificationsClient creates a new instance of ProblemClassificationsClient. func (c *ClientFactory) NewProblemClassificationsClient() *ProblemClassificationsClient { return &ProblemClassificationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewProblemClassificationsNoSubscriptionClient creates a new instance of ProblemClassificationsNoSubscriptionClient. +func (c *ClientFactory) NewProblemClassificationsNoSubscriptionClient() *ProblemClassificationsNoSubscriptionClient { + return &ProblemClassificationsNoSubscriptionClient{ + internal: c.internal, + } +} + +// NewServiceClassificationsClient creates a new instance of ServiceClassificationsClient. +func (c *ClientFactory) NewServiceClassificationsClient() *ServiceClassificationsClient { + return &ServiceClassificationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewServiceClassificationsNoSubscriptionClient creates a new instance of ServiceClassificationsNoSubscriptionClient. +func (c *ClientFactory) NewServiceClassificationsNoSubscriptionClient() *ServiceClassificationsNoSubscriptionClient { + return &ServiceClassificationsNoSubscriptionClient{ internal: c.internal, } } diff --git a/sdk/resourcemanager/support/armsupport/communications_client.go b/sdk/resourcemanager/support/armsupport/communications_client.go index 6ca18a8d0c9d..bccbe8bc7b29 100644 --- a/sdk/resourcemanager/support/armsupport/communications_client.go +++ b/sdk/resourcemanager/support/armsupport/communications_client.go @@ -48,7 +48,7 @@ func NewCommunicationsClient(subscriptionID string, credential azcore.TokenCrede // name for adding a new communication to the support ticket. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - checkNameAvailabilityInput - Input to check. // - options - CommunicationsClientCheckNameAvailabilityOptions contains the optional parameters for the CommunicationsClient.CheckNameAvailability @@ -91,7 +91,7 @@ func (client *CommunicationsClient) checkNameAvailabilityCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkNameAvailabilityInput); err != nil { @@ -112,7 +112,7 @@ func (client *CommunicationsClient) checkNameAvailabilityHandleResponse(resp *ht // BeginCreate - Adds a new customer communication to an Azure support ticket. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - communicationName - Communication name. // - createCommunicationParameters - Communication object. @@ -139,7 +139,7 @@ func (client *CommunicationsClient) BeginCreate(ctx context.Context, supportTick // Create - Adds a new customer communication to an Azure support ticket. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview func (client *CommunicationsClient) create(ctx context.Context, supportTicketName string, communicationName string, createCommunicationParameters CommunicationDetails, options *CommunicationsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "CommunicationsClient.BeginCreate" @@ -181,7 +181,7 @@ func (client *CommunicationsClient) createCreateRequest(ctx context.Context, sup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createCommunicationParameters); err != nil { @@ -193,7 +193,7 @@ func (client *CommunicationsClient) createCreateRequest(ctx context.Context, sup // Get - Returns communication details for a support ticket. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - communicationName - Communication name. // - options - CommunicationsClientGetOptions contains the optional parameters for the CommunicationsClient.Get method. @@ -239,7 +239,7 @@ func (client *CommunicationsClient) getCreateRequest(ctx context.Context, suppor return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,7 +261,7 @@ func (client *CommunicationsClient) getHandleResponse(resp *http.Response) (Comm // Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, // a request for data might cause an error. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - options - CommunicationsClientListOptions contains the optional parameters for the CommunicationsClient.NewListPager method. func (client *CommunicationsClient) NewListPager(supportTicketName string, options *CommunicationsClientListOptions) *runtime.Pager[CommunicationsClientListResponse] { @@ -309,7 +309,7 @@ func (client *CommunicationsClient) listCreateRequest(ctx context.Context, suppo if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/support/armsupport/communications_client_example_test.go b/sdk/resourcemanager/support/armsupport/communications_client_example_test.go deleted file mode 100644 index 01fe8153ea0a..000000000000 --- a/sdk/resourcemanager/support/armsupport/communications_client_example_test.go +++ /dev/null @@ -1,291 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "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/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailabilityForSupportTicketCommunication.json -func ExampleCommunicationsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCommunicationsClient().CheckNameAvailability(ctx, "testticket", armsupport.CheckNameAvailabilityInput{ - Name: to.Ptr("sampleName"), - Type: to.Ptr(armsupport.TypeMicrosoftSupportCommunications), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityOutput = armsupport.CheckNameAvailabilityOutput{ - // Message: to.Ptr("Name not available"), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("Name is already in use"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListCommunicationsForSubscriptionSupportTicket.json -func ExampleCommunicationsClient_NewListPager_listCommunicationsForASubscriptionSupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCommunicationsClient().NewListPager("testticket", &armsupport.CommunicationsClientListOptions{Top: nil, - Filter: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CommunicationsListResult = armsupport.CommunicationsListResult{ - // Value: []*armsupport.CommunicationDetails{ - // { - // Name: to.Ptr("testmessage1"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage1"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("this is a test message"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-24T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("this is a test message"), - // }, - // }, - // { - // Name: to.Ptr("testmessage2"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage2"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("test"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-29T10:53:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("test"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json -func ExampleCommunicationsClient_NewListPager_listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCommunicationsClient().NewListPager("testticket", &armsupport.CommunicationsClientListOptions{Top: nil, - Filter: to.Ptr("communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CommunicationsListResult = armsupport.CommunicationsListResult{ - // Value: []*armsupport.CommunicationDetails{ - // { - // Name: to.Ptr("testmessage1"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage1"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("this is a test message"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("this is a test message"), - // }, - // }, - // { - // Name: to.Ptr("testmessage2"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage2"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("test"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T10:53:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("test"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicket.json -func ExampleCommunicationsClient_NewListPager_listWebCommunicationsForASubscriptionSupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCommunicationsClient().NewListPager("testticket", &armsupport.CommunicationsClientListOptions{Top: nil, - Filter: to.Ptr("communicationType eq 'web'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CommunicationsListResult = armsupport.CommunicationsListResult{ - // Value: []*armsupport.CommunicationDetails{ - // { - // Name: to.Ptr("testmessage1"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage1"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("this is a test message"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-10T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("this is a test message"), - // }, - // }, - // { - // Name: to.Ptr("testmessage2"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage2"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("test"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T10:53:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("test"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetCommunicationDetailsForSubscriptionSupportTicket.json -func ExampleCommunicationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCommunicationsClient().Get(ctx, "testticket", "testmessage", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CommunicationDetails = armsupport.CommunicationDetails{ - // Name: to.Ptr("testmessage"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("this is a test message"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-10T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("this is a test message"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSupportTicketCommunication.json -func ExampleCommunicationsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCommunicationsClient().BeginCreate(ctx, "testticket", "testcommunication", armsupport.CommunicationDetails{ - Properties: &armsupport.CommunicationDetailsProperties{ - Body: to.Ptr("This is a test message from a customer!"), - Sender: to.Ptr("user@contoso.com"), - Subject: to.Ptr("This is a test message from a customer!"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CommunicationDetails = armsupport.CommunicationDetails{ - // Name: to.Ptr("testcommunication"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket/communications/testcommunication"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("This is a test message from a customer!"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-10T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("This is a test message from a customer!"), - // }, - // } -} diff --git a/sdk/resourcemanager/support/armsupport/communicationsnosubscription_client.go b/sdk/resourcemanager/support/armsupport/communicationsnosubscription_client.go index 91ca7a6da8aa..76ff8e0a09b0 100644 --- a/sdk/resourcemanager/support/armsupport/communicationsnosubscription_client.go +++ b/sdk/resourcemanager/support/armsupport/communicationsnosubscription_client.go @@ -45,7 +45,7 @@ func NewCommunicationsNoSubscriptionClient(credential azcore.TokenCredential, op // name for adding a new communication to the support ticket. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - checkNameAvailabilityInput - Input to check. // - options - CommunicationsNoSubscriptionClientCheckNameAvailabilityOptions contains the optional parameters for the CommunicationsNoSubscriptionClient.CheckNameAvailability @@ -84,7 +84,7 @@ func (client *CommunicationsNoSubscriptionClient) checkNameAvailabilityCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkNameAvailabilityInput); err != nil { @@ -105,7 +105,7 @@ func (client *CommunicationsNoSubscriptionClient) checkNameAvailabilityHandleRes // BeginCreate - Adds a new customer communication to an Azure support ticket. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - communicationName - Communication name. // - createCommunicationParameters - Communication object. @@ -132,7 +132,7 @@ func (client *CommunicationsNoSubscriptionClient) BeginCreate(ctx context.Contex // Create - Adds a new customer communication to an Azure support ticket. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview func (client *CommunicationsNoSubscriptionClient) create(ctx context.Context, supportTicketName string, communicationName string, createCommunicationParameters CommunicationDetails, options *CommunicationsNoSubscriptionClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "CommunicationsNoSubscriptionClient.BeginCreate" @@ -170,7 +170,7 @@ func (client *CommunicationsNoSubscriptionClient) createCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createCommunicationParameters); err != nil { @@ -182,7 +182,7 @@ func (client *CommunicationsNoSubscriptionClient) createCreateRequest(ctx contex // Get - Returns communication details for a support ticket. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - communicationName - Communication name. // - options - CommunicationsNoSubscriptionClientGetOptions contains the optional parameters for the CommunicationsNoSubscriptionClient.Get @@ -225,7 +225,7 @@ func (client *CommunicationsNoSubscriptionClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,8 +247,8 @@ func (client *CommunicationsNoSubscriptionClient) getHandleResponse(resp *http.R // Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, // a request for data might cause an error. // -// Generated from API version 2024-04-01 -// - supportTicketName - Support ticket name +// Generated from API version 2023-06-01-preview +// - supportTicketName - Support ticket name. // - options - CommunicationsNoSubscriptionClientListOptions contains the optional parameters for the CommunicationsNoSubscriptionClient.NewListPager // method. func (client *CommunicationsNoSubscriptionClient) NewListPager(supportTicketName string, options *CommunicationsNoSubscriptionClientListOptions) *runtime.Pager[CommunicationsNoSubscriptionClientListResponse] { @@ -292,7 +292,7 @@ func (client *CommunicationsNoSubscriptionClient) listCreateRequest(ctx context. if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/support/armsupport/communicationsnosubscription_client_example_test.go b/sdk/resourcemanager/support/armsupport/communicationsnosubscription_client_example_test.go deleted file mode 100644 index 8a22409e675f..000000000000 --- a/sdk/resourcemanager/support/armsupport/communicationsnosubscription_client_example_test.go +++ /dev/null @@ -1,291 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "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/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailabilityForNoSubscriptionSupportTicketCommunication.json -func ExampleCommunicationsNoSubscriptionClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCommunicationsNoSubscriptionClient().CheckNameAvailability(ctx, "testticket", armsupport.CheckNameAvailabilityInput{ - Name: to.Ptr("sampleName"), - Type: to.Ptr(armsupport.TypeMicrosoftSupportCommunications), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityOutput = armsupport.CheckNameAvailabilityOutput{ - // Message: to.Ptr("Name not available"), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("Name is already in use"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListCommunicationsForSupportTicket.json -func ExampleCommunicationsNoSubscriptionClient_NewListPager_listCommunicationsForANoSubscriptionSupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCommunicationsNoSubscriptionClient().NewListPager("testticket", &armsupport.CommunicationsNoSubscriptionClientListOptions{Top: nil, - Filter: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CommunicationsListResult = armsupport.CommunicationsListResult{ - // Value: []*armsupport.CommunicationDetails{ - // { - // Name: to.Ptr("testmessage1"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage1"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("this is a test message"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-24T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("this is a test message"), - // }, - // }, - // { - // Name: to.Ptr("testmessage2"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage2"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("test"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-29T10:53:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("test"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSupportTicketCreatedOnOrAfter.json -func ExampleCommunicationsNoSubscriptionClient_NewListPager_listWebCommunicationCreatedOnOrAfterASpecificDateForANoSubscriptionSupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCommunicationsNoSubscriptionClient().NewListPager("testticket", &armsupport.CommunicationsNoSubscriptionClientListOptions{Top: nil, - Filter: to.Ptr("communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CommunicationsListResult = armsupport.CommunicationsListResult{ - // Value: []*armsupport.CommunicationDetails{ - // { - // Name: to.Ptr("testmessage1"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage1"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("this is a test message"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("this is a test message"), - // }, - // }, - // { - // Name: to.Ptr("testmessage2"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage2"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("test"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T10:53:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("test"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSupportTicket.json -func ExampleCommunicationsNoSubscriptionClient_NewListPager_listWebCommunicationsForANoSubscriptionSupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCommunicationsNoSubscriptionClient().NewListPager("testticket", &armsupport.CommunicationsNoSubscriptionClientListOptions{Top: nil, - Filter: to.Ptr("communicationType eq 'web'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CommunicationsListResult = armsupport.CommunicationsListResult{ - // Value: []*armsupport.CommunicationDetails{ - // { - // Name: to.Ptr("testmessage1"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage1"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("this is a test message"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-10T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("this is a test message"), - // }, - // }, - // { - // Name: to.Ptr("testmessage2"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage2"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("test"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T10:53:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("test"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetCommunicationDetailsForSupportTicket.json -func ExampleCommunicationsNoSubscriptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCommunicationsNoSubscriptionClient().Get(ctx, "testticket", "testmessage", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CommunicationDetails = armsupport.CommunicationDetails{ - // Name: to.Ptr("testmessage"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket/communications/testmessage"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("this is a test message"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-08-24T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("this is a test message"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateNoSubscriptionSupportTicketCommunication.json -func ExampleCommunicationsNoSubscriptionClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCommunicationsNoSubscriptionClient().BeginCreate(ctx, "testticket", "testcommunication", armsupport.CommunicationDetails{ - Properties: &armsupport.CommunicationDetailsProperties{ - Body: to.Ptr("This is a test message from a customer!"), - Sender: to.Ptr("user@contoso.com"), - Subject: to.Ptr("This is a test message from a customer!"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CommunicationDetails = armsupport.CommunicationDetails{ - // Name: to.Ptr("testcommunication"), - // Type: to.Ptr("Microsoft.Support/communications"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket/communications/testcommunication"), - // Properties: &armsupport.CommunicationDetailsProperties{ - // Body: to.Ptr("This is a test message from a customer!"), - // CommunicationDirection: to.Ptr(armsupport.CommunicationDirectionOutbound), - // CommunicationType: to.Ptr(armsupport.CommunicationTypeWeb), - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-10T20:18:19.000Z"); return t}()), - // Sender: to.Ptr("user@contoso.com"), - // Subject: to.Ptr("This is a test message from a customer!"), - // }, - // } -} diff --git a/sdk/resourcemanager/support/armsupport/constants.go b/sdk/resourcemanager/support/armsupport/constants.go index 7f65a524db0b..26d5bcb39816 100644 --- a/sdk/resourcemanager/support/armsupport/constants.go +++ b/sdk/resourcemanager/support/armsupport/constants.go @@ -10,7 +10,7 @@ package armsupport const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" - moduleVersion = "v1.3.0" + moduleVersion = "v2.0.0-beta.4" ) // CommunicationDirection - Direction of communication. diff --git a/sdk/resourcemanager/support/armsupport/fake/chattranscripts_server.go b/sdk/resourcemanager/support/armsupport/fake/chattranscripts_server.go index 326c5c3c6c68..1399f8b6fb2d 100644 --- a/sdk/resourcemanager/support/armsupport/fake/chattranscripts_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/chattranscripts_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/support/armsupport/fake/chattranscriptsnosubscription_server.go b/sdk/resourcemanager/support/armsupport/fake/chattranscriptsnosubscription_server.go index e41ed94f3f08..da8c03b1b3ae 100644 --- a/sdk/resourcemanager/support/armsupport/fake/chattranscriptsnosubscription_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/chattranscriptsnosubscription_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/support/armsupport/fake/communications_server.go b/sdk/resourcemanager/support/armsupport/fake/communications_server.go index ff0f75cd16e4..e9280f92dc3c 100644 --- a/sdk/resourcemanager/support/armsupport/fake/communications_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/communications_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/support/armsupport/fake/communicationsnosubscription_server.go b/sdk/resourcemanager/support/armsupport/fake/communicationsnosubscription_server.go index dc3976b10b2d..44f63360205c 100644 --- a/sdk/resourcemanager/support/armsupport/fake/communicationsnosubscription_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/communicationsnosubscription_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/support/armsupport/fake/files_server.go b/sdk/resourcemanager/support/armsupport/fake/files_server.go index bcb795a7b3de..3577fd0f33db 100644 --- a/sdk/resourcemanager/support/armsupport/fake/files_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/files_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/support/armsupport/fake/filesnosubscription_server.go b/sdk/resourcemanager/support/armsupport/fake/filesnosubscription_server.go index 0d91ea9a8c93..c8bbe9882d73 100644 --- a/sdk/resourcemanager/support/armsupport/fake/filesnosubscription_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/filesnosubscription_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/support/armsupport/fake/fileworkspaces_server.go b/sdk/resourcemanager/support/armsupport/fake/fileworkspaces_server.go index d858a24b65e5..09c7701153b8 100644 --- a/sdk/resourcemanager/support/armsupport/fake/fileworkspaces_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/fileworkspaces_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/support/armsupport/fake/fileworkspacesnosubscription_server.go b/sdk/resourcemanager/support/armsupport/fake/fileworkspacesnosubscription_server.go index 4c9260f90e09..1c3f19cd88b1 100644 --- a/sdk/resourcemanager/support/armsupport/fake/fileworkspacesnosubscription_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/fileworkspacesnosubscription_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/support/armsupport/fake/lookupresourceid_server.go b/sdk/resourcemanager/support/armsupport/fake/lookupresourceid_server.go new file mode 100644 index 000000000000..1409d3c77b58 --- /dev/null +++ b/sdk/resourcemanager/support/armsupport/fake/lookupresourceid_server.go @@ -0,0 +1,88 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" + "net/http" +) + +// LookUpResourceIDServer is a fake server for instances of the armsupport.LookUpResourceIDClient type. +type LookUpResourceIDServer struct { + // Post is the fake for method LookUpResourceIDClient.Post + // HTTP status codes to indicate success: http.StatusOK + Post func(ctx context.Context, lookUpResourceIDRequest armsupport.LookUpResourceIDRequest, options *armsupport.LookUpResourceIDClientPostOptions) (resp azfake.Responder[armsupport.LookUpResourceIDClientPostResponse], errResp azfake.ErrorResponder) +} + +// NewLookUpResourceIDServerTransport creates a new instance of LookUpResourceIDServerTransport with the provided implementation. +// The returned LookUpResourceIDServerTransport instance is connected to an instance of armsupport.LookUpResourceIDClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewLookUpResourceIDServerTransport(srv *LookUpResourceIDServer) *LookUpResourceIDServerTransport { + return &LookUpResourceIDServerTransport{srv: srv} +} + +// LookUpResourceIDServerTransport connects instances of armsupport.LookUpResourceIDClient to instances of LookUpResourceIDServer. +// Don't use this type directly, use NewLookUpResourceIDServerTransport instead. +type LookUpResourceIDServerTransport struct { + srv *LookUpResourceIDServer +} + +// Do implements the policy.Transporter interface for LookUpResourceIDServerTransport. +func (l *LookUpResourceIDServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "LookUpResourceIDClient.Post": + resp, err = l.dispatchPost(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (l *LookUpResourceIDServerTransport) dispatchPost(req *http.Request) (*http.Response, error) { + if l.srv.Post == nil { + return nil, &nonRetriableError{errors.New("fake for method Post not implemented")} + } + body, err := server.UnmarshalRequestAsJSON[armsupport.LookUpResourceIDRequest](req) + if err != nil { + return nil, err + } + respr, errRespr := l.srv.Post(req.Context(), body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LookUpResourceIDResponse, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/support/armsupport/fake/operations_server.go b/sdk/resourcemanager/support/armsupport/fake/operations_server.go index 734de9818fcd..0a4ff2051f66 100644 --- a/sdk/resourcemanager/support/armsupport/fake/operations_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/operations_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" ) diff --git a/sdk/resourcemanager/support/armsupport/fake/problemclassifications_server.go b/sdk/resourcemanager/support/armsupport/fake/problemclassifications_server.go index b3ee808ef91b..865f9d717755 100644 --- a/sdk/resourcemanager/support/armsupport/fake/problemclassifications_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/problemclassifications_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" "net/url" "regexp" @@ -23,6 +23,10 @@ import ( // ProblemClassificationsServer is a fake server for instances of the armsupport.ProblemClassificationsClient type. type ProblemClassificationsServer struct { + // ClassifyProblems is the fake for method ProblemClassificationsClient.ClassifyProblems + // HTTP status codes to indicate success: http.StatusOK + ClassifyProblems func(ctx context.Context, problemServiceName string, problemClassificationsClassificationInput armsupport.ProblemClassificationsClassificationInput, options *armsupport.ProblemClassificationsClientClassifyProblemsOptions) (resp azfake.Responder[armsupport.ProblemClassificationsClientClassifyProblemsResponse], errResp azfake.ErrorResponder) + // Get is the fake for method ProblemClassificationsClient.Get // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, serviceName string, problemClassificationName string, options *armsupport.ProblemClassificationsClientGetOptions) (resp azfake.Responder[armsupport.ProblemClassificationsClientGetResponse], errResp azfake.ErrorResponder) @@ -61,6 +65,8 @@ func (p *ProblemClassificationsServerTransport) Do(req *http.Request) (*http.Res var err error switch method { + case "ProblemClassificationsClient.ClassifyProblems": + resp, err = p.dispatchClassifyProblems(req) case "ProblemClassificationsClient.Get": resp, err = p.dispatchGet(req) case "ProblemClassificationsClient.NewListPager": @@ -76,6 +82,39 @@ func (p *ProblemClassificationsServerTransport) Do(req *http.Request) (*http.Res return resp, nil } +func (p *ProblemClassificationsServerTransport) dispatchClassifyProblems(req *http.Request) (*http.Response, error) { + if p.srv.ClassifyProblems == nil { + return nil, &nonRetriableError{errors.New("fake for method ClassifyProblems not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Support/services/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/classifyProblems` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armsupport.ProblemClassificationsClassificationInput](req) + if err != nil { + return nil, err + } + problemServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("problemServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.ClassifyProblems(req.Context(), problemServiceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ProblemClassificationsClassificationOutput, req) + if err != nil { + return nil, err + } + return resp, nil +} + func (p *ProblemClassificationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { if p.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} diff --git a/sdk/resourcemanager/support/armsupport/fake/problemclassificationsnosubscription_server.go b/sdk/resourcemanager/support/armsupport/fake/problemclassificationsnosubscription_server.go new file mode 100644 index 000000000000..06389bbdc3ef --- /dev/null +++ b/sdk/resourcemanager/support/armsupport/fake/problemclassificationsnosubscription_server.go @@ -0,0 +1,100 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" + "net/http" + "net/url" + "regexp" +) + +// ProblemClassificationsNoSubscriptionServer is a fake server for instances of the armsupport.ProblemClassificationsNoSubscriptionClient type. +type ProblemClassificationsNoSubscriptionServer struct { + // ClassifyProblems is the fake for method ProblemClassificationsNoSubscriptionClient.ClassifyProblems + // HTTP status codes to indicate success: http.StatusOK + ClassifyProblems func(ctx context.Context, problemServiceName string, problemClassificationsClassificationInput armsupport.ProblemClassificationsClassificationInput, options *armsupport.ProblemClassificationsNoSubscriptionClientClassifyProblemsOptions) (resp azfake.Responder[armsupport.ProblemClassificationsNoSubscriptionClientClassifyProblemsResponse], errResp azfake.ErrorResponder) +} + +// NewProblemClassificationsNoSubscriptionServerTransport creates a new instance of ProblemClassificationsNoSubscriptionServerTransport with the provided implementation. +// The returned ProblemClassificationsNoSubscriptionServerTransport instance is connected to an instance of armsupport.ProblemClassificationsNoSubscriptionClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewProblemClassificationsNoSubscriptionServerTransport(srv *ProblemClassificationsNoSubscriptionServer) *ProblemClassificationsNoSubscriptionServerTransport { + return &ProblemClassificationsNoSubscriptionServerTransport{srv: srv} +} + +// ProblemClassificationsNoSubscriptionServerTransport connects instances of armsupport.ProblemClassificationsNoSubscriptionClient to instances of ProblemClassificationsNoSubscriptionServer. +// Don't use this type directly, use NewProblemClassificationsNoSubscriptionServerTransport instead. +type ProblemClassificationsNoSubscriptionServerTransport struct { + srv *ProblemClassificationsNoSubscriptionServer +} + +// Do implements the policy.Transporter interface for ProblemClassificationsNoSubscriptionServerTransport. +func (p *ProblemClassificationsNoSubscriptionServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ProblemClassificationsNoSubscriptionClient.ClassifyProblems": + resp, err = p.dispatchClassifyProblems(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (p *ProblemClassificationsNoSubscriptionServerTransport) dispatchClassifyProblems(req *http.Request) (*http.Response, error) { + if p.srv.ClassifyProblems == nil { + return nil, &nonRetriableError{errors.New("fake for method ClassifyProblems not implemented")} + } + const regexStr = `/providers/Microsoft\.Support/services/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/classifyProblems` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armsupport.ProblemClassificationsClassificationInput](req) + if err != nil { + return nil, err + } + problemServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("problemServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := p.srv.ClassifyProblems(req.Context(), problemServiceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ProblemClassificationsClassificationOutput, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/support/armsupport/fake/server_factory.go b/sdk/resourcemanager/support/armsupport/fake/server_factory.go index eee22f97c4dd..5b4a3b1cedea 100644 --- a/sdk/resourcemanager/support/armsupport/fake/server_factory.go +++ b/sdk/resourcemanager/support/armsupport/fake/server_factory.go @@ -19,19 +19,23 @@ import ( // ServerFactory is a fake server for instances of the armsupport.ClientFactory type. type ServerFactory struct { - ChatTranscriptsServer ChatTranscriptsServer - ChatTranscriptsNoSubscriptionServer ChatTranscriptsNoSubscriptionServer - CommunicationsServer CommunicationsServer - CommunicationsNoSubscriptionServer CommunicationsNoSubscriptionServer - FileWorkspacesServer FileWorkspacesServer - FileWorkspacesNoSubscriptionServer FileWorkspacesNoSubscriptionServer - FilesServer FilesServer - FilesNoSubscriptionServer FilesNoSubscriptionServer - OperationsServer OperationsServer - ProblemClassificationsServer ProblemClassificationsServer - ServicesServer ServicesServer - TicketsServer TicketsServer - TicketsNoSubscriptionServer TicketsNoSubscriptionServer + ChatTranscriptsServer ChatTranscriptsServer + ChatTranscriptsNoSubscriptionServer ChatTranscriptsNoSubscriptionServer + CommunicationsServer CommunicationsServer + CommunicationsNoSubscriptionServer CommunicationsNoSubscriptionServer + FileWorkspacesServer FileWorkspacesServer + FileWorkspacesNoSubscriptionServer FileWorkspacesNoSubscriptionServer + FilesServer FilesServer + FilesNoSubscriptionServer FilesNoSubscriptionServer + LookUpResourceIDServer LookUpResourceIDServer + OperationsServer OperationsServer + ProblemClassificationsServer ProblemClassificationsServer + ProblemClassificationsNoSubscriptionServer ProblemClassificationsNoSubscriptionServer + ServiceClassificationsServer ServiceClassificationsServer + ServiceClassificationsNoSubscriptionServer ServiceClassificationsNoSubscriptionServer + ServicesServer ServicesServer + TicketsServer TicketsServer + TicketsNoSubscriptionServer TicketsNoSubscriptionServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -46,21 +50,25 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armsupport.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trChatTranscriptsServer *ChatTranscriptsServerTransport - trChatTranscriptsNoSubscriptionServer *ChatTranscriptsNoSubscriptionServerTransport - trCommunicationsServer *CommunicationsServerTransport - trCommunicationsNoSubscriptionServer *CommunicationsNoSubscriptionServerTransport - trFileWorkspacesServer *FileWorkspacesServerTransport - trFileWorkspacesNoSubscriptionServer *FileWorkspacesNoSubscriptionServerTransport - trFilesServer *FilesServerTransport - trFilesNoSubscriptionServer *FilesNoSubscriptionServerTransport - trOperationsServer *OperationsServerTransport - trProblemClassificationsServer *ProblemClassificationsServerTransport - trServicesServer *ServicesServerTransport - trTicketsServer *TicketsServerTransport - trTicketsNoSubscriptionServer *TicketsNoSubscriptionServerTransport + srv *ServerFactory + trMu sync.Mutex + trChatTranscriptsServer *ChatTranscriptsServerTransport + trChatTranscriptsNoSubscriptionServer *ChatTranscriptsNoSubscriptionServerTransport + trCommunicationsServer *CommunicationsServerTransport + trCommunicationsNoSubscriptionServer *CommunicationsNoSubscriptionServerTransport + trFileWorkspacesServer *FileWorkspacesServerTransport + trFileWorkspacesNoSubscriptionServer *FileWorkspacesNoSubscriptionServerTransport + trFilesServer *FilesServerTransport + trFilesNoSubscriptionServer *FilesNoSubscriptionServerTransport + trLookUpResourceIDServer *LookUpResourceIDServerTransport + trOperationsServer *OperationsServerTransport + trProblemClassificationsServer *ProblemClassificationsServerTransport + trProblemClassificationsNoSubscriptionServer *ProblemClassificationsNoSubscriptionServerTransport + trServiceClassificationsServer *ServiceClassificationsServerTransport + trServiceClassificationsNoSubscriptionServer *ServiceClassificationsNoSubscriptionServerTransport + trServicesServer *ServicesServerTransport + trTicketsServer *TicketsServerTransport + trTicketsNoSubscriptionServer *TicketsNoSubscriptionServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -114,6 +122,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewFilesNoSubscriptionServerTransport(&s.srv.FilesNoSubscriptionServer) }) resp, err = s.trFilesNoSubscriptionServer.Do(req) + case "LookUpResourceIDClient": + initServer(s, &s.trLookUpResourceIDServer, func() *LookUpResourceIDServerTransport { + return NewLookUpResourceIDServerTransport(&s.srv.LookUpResourceIDServer) + }) + resp, err = s.trLookUpResourceIDServer.Do(req) case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) @@ -122,6 +135,21 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewProblemClassificationsServerTransport(&s.srv.ProblemClassificationsServer) }) resp, err = s.trProblemClassificationsServer.Do(req) + case "ProblemClassificationsNoSubscriptionClient": + initServer(s, &s.trProblemClassificationsNoSubscriptionServer, func() *ProblemClassificationsNoSubscriptionServerTransport { + return NewProblemClassificationsNoSubscriptionServerTransport(&s.srv.ProblemClassificationsNoSubscriptionServer) + }) + resp, err = s.trProblemClassificationsNoSubscriptionServer.Do(req) + case "ServiceClassificationsClient": + initServer(s, &s.trServiceClassificationsServer, func() *ServiceClassificationsServerTransport { + return NewServiceClassificationsServerTransport(&s.srv.ServiceClassificationsServer) + }) + resp, err = s.trServiceClassificationsServer.Do(req) + case "ServiceClassificationsNoSubscriptionClient": + initServer(s, &s.trServiceClassificationsNoSubscriptionServer, func() *ServiceClassificationsNoSubscriptionServerTransport { + return NewServiceClassificationsNoSubscriptionServerTransport(&s.srv.ServiceClassificationsNoSubscriptionServer) + }) + resp, err = s.trServiceClassificationsNoSubscriptionServer.Do(req) case "ServicesClient": initServer(s, &s.trServicesServer, func() *ServicesServerTransport { return NewServicesServerTransport(&s.srv.ServicesServer) }) resp, err = s.trServicesServer.Do(req) diff --git a/sdk/resourcemanager/support/armsupport/fake/serviceclassifications_server.go b/sdk/resourcemanager/support/armsupport/fake/serviceclassifications_server.go new file mode 100644 index 000000000000..761849ed1a87 --- /dev/null +++ b/sdk/resourcemanager/support/armsupport/fake/serviceclassifications_server.go @@ -0,0 +1,95 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" + "net/http" + "regexp" +) + +// ServiceClassificationsServer is a fake server for instances of the armsupport.ServiceClassificationsClient type. +type ServiceClassificationsServer struct { + // ClassifyServices is the fake for method ServiceClassificationsClient.ClassifyServices + // HTTP status codes to indicate success: http.StatusOK + ClassifyServices func(ctx context.Context, serviceClassificationRequest armsupport.ServiceClassificationRequest, options *armsupport.ServiceClassificationsClientClassifyServicesOptions) (resp azfake.Responder[armsupport.ServiceClassificationsClientClassifyServicesResponse], errResp azfake.ErrorResponder) +} + +// NewServiceClassificationsServerTransport creates a new instance of ServiceClassificationsServerTransport with the provided implementation. +// The returned ServiceClassificationsServerTransport instance is connected to an instance of armsupport.ServiceClassificationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewServiceClassificationsServerTransport(srv *ServiceClassificationsServer) *ServiceClassificationsServerTransport { + return &ServiceClassificationsServerTransport{srv: srv} +} + +// ServiceClassificationsServerTransport connects instances of armsupport.ServiceClassificationsClient to instances of ServiceClassificationsServer. +// Don't use this type directly, use NewServiceClassificationsServerTransport instead. +type ServiceClassificationsServerTransport struct { + srv *ServiceClassificationsServer +} + +// Do implements the policy.Transporter interface for ServiceClassificationsServerTransport. +func (s *ServiceClassificationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ServiceClassificationsClient.ClassifyServices": + resp, err = s.dispatchClassifyServices(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *ServiceClassificationsServerTransport) dispatchClassifyServices(req *http.Request) (*http.Response, error) { + if s.srv.ClassifyServices == nil { + return nil, &nonRetriableError{errors.New("fake for method ClassifyServices not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Support/classifyServices` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armsupport.ServiceClassificationRequest](req) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.ClassifyServices(req.Context(), body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServiceClassificationOutput, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/support/armsupport/fake/serviceclassificationsnosubscription_server.go b/sdk/resourcemanager/support/armsupport/fake/serviceclassificationsnosubscription_server.go new file mode 100644 index 000000000000..0dab357d2968 --- /dev/null +++ b/sdk/resourcemanager/support/armsupport/fake/serviceclassificationsnosubscription_server.go @@ -0,0 +1,88 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" + "net/http" +) + +// ServiceClassificationsNoSubscriptionServer is a fake server for instances of the armsupport.ServiceClassificationsNoSubscriptionClient type. +type ServiceClassificationsNoSubscriptionServer struct { + // ClassifyServices is the fake for method ServiceClassificationsNoSubscriptionClient.ClassifyServices + // HTTP status codes to indicate success: http.StatusOK + ClassifyServices func(ctx context.Context, serviceClassificationRequest armsupport.ServiceClassificationRequest, options *armsupport.ServiceClassificationsNoSubscriptionClientClassifyServicesOptions) (resp azfake.Responder[armsupport.ServiceClassificationsNoSubscriptionClientClassifyServicesResponse], errResp azfake.ErrorResponder) +} + +// NewServiceClassificationsNoSubscriptionServerTransport creates a new instance of ServiceClassificationsNoSubscriptionServerTransport with the provided implementation. +// The returned ServiceClassificationsNoSubscriptionServerTransport instance is connected to an instance of armsupport.ServiceClassificationsNoSubscriptionClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewServiceClassificationsNoSubscriptionServerTransport(srv *ServiceClassificationsNoSubscriptionServer) *ServiceClassificationsNoSubscriptionServerTransport { + return &ServiceClassificationsNoSubscriptionServerTransport{srv: srv} +} + +// ServiceClassificationsNoSubscriptionServerTransport connects instances of armsupport.ServiceClassificationsNoSubscriptionClient to instances of ServiceClassificationsNoSubscriptionServer. +// Don't use this type directly, use NewServiceClassificationsNoSubscriptionServerTransport instead. +type ServiceClassificationsNoSubscriptionServerTransport struct { + srv *ServiceClassificationsNoSubscriptionServer +} + +// Do implements the policy.Transporter interface for ServiceClassificationsNoSubscriptionServerTransport. +func (s *ServiceClassificationsNoSubscriptionServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ServiceClassificationsNoSubscriptionClient.ClassifyServices": + resp, err = s.dispatchClassifyServices(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *ServiceClassificationsNoSubscriptionServerTransport) dispatchClassifyServices(req *http.Request) (*http.Response, error) { + if s.srv.ClassifyServices == nil { + return nil, &nonRetriableError{errors.New("fake for method ClassifyServices not implemented")} + } + body, err := server.UnmarshalRequestAsJSON[armsupport.ServiceClassificationRequest](req) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.ClassifyServices(req.Context(), body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ServiceClassificationOutput, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/support/armsupport/fake/services_server.go b/sdk/resourcemanager/support/armsupport/fake/services_server.go index f229188b8e90..8a4157fb46a6 100644 --- a/sdk/resourcemanager/support/armsupport/fake/services_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/services_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/support/armsupport/fake/tickets_server.go b/sdk/resourcemanager/support/armsupport/fake/tickets_server.go index 03637cf91afd..b8152d14157d 100644 --- a/sdk/resourcemanager/support/armsupport/fake/tickets_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/tickets_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/support/armsupport/fake/ticketsnosubscription_server.go b/sdk/resourcemanager/support/armsupport/fake/ticketsnosubscription_server.go index e804df5e925b..c6c45d3ed592 100644 --- a/sdk/resourcemanager/support/armsupport/fake/ticketsnosubscription_server.go +++ b/sdk/resourcemanager/support/armsupport/fake/ticketsnosubscription_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/support/armsupport/files_client.go b/sdk/resourcemanager/support/armsupport/files_client.go index ab5e25c5702a..c2428c655bc3 100644 --- a/sdk/resourcemanager/support/armsupport/files_client.go +++ b/sdk/resourcemanager/support/armsupport/files_client.go @@ -46,7 +46,7 @@ func NewFilesClient(subscriptionID string, credential azcore.TokenCredential, op // Create - Creates a new file under a workspace for the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - fileWorkspaceName - File workspace name. // - fileName - File name. // - createFileParameters - Create file object @@ -93,7 +93,7 @@ func (client *FilesClient) createCreateRequest(ctx context.Context, fileWorkspac return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createFileParameters); err != nil { @@ -114,7 +114,7 @@ func (client *FilesClient) createHandleResponse(resp *http.Response) (FilesClien // Get - Returns details of a specific file in a work space. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - fileWorkspaceName - File Workspace Name // - fileName - File Name // - options - FilesClientGetOptions contains the optional parameters for the FilesClient.Get method. @@ -160,7 +160,7 @@ func (client *FilesClient) getCreateRequest(ctx context.Context, fileWorkspaceNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,7 +177,7 @@ func (client *FilesClient) getHandleResponse(resp *http.Response) (FilesClientGe // NewListPager - Lists all the Files information under a workspace for an Azure subscription. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - fileWorkspaceName - File Workspace Name // - options - FilesClientListOptions contains the optional parameters for the FilesClient.NewListPager method. func (client *FilesClient) NewListPager(fileWorkspaceName string, options *FilesClientListOptions) *runtime.Pager[FilesClientListResponse] { @@ -219,7 +219,7 @@ func (client *FilesClient) listCreateRequest(ctx context.Context, fileWorkspaceN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,7 +237,7 @@ func (client *FilesClient) listHandleResponse(resp *http.Response) (FilesClientL // Upload - This API allows you to upload content to a file // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - fileWorkspaceName - File WorkspaceName // - fileName - File Name // - uploadFile - UploadFile object @@ -283,7 +283,7 @@ func (client *FilesClient) uploadCreateRequest(ctx context.Context, fileWorkspac return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, uploadFile); err != nil { diff --git a/sdk/resourcemanager/support/armsupport/files_client_example_test.go b/sdk/resourcemanager/support/armsupport/files_client_example_test.go deleted file mode 100644 index 502bd5e1c656..000000000000 --- a/sdk/resourcemanager/support/armsupport/files_client_example_test.go +++ /dev/null @@ -1,143 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "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/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListFilesForSubscriptionUnderFileWorkspace.json -func ExampleFilesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFilesClient().NewListPager("testworkspace", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FilesListResult = armsupport.FilesListResult{ - // Value: []*armsupport.FileDetails{ - // { - // Name: to.Ptr("test1.txt"), - // Type: to.Ptr("Microsoft.Support/files"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/fileWorkspaces/testworkspace/files/test1.txt"), - // Properties: &armsupport.FileDetailsProperties{ - // ChunkSize: to.Ptr[int32](41423), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-24T20:18:19.000Z"); return t}()), - // FileSize: to.Ptr[int32](41423), - // NumberOfChunks: to.Ptr[int32](1), - // }, - // }, - // { - // Name: to.Ptr("test2.txt"), - // Type: to.Ptr("Microsoft.Support/files"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/fileWorkspaces/testworkspace/files/test2.txt"), - // Properties: &armsupport.FileDetailsProperties{ - // ChunkSize: to.Ptr[int32](41423), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-24T20:18:19.000Z"); return t}()), - // FileSize: to.Ptr[int32](41423), - // NumberOfChunks: to.Ptr[int32](1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileDetailsForSubscription.json -func ExampleFilesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFilesClient().Get(ctx, "testworkspace", "test.txt", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FileDetails = armsupport.FileDetails{ - // Name: to.Ptr("test.txt"), - // Type: to.Ptr("Microsoft.Support/files"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/fileWorkspaces/testworkspace/files/test.txt"), - // Properties: &armsupport.FileDetailsProperties{ - // ChunkSize: to.Ptr[int32](41423), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-24T20:18:19.000Z"); return t}()), - // FileSize: to.Ptr[int32](41423), - // NumberOfChunks: to.Ptr[int32](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileForSubscription.json -func ExampleFilesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFilesClient().Create(ctx, "testworkspace", "test.txt", armsupport.FileDetails{ - Properties: &armsupport.FileDetailsProperties{ - ChunkSize: to.Ptr[int32](41423), - FileSize: to.Ptr[int32](41423), - NumberOfChunks: to.Ptr[int32](1), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UploadFileForSubscription.json -func ExampleFilesClient_Upload() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFilesClient().Upload(ctx, "testworkspaceName", "test.txt", armsupport.UploadFile{ - ChunkIndex: to.Ptr[int32](0), - Content: to.Ptr("iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABd"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/support/armsupport/filesnosubscription_client.go b/sdk/resourcemanager/support/armsupport/filesnosubscription_client.go index 85d350fd2d8e..58eca95804b8 100644 --- a/sdk/resourcemanager/support/armsupport/filesnosubscription_client.go +++ b/sdk/resourcemanager/support/armsupport/filesnosubscription_client.go @@ -43,7 +43,7 @@ func NewFilesNoSubscriptionClient(credential azcore.TokenCredential, options *ar // Create - Creates a new file under a workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - fileWorkspaceName - File workspace name. // - fileName - File name. // - createFileParameters - Create file object @@ -87,7 +87,7 @@ func (client *FilesNoSubscriptionClient) createCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createFileParameters); err != nil { @@ -108,7 +108,7 @@ func (client *FilesNoSubscriptionClient) createHandleResponse(resp *http.Respons // Get - Returns details of a specific file in a work space. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - fileWorkspaceName - File Workspace Name // - fileName - File Name // - options - FilesNoSubscriptionClientGetOptions contains the optional parameters for the FilesNoSubscriptionClient.Get method. @@ -150,7 +150,7 @@ func (client *FilesNoSubscriptionClient) getCreateRequest(ctx context.Context, f return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -167,7 +167,7 @@ func (client *FilesNoSubscriptionClient) getHandleResponse(resp *http.Response) // NewListPager - Lists all the Files information under a workspace for an Azure subscription. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - fileWorkspaceName - File Workspace Name // - options - FilesNoSubscriptionClientListOptions contains the optional parameters for the FilesNoSubscriptionClient.NewListPager // method. @@ -206,7 +206,7 @@ func (client *FilesNoSubscriptionClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,7 +224,7 @@ func (client *FilesNoSubscriptionClient) listHandleResponse(resp *http.Response) // Upload - This API allows you to upload content to a file // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - fileWorkspaceName - File WorkspaceName // - fileName - File Name // - uploadFile - UploadFile object @@ -267,7 +267,7 @@ func (client *FilesNoSubscriptionClient) uploadCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, uploadFile); err != nil { diff --git a/sdk/resourcemanager/support/armsupport/filesnosubscription_client_example_test.go b/sdk/resourcemanager/support/armsupport/filesnosubscription_client_example_test.go deleted file mode 100644 index 30571bb36a7a..000000000000 --- a/sdk/resourcemanager/support/armsupport/filesnosubscription_client_example_test.go +++ /dev/null @@ -1,143 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "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/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListFilesUnderFileWorkspace.json -func ExampleFilesNoSubscriptionClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewFilesNoSubscriptionClient().NewListPager("testworkspace", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.FilesListResult = armsupport.FilesListResult{ - // Value: []*armsupport.FileDetails{ - // { - // Name: to.Ptr("test1.txt"), - // Type: to.Ptr("Microsoft.Support/files"), - // ID: to.Ptr("/providers/Microsoft.Support/fileWorkspaces/testworkspace/files/test1.txt"), - // Properties: &armsupport.FileDetailsProperties{ - // ChunkSize: to.Ptr[int32](41423), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-24T20:18:19.000Z"); return t}()), - // FileSize: to.Ptr[int32](41423), - // NumberOfChunks: to.Ptr[int32](1), - // }, - // }, - // { - // Name: to.Ptr("test1.txt"), - // Type: to.Ptr("Microsoft.Support/files"), - // ID: to.Ptr("/providers/Microsoft.Support/fileWorkspaces/testworkspace/files/test1.txt"), - // Properties: &armsupport.FileDetailsProperties{ - // ChunkSize: to.Ptr[int32](41423), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-24T20:18:19.000Z"); return t}()), - // FileSize: to.Ptr[int32](41423), - // NumberOfChunks: to.Ptr[int32](1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileDetails.json -func ExampleFilesNoSubscriptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFilesNoSubscriptionClient().Get(ctx, "testworkspace", "test.txt", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FileDetails = armsupport.FileDetails{ - // Name: to.Ptr("test.txt"), - // Type: to.Ptr("Microsoft.Support/files"), - // ID: to.Ptr("/providers/Microsoft.Support/fileWorkspaces/testworkspace/files/test.txt"), - // Properties: &armsupport.FileDetailsProperties{ - // ChunkSize: to.Ptr[int32](41423), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-24T20:18:19.000Z"); return t}()), - // FileSize: to.Ptr[int32](41423), - // NumberOfChunks: to.Ptr[int32](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFile.json -func ExampleFilesNoSubscriptionClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFilesNoSubscriptionClient().Create(ctx, "testworkspace", "test.txt", armsupport.FileDetails{ - Properties: &armsupport.FileDetailsProperties{ - ChunkSize: to.Ptr[int32](41423), - FileSize: to.Ptr[int32](41423), - NumberOfChunks: to.Ptr[int32](1), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UploadFile.json -func ExampleFilesNoSubscriptionClient_Upload() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFilesNoSubscriptionClient().Upload(ctx, "testworkspaceName", "test.txt", armsupport.UploadFile{ - ChunkIndex: to.Ptr[int32](0), - Content: to.Ptr("iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABd"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/support/armsupport/fileworkspaces_client.go b/sdk/resourcemanager/support/armsupport/fileworkspaces_client.go index 44cac4761b50..f6c64dd2420e 100644 --- a/sdk/resourcemanager/support/armsupport/fileworkspaces_client.go +++ b/sdk/resourcemanager/support/armsupport/fileworkspaces_client.go @@ -46,7 +46,7 @@ func NewFileWorkspacesClient(subscriptionID string, credential azcore.TokenCrede // Create - Creates a new file workspace for the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - fileWorkspaceName - File workspace name. // - options - FileWorkspacesClientCreateOptions contains the optional parameters for the FileWorkspacesClient.Create method. func (client *FileWorkspacesClient) Create(ctx context.Context, fileWorkspaceName string, options *FileWorkspacesClientCreateOptions) (FileWorkspacesClientCreateResponse, error) { @@ -87,7 +87,7 @@ func (client *FileWorkspacesClient) createCreateRequest(ctx context.Context, fil return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,7 +105,7 @@ func (client *FileWorkspacesClient) createHandleResponse(resp *http.Response) (F // Get - Gets details for a specific file workspace in an Azure subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - fileWorkspaceName - File Workspace Name // - options - FileWorkspacesClientGetOptions contains the optional parameters for the FileWorkspacesClient.Get method. func (client *FileWorkspacesClient) Get(ctx context.Context, fileWorkspaceName string, options *FileWorkspacesClientGetOptions) (FileWorkspacesClientGetResponse, error) { @@ -146,7 +146,7 @@ func (client *FileWorkspacesClient) getCreateRequest(ctx context.Context, fileWo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/support/armsupport/fileworkspaces_client_example_test.go b/sdk/resourcemanager/support/armsupport/fileworkspaces_client_example_test.go deleted file mode 100644 index 03452efe4d64..000000000000 --- a/sdk/resourcemanager/support/armsupport/fileworkspaces_client_example_test.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileWorkspaceDetailsForSubscription.json -func ExampleFileWorkspacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFileWorkspacesClient().Get(ctx, "testworkspace", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FileWorkspaceDetails = armsupport.FileWorkspaceDetails{ - // Name: to.Ptr("testworkspace"), - // Type: to.Ptr("Microsoft.Support/fileWorkspaces"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/fileWorkspaces/testworkspace"), - // Properties: &armsupport.FileWorkspaceDetailsProperties{ - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-24T20:18:19.000Z"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-25T20:18:19.000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileWorkspaceForSubscription.json -func ExampleFileWorkspacesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFileWorkspacesClient().Create(ctx, "testworkspace", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/support/armsupport/fileworkspacesnosubscription_client.go b/sdk/resourcemanager/support/armsupport/fileworkspacesnosubscription_client.go index c7b790abc58e..f7d0455d3d22 100644 --- a/sdk/resourcemanager/support/armsupport/fileworkspacesnosubscription_client.go +++ b/sdk/resourcemanager/support/armsupport/fileworkspacesnosubscription_client.go @@ -43,7 +43,7 @@ func NewFileWorkspacesNoSubscriptionClient(credential azcore.TokenCredential, op // Create - Creates a new file workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - fileWorkspaceName - File workspace name. // - options - FileWorkspacesNoSubscriptionClientCreateOptions contains the optional parameters for the FileWorkspacesNoSubscriptionClient.Create // method. @@ -81,7 +81,7 @@ func (client *FileWorkspacesNoSubscriptionClient) createCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -99,7 +99,7 @@ func (client *FileWorkspacesNoSubscriptionClient) createHandleResponse(resp *htt // Get - Gets details for a specific file workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - fileWorkspaceName - File Workspace Name // - options - FileWorkspacesNoSubscriptionClientGetOptions contains the optional parameters for the FileWorkspacesNoSubscriptionClient.Get // method. @@ -137,7 +137,7 @@ func (client *FileWorkspacesNoSubscriptionClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/support/armsupport/fileworkspacesnosubscription_client_example_test.go b/sdk/resourcemanager/support/armsupport/fileworkspacesnosubscription_client_example_test.go deleted file mode 100644 index dc445848f1d3..000000000000 --- a/sdk/resourcemanager/support/armsupport/fileworkspacesnosubscription_client_example_test.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileWorkspaceDetails.json -func ExampleFileWorkspacesNoSubscriptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFileWorkspacesNoSubscriptionClient().Get(ctx, "testworkspace", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.FileWorkspaceDetails = armsupport.FileWorkspaceDetails{ - // Name: to.Ptr("testworkspace"), - // Type: to.Ptr("Microsoft.Support/fileWorkspaces"), - // ID: to.Ptr("/providers/Microsoft.Support/fileWorkspaces/testworkspace"), - // Properties: &armsupport.FileWorkspaceDetailsProperties{ - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-24T20:18:19.000Z"); return t}()), - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-25T20:18:19.000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileWorkspace.json -func ExampleFileWorkspacesNoSubscriptionClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewFileWorkspacesNoSubscriptionClient().Create(ctx, "testworkspace", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/support/armsupport/go.mod b/sdk/resourcemanager/support/armsupport/go.mod index 2783361ca2e5..359425dc07e3 100644 --- a/sdk/resourcemanager/support/armsupport/go.mod +++ b/sdk/resourcemanager/support/armsupport/go.mod @@ -1,21 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.22.0 // indirect golang.org/x/net v0.24.0 // indirect - golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect ) diff --git a/sdk/resourcemanager/support/armsupport/go.sum b/sdk/resourcemanager/support/armsupport/go.sum index 453385ef9f88..ffdff03203f8 100644 --- a/sdk/resourcemanager/support/armsupport/go.sum +++ b/sdk/resourcemanager/support/armsupport/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 h1:FDif4R1+UUR+00q6wquyX90K7A8dN+R5E8GEadoP7sU= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2/go.mod h1:aiYBYui4BJ/BJCAIKs92XiPyQfTaBWqvHujDwKb6CBU= github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 h1:rTfKOCZGy5ViVrlA74ZPE99a+SgoEE2K/yg3RyW9dFA= github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0/go.mod h1:4OG6tQ9EOP/MT0NMjDlRzWoVFxfu9rN9B2X+tlSVktg= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/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/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/support/armsupport/lookupresourceid_client.go b/sdk/resourcemanager/support/armsupport/lookupresourceid_client.go new file mode 100644 index 000000000000..621e405b93a2 --- /dev/null +++ b/sdk/resourcemanager/support/armsupport/lookupresourceid_client.go @@ -0,0 +1,92 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsupport + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" +) + +// LookUpResourceIDClient contains the methods for the LookUpResourceID group. +// Don't use this type directly, use NewLookUpResourceIDClient() instead. +type LookUpResourceIDClient struct { + internal *arm.Client +} + +// NewLookUpResourceIDClient creates a new instance of LookUpResourceIDClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewLookUpResourceIDClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*LookUpResourceIDClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &LookUpResourceIDClient{ + internal: cl, + } + return client, nil +} + +// Post - This operation fetches ARM resource id of support resource type. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - lookUpResourceIDRequest - Look up resource id request body +// - options - LookUpResourceIDClientPostOptions contains the optional parameters for the LookUpResourceIDClient.Post method. +func (client *LookUpResourceIDClient) Post(ctx context.Context, lookUpResourceIDRequest LookUpResourceIDRequest, options *LookUpResourceIDClientPostOptions) (LookUpResourceIDClientPostResponse, error) { + var err error + const operationName = "LookUpResourceIDClient.Post" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.postCreateRequest(ctx, lookUpResourceIDRequest, options) + if err != nil { + return LookUpResourceIDClientPostResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return LookUpResourceIDClientPostResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LookUpResourceIDClientPostResponse{}, err + } + resp, err := client.postHandleResponse(httpResp) + return resp, err +} + +// postCreateRequest creates the Post request. +func (client *LookUpResourceIDClient) postCreateRequest(ctx context.Context, lookUpResourceIDRequest LookUpResourceIDRequest, options *LookUpResourceIDClientPostOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Support/lookUpResourceId" + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, lookUpResourceIDRequest); err != nil { + return nil, err + } + return req, nil +} + +// postHandleResponse handles the Post response. +func (client *LookUpResourceIDClient) postHandleResponse(resp *http.Response) (LookUpResourceIDClientPostResponse, error) { + result := LookUpResourceIDClientPostResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LookUpResourceIDResponse); err != nil { + return LookUpResourceIDClientPostResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/support/armsupport/models.go b/sdk/resourcemanager/support/armsupport/models.go index e5a299d2706e..68659dddb41a 100644 --- a/sdk/resourcemanager/support/armsupport/models.go +++ b/sdk/resourcemanager/support/armsupport/models.go @@ -67,9 +67,21 @@ type CheckNameAvailabilityOutput struct { Reason *string } +// ClassificationService - Service Classification result object. +type ClassificationService struct { + // List of applicable ARM resource types for this service. + ResourceTypes []*string + + // READ-ONLY; Localized name of the azure service. + DisplayName *string + + // READ-ONLY; Azure resource Id of the service. + ServiceID *string +} + // CommunicationDetails - Object that represents a Communication resource. type CommunicationDetails struct { - // REQUIRED; Properties of the resource. + // Properties of the resource. Properties *CommunicationDetailsProperties // READ-ONLY; Id of the resource. @@ -173,13 +185,13 @@ type FileDetails struct { // FileDetailsProperties - Describes the properties of a file. type FileDetailsProperties struct { - // Size of each chunk. The size of each chunk should be provided in bytes and must not exceed 2.5 megabytes (MB). + // Size of each chunk ChunkSize *int32 - // Size of the file to be uploaded. The file size must not exceed 5 MB and should be provided in bytes. + // Size of the file to be uploaded FileSize *int32 - // Number of chunks to be uploaded. The maximum number of allowed chunks is 2. + // Number of chunks to be uploaded NumberOfChunks *int32 // READ-ONLY; Time in UTC (ISO 8601 format) when file workspace was created. @@ -222,9 +234,24 @@ type FilesListResult struct { Value []*FileDetails } +// LookUpResourceIDRequest - The look up resource Id request body +type LookUpResourceIDRequest struct { + // The System generated Id that is unique. Use supportTicketId property for Microsoft.Support/supportTickets resource type. + Identifier *string + + // The type of resource. + Type *string +} + +// LookUpResourceIDResponse - The look up resource id response +type LookUpResourceIDResponse struct { + // The resource Id of support resource type. + ResourceID *string +} + // MessageProperties - Describes the properties of a Message Details resource. type MessageProperties struct { - // Body of the communication. + // REQUIRED; Body of the communication. Body *string // Name of the sender. @@ -290,8 +317,50 @@ type ProblemClassificationProperties struct { // Localized name of problem classification. DisplayName *string + // Reference to the parent problem classification which has same structure as problem classification + ParentProblemClassification *ProblemClassification + // This property indicates whether secondary consent is present for problem classification SecondaryConsentEnabled []*SecondaryConsentEnabled + + // READ-ONLY; String-to-string dictionary for additional metadata. + Metadata map[string]*string +} + +// ProblemClassificationsClassificationInput - Input to problem classification Classification API. +type ProblemClassificationsClassificationInput struct { + // REQUIRED; Natural language description of the customer’s issue. + IssueSummary *string + + // ARM resource Id of the resource that is having the issue. + ResourceID *string +} + +// ProblemClassificationsClassificationOutput - Output of the problem classification Classification API. +type ProblemClassificationsClassificationOutput struct { + // Set of problem classification objects classified. + ProblemClassificationResults []*ProblemClassificationsClassificationResult +} + +// ProblemClassificationsClassificationResult - ProblemClassification Classification result object. +type ProblemClassificationsClassificationResult struct { + // Related service. + RelatedService *ClassificationService + + // READ-ONLY; Description of the problem classification result. + Description *string + + // READ-ONLY; Identifier that may be used for support ticket creation. + ProblemClassificationID *string + + // READ-ONLY; Identifier that may be used for solution discovery or some other purposes. + ProblemID *string + + // READ-ONLY; Identifier of the service associated with this problem classification result. + ServiceID *string + + // READ-ONLY; Title of the problem classification result. + Title *string } // ProblemClassificationsListResult - Collection of ProblemClassification resources. @@ -357,6 +426,39 @@ type Service struct { Type *string } +// ServiceClassificationAnswer - Service Classification result object. +type ServiceClassificationAnswer struct { + // Child service. + ChildService *ClassificationService + + // List of applicable ARM resource types for this service. + ResourceTypes []*string + + // READ-ONLY; Localized name of the azure service. + DisplayName *string + + // READ-ONLY; Azure resource Id of the service. + ServiceID *string +} + +// ServiceClassificationOutput - Output of the service classification API. +type ServiceClassificationOutput struct { + // Set of problem classification objects classified. + ServiceClassificationResults []*ServiceClassificationAnswer +} + +// ServiceClassificationRequest - Input to problem classification Classification API. +type ServiceClassificationRequest struct { + // Additional information in the form of a string. + AdditionalContext *string + + // Natural language description of the customer’s issue. + IssueSummary *string + + // ARM resource Id of the resource that is having the issue. + ResourceID *string +} + // ServiceLevelAgreement - Service Level Agreement details for a support ticket. type ServiceLevelAgreement struct { // READ-ONLY; Time in UTC (ISO 8601 format) when the service level agreement expires. @@ -376,6 +478,9 @@ type ServiceProperties struct { // ARM Resource types. ResourceTypes []*string + + // READ-ONLY; Metadata about the service, only visible for 1P clients + Metadata map[string]*string } // ServicesListResult - Collection of Service resources. @@ -414,7 +519,7 @@ type TechnicalTicketDetails struct { // TicketDetails - Object that represents SupportTicketDetails resource. type TicketDetails struct { - // REQUIRED; Properties of the resource. + // Properties of the resource. Properties *TicketDetailsProperties // READ-ONLY; Id of the resource. @@ -429,9 +534,6 @@ type TicketDetails struct { // TicketDetailsProperties - Describes the properties of a support ticket. type TicketDetailsProperties struct { - // REQUIRED; Advanced diagnostic consent to be updated on the support ticket. - AdvancedDiagnosticConsent *Consent - // REQUIRED; Contact information of the user requesting to create a support ticket. ContactDetails *ContactProfile @@ -454,6 +556,9 @@ type TicketDetailsProperties struct { // REQUIRED; Title of the support ticket. Title *string + // Advanced diagnostic consent to be updated on the support ticket. + AdvancedDiagnosticConsent *Consent + // Enrollment Id associated with the support ticket. EnrollmentID *string @@ -559,8 +664,7 @@ type UpdateContactProfile struct { PrimaryEmailAddress *string } -// UpdateSupportTicket - Updates severity, ticket status, contact details, advanced diagnostic consent and secondary consent -// in the support ticket. +// UpdateSupportTicket - Updates severity, ticket status, and contact details in the support ticket. type UpdateSupportTicket struct { // Advanced diagnostic consent to be updated on the support ticket. AdvancedDiagnosticConsent *Consent diff --git a/sdk/resourcemanager/support/armsupport/models_serde.go b/sdk/resourcemanager/support/armsupport/models_serde.go index 3944309edbb1..a75764de3306 100644 --- a/sdk/resourcemanager/support/armsupport/models_serde.go +++ b/sdk/resourcemanager/support/armsupport/models_serde.go @@ -186,6 +186,41 @@ func (c *CheckNameAvailabilityOutput) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ClassificationService. +func (c ClassificationService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "resourceTypes", c.ResourceTypes) + populate(objectMap, "serviceId", c.ServiceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClassificationService. +func (c *ClassificationService) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "resourceTypes": + err = unpopulate(val, "ResourceTypes", &c.ResourceTypes) + delete(rawMsg, key) + case "serviceId": + err = unpopulate(val, "ServiceID", &c.ServiceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CommunicationDetails. func (c CommunicationDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -576,6 +611,64 @@ func (f *FilesListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LookUpResourceIDRequest. +func (l LookUpResourceIDRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identifier", l.Identifier) + objectMap["type"] = "Microsoft.Support/supportTickets" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LookUpResourceIDRequest. +func (l *LookUpResourceIDRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identifier": + err = unpopulate(val, "Identifier", &l.Identifier) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LookUpResourceIDResponse. +func (l LookUpResourceIDResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceId", l.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LookUpResourceIDResponse. +func (l *LookUpResourceIDResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceId": + err = unpopulate(val, "ResourceID", &l.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MessageProperties. func (m MessageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -759,6 +852,8 @@ func (p *ProblemClassification) UnmarshalJSON(data []byte) error { func (p ProblemClassificationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "displayName", p.DisplayName) + populate(objectMap, "metadata", p.Metadata) + populate(objectMap, "parentProblemClassification", p.ParentProblemClassification) populate(objectMap, "secondaryConsentEnabled", p.SecondaryConsentEnabled) return json.Marshal(objectMap) } @@ -775,6 +870,12 @@ func (p *ProblemClassificationProperties) UnmarshalJSON(data []byte) error { case "displayName": err = unpopulate(val, "DisplayName", &p.DisplayName) delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &p.Metadata) + delete(rawMsg, key) + case "parentProblemClassification": + err = unpopulate(val, "ParentProblemClassification", &p.ParentProblemClassification) + delete(rawMsg, key) case "secondaryConsentEnabled": err = unpopulate(val, "SecondaryConsentEnabled", &p.SecondaryConsentEnabled) delete(rawMsg, key) @@ -786,6 +887,111 @@ func (p *ProblemClassificationProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ProblemClassificationsClassificationInput. +func (p ProblemClassificationsClassificationInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "issueSummary", p.IssueSummary) + populate(objectMap, "resourceId", p.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProblemClassificationsClassificationInput. +func (p *ProblemClassificationsClassificationInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "issueSummary": + err = unpopulate(val, "IssueSummary", &p.IssueSummary) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &p.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProblemClassificationsClassificationOutput. +func (p ProblemClassificationsClassificationOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "problemClassificationResults", p.ProblemClassificationResults) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProblemClassificationsClassificationOutput. +func (p *ProblemClassificationsClassificationOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "problemClassificationResults": + err = unpopulate(val, "ProblemClassificationResults", &p.ProblemClassificationResults) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProblemClassificationsClassificationResult. +func (p ProblemClassificationsClassificationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", p.Description) + populate(objectMap, "problemClassificationId", p.ProblemClassificationID) + populate(objectMap, "problemId", p.ProblemID) + populate(objectMap, "relatedService", p.RelatedService) + populate(objectMap, "serviceId", p.ServiceID) + populate(objectMap, "title", p.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProblemClassificationsClassificationResult. +func (p *ProblemClassificationsClassificationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "problemClassificationId": + err = unpopulate(val, "ProblemClassificationID", &p.ProblemClassificationID) + delete(rawMsg, key) + case "problemId": + err = unpopulate(val, "ProblemID", &p.ProblemID) + delete(rawMsg, key) + case "relatedService": + err = unpopulate(val, "RelatedService", &p.RelatedService) + delete(rawMsg, key) + case "serviceId": + err = unpopulate(val, "ServiceID", &p.ServiceID) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &p.Title) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ProblemClassificationsListResult. func (p ProblemClassificationsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -980,6 +1186,107 @@ func (s *Service) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ServiceClassificationAnswer. +func (s ServiceClassificationAnswer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "childService", s.ChildService) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "resourceTypes", s.ResourceTypes) + populate(objectMap, "serviceId", s.ServiceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceClassificationAnswer. +func (s *ServiceClassificationAnswer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "childService": + err = unpopulate(val, "ChildService", &s.ChildService) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "resourceTypes": + err = unpopulate(val, "ResourceTypes", &s.ResourceTypes) + delete(rawMsg, key) + case "serviceId": + err = unpopulate(val, "ServiceID", &s.ServiceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceClassificationOutput. +func (s ServiceClassificationOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceClassificationResults", s.ServiceClassificationResults) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceClassificationOutput. +func (s *ServiceClassificationOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceClassificationResults": + err = unpopulate(val, "ServiceClassificationResults", &s.ServiceClassificationResults) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceClassificationRequest. +func (s ServiceClassificationRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalContext", s.AdditionalContext) + populate(objectMap, "issueSummary", s.IssueSummary) + populate(objectMap, "resourceId", s.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceClassificationRequest. +func (s *ServiceClassificationRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalContext": + err = unpopulate(val, "AdditionalContext", &s.AdditionalContext) + delete(rawMsg, key) + case "issueSummary": + err = unpopulate(val, "IssueSummary", &s.IssueSummary) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &s.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ServiceLevelAgreement. func (s ServiceLevelAgreement) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1019,6 +1326,7 @@ func (s *ServiceLevelAgreement) UnmarshalJSON(data []byte) error { func (s ServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "metadata", s.Metadata) populate(objectMap, "resourceTypes", s.ResourceTypes) return json.Marshal(objectMap) } @@ -1035,6 +1343,9 @@ func (s *ServiceProperties) UnmarshalJSON(data []byte) error { case "displayName": err = unpopulate(val, "DisplayName", &s.DisplayName) delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &s.Metadata) + delete(rawMsg, key) case "resourceTypes": err = unpopulate(val, "ResourceTypes", &s.ResourceTypes) delete(rawMsg, key) diff --git a/sdk/resourcemanager/support/armsupport/operations_client.go b/sdk/resourcemanager/support/armsupport/operations_client.go index 2f55e3215d51..6395fe48c70f 100644 --- a/sdk/resourcemanager/support/armsupport/operations_client.go +++ b/sdk/resourcemanager/support/armsupport/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - This lists all the available Microsoft Support REST API operations. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -73,7 +73,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/support/armsupport/operations_client_example_test.go b/sdk/resourcemanager/support/armsupport/operations_client_example_test.go deleted file mode 100644 index 2cc509126098..000000000000 --- a/sdk/resourcemanager/support/armsupport/operations_client_example_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationsListResult = armsupport.OperationsListResult{ - // Value: []*armsupport.Operation{ - // { - // Name: to.Ptr("Microsoft.Support/services/read"), - // Display: &armsupport.OperationDisplay{ - // Description: to.Ptr("Gets all the Azure services available for support"), - // Operation: to.Ptr("Reads Services"), - // Provider: to.Ptr("Microsoft Support"), - // Resource: to.Ptr("Service"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Support/problemClassifications/read"), - // Display: &armsupport.OperationDisplay{ - // Description: to.Ptr("Gets all the problem classifications available for a specific Azure service"), - // Operation: to.Ptr("Reads Problem Classifications"), - // Provider: to.Ptr("Microsoft Support"), - // Resource: to.Ptr("Problem Classification"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Support/supportTickets/read"), - // Display: &armsupport.OperationDisplay{ - // Description: to.Ptr("Gets all the support tickets"), - // Operation: to.Ptr("Reads Support Tickets"), - // Provider: to.Ptr("Microsoft Support"), - // Resource: to.Ptr("Support Ticket"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Support/supportTickets/write"), - // Display: &armsupport.OperationDisplay{ - // Description: to.Ptr("Updates support ticket"), - // Operation: to.Ptr("Updates support ticket"), - // Provider: to.Ptr("Microsoft Support"), - // Resource: to.Ptr("Support Ticket"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Support/communications/read"), - // Display: &armsupport.OperationDisplay{ - // Description: to.Ptr("Gets all the communications"), - // Operation: to.Ptr("Reads Communications"), - // Provider: to.Ptr("Microsoft Support"), - // Resource: to.Ptr("Communication"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Support/communications/write"), - // Display: &armsupport.OperationDisplay{ - // Description: to.Ptr("Creates a communication"), - // Operation: to.Ptr("Creates a communication"), - // Provider: to.Ptr("Microsoft Support"), - // Resource: to.Ptr("Communication"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Support/register/action"), - // Display: &armsupport.OperationDisplay{ - // Description: to.Ptr("Registers Support Resource Provider"), - // Operation: to.Ptr("Registers Support Resource Provider"), - // Provider: to.Ptr("Registers Support Resource Provider"), - // Resource: to.Ptr("Support Registration"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Support/createSupportTicket/action"), - // Display: &armsupport.OperationDisplay{ - // Description: to.Ptr("Creates support ticket"), - // Operation: to.Ptr("Registers Support Resource Provider"), - // Provider: to.Ptr("Microsoft Support"), - // Resource: to.Ptr("SupportTicket"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Support/addCommunication/action"), - // Display: &armsupport.OperationDisplay{ - // Description: to.Ptr("Add communication to support ticket"), - // Operation: to.Ptr("Registers Support Resource Provider"), - // Provider: to.Ptr("Microsoft Support"), - // Resource: to.Ptr("Communication"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/support/armsupport/options.go b/sdk/resourcemanager/support/armsupport/options.go index 582578466113..c31ff7367a60 100644 --- a/sdk/resourcemanager/support/armsupport/options.go +++ b/sdk/resourcemanager/support/armsupport/options.go @@ -153,11 +153,22 @@ type FilesNoSubscriptionClientUploadOptions struct { // placeholder for future optional parameters } +// LookUpResourceIDClientPostOptions contains the optional parameters for the LookUpResourceIDClient.Post method. +type LookUpResourceIDClientPostOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } +// ProblemClassificationsClientClassifyProblemsOptions contains the optional parameters for the ProblemClassificationsClient.ClassifyProblems +// method. +type ProblemClassificationsClientClassifyProblemsOptions struct { + // placeholder for future optional parameters +} + // ProblemClassificationsClientGetOptions contains the optional parameters for the ProblemClassificationsClient.Get method. type ProblemClassificationsClientGetOptions struct { // placeholder for future optional parameters @@ -169,6 +180,24 @@ type ProblemClassificationsClientListOptions struct { // placeholder for future optional parameters } +// ProblemClassificationsNoSubscriptionClientClassifyProblemsOptions contains the optional parameters for the ProblemClassificationsNoSubscriptionClient.ClassifyProblems +// method. +type ProblemClassificationsNoSubscriptionClientClassifyProblemsOptions struct { + // placeholder for future optional parameters +} + +// ServiceClassificationsClientClassifyServicesOptions contains the optional parameters for the ServiceClassificationsClient.ClassifyServices +// method. +type ServiceClassificationsClientClassifyServicesOptions struct { + // placeholder for future optional parameters +} + +// ServiceClassificationsNoSubscriptionClientClassifyServicesOptions contains the optional parameters for the ServiceClassificationsNoSubscriptionClient.ClassifyServices +// method. +type ServiceClassificationsNoSubscriptionClientClassifyServicesOptions struct { + // placeholder for future optional parameters +} + // ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. type ServicesClientGetOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/support/armsupport/problemclassifications_client.go b/sdk/resourcemanager/support/armsupport/problemclassifications_client.go index 8aee62cf59ba..e60faf2c5fd8 100644 --- a/sdk/resourcemanager/support/armsupport/problemclassifications_client.go +++ b/sdk/resourcemanager/support/armsupport/problemclassifications_client.go @@ -23,28 +23,95 @@ import ( // ProblemClassificationsClient contains the methods for the ProblemClassifications group. // Don't use this type directly, use NewProblemClassificationsClient() instead. type ProblemClassificationsClient struct { - internal *arm.Client + internal *arm.Client + subscriptionID string } // NewProblemClassificationsClient creates a new instance of ProblemClassificationsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. -func NewProblemClassificationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ProblemClassificationsClient, error) { +func NewProblemClassificationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProblemClassificationsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } client := &ProblemClassificationsClient{ - internal: cl, + subscriptionID: subscriptionID, + internal: cl, } return client, nil } +// ClassifyProblems - Classify the right problem classifications (categories) available for a specific Azure service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - problemServiceName - Name of the Azure service for which the problem classifications need to be retrieved. +// - problemClassificationsClassificationInput - Input to check. +// - options - ProblemClassificationsClientClassifyProblemsOptions contains the optional parameters for the ProblemClassificationsClient.ClassifyProblems +// method. +func (client *ProblemClassificationsClient) ClassifyProblems(ctx context.Context, problemServiceName string, problemClassificationsClassificationInput ProblemClassificationsClassificationInput, options *ProblemClassificationsClientClassifyProblemsOptions) (ProblemClassificationsClientClassifyProblemsResponse, error) { + var err error + const operationName = "ProblemClassificationsClient.ClassifyProblems" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.classifyProblemsCreateRequest(ctx, problemServiceName, problemClassificationsClassificationInput, options) + if err != nil { + return ProblemClassificationsClientClassifyProblemsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProblemClassificationsClientClassifyProblemsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProblemClassificationsClientClassifyProblemsResponse{}, err + } + resp, err := client.classifyProblemsHandleResponse(httpResp) + return resp, err +} + +// classifyProblemsCreateRequest creates the ClassifyProblems request. +func (client *ProblemClassificationsClient) classifyProblemsCreateRequest(ctx context.Context, problemServiceName string, problemClassificationsClassificationInput ProblemClassificationsClassificationInput, options *ProblemClassificationsClientClassifyProblemsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Support/services/{problemServiceName}/classifyProblems" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if problemServiceName == "" { + return nil, errors.New("parameter problemServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{problemServiceName}", url.PathEscape(problemServiceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, problemClassificationsClassificationInput); err != nil { + return nil, err + } + return req, nil +} + +// classifyProblemsHandleResponse handles the ClassifyProblems response. +func (client *ProblemClassificationsClient) classifyProblemsHandleResponse(resp *http.Response) (ProblemClassificationsClientClassifyProblemsResponse, error) { + result := ProblemClassificationsClientClassifyProblemsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProblemClassificationsClassificationOutput); err != nil { + return ProblemClassificationsClientClassifyProblemsResponse{}, err + } + return result, nil +} + // Get - Get problem classification details for a specific Azure service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 -// - serviceName - Name of the Azure service available for support. +// Generated from API version 2023-06-01-preview +// - serviceName - Name of the Azure service for which the problem classifications need to be retrieved. // - problemClassificationName - Name of problem classification. // - options - ProblemClassificationsClientGetOptions contains the optional parameters for the ProblemClassificationsClient.Get // method. @@ -86,7 +153,7 @@ func (client *ProblemClassificationsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,7 +172,7 @@ func (client *ProblemClassificationsClient) getHandleResponse(resp *http.Respons // service and problem classifications obtained programmatically. This practice ensures that you // always have the most recent set of service and problem classification Ids. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - serviceName - Name of the Azure service for which the problem classifications need to be retrieved. // - options - ProblemClassificationsClientListOptions contains the optional parameters for the ProblemClassificationsClient.NewListPager // method. @@ -145,7 +212,7 @@ func (client *ProblemClassificationsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/support/armsupport/problemclassifications_client_example_test.go b/sdk/resourcemanager/support/armsupport/problemclassifications_client_example_test.go deleted file mode 100644 index 07f48c8fd416..000000000000 --- a/sdk/resourcemanager/support/armsupport/problemclassifications_client_example_test.go +++ /dev/null @@ -1,126 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListProblemClassifications.json -func ExampleProblemClassificationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProblemClassificationsClient().NewListPager("service_guid", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProblemClassificationsListResult = armsupport.ProblemClassificationsListResult{ - // Value: []*armsupport.ProblemClassification{ - // { - // Name: to.Ptr("problemClassification_guid_1"), - // Type: to.Ptr("Microsoft.Support/problemClassifications"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid/problemClassifications/problemClassification_guid_1"), - // Properties: &armsupport.ProblemClassificationProperties{ - // DisplayName: to.Ptr("Reservation Management / Exchanges and Refunds"), - // SecondaryConsentEnabled: []*armsupport.SecondaryConsentEnabled{ - // { - // Type: to.Ptr("DatabricksConsent"), - // Description: to.Ptr("For faster resolution, allow Microsoft and Databricks to temporarily have read and write access to your Databricks workspace. We will only access to read and write to your cluster for the purpose of resolving your support issue and in conformance with Microsoft's Privacy Policy."), - // }}, - // }, - // }, - // { - // Name: to.Ptr("problemClassification_guid_2"), - // Type: to.Ptr("Microsoft.Support/problemClassifications"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid/problemClassifications/problemClassification_guid_2"), - // Properties: &armsupport.ProblemClassificationProperties{ - // DisplayName: to.Ptr("Reservation Management / Request Invoices"), - // SecondaryConsentEnabled: []*armsupport.SecondaryConsentEnabled{ - // { - // Type: to.Ptr("DatabricksConsent"), - // Description: to.Ptr("For faster resolution, allow Microsoft and Databricks to temporarily have read and write access to your Databricks workspace. We will only access to read and write to your cluster for the purpose of resolving your support issue and in conformance with Microsoft's Privacy Policy."), - // }}, - // }, - // }, - // { - // Name: to.Ptr("problemClassification_guid_3"), - // Type: to.Ptr("Microsoft.Support/problemClassifications"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid/problemClassifications/problemClassification_guid_3"), - // Properties: &armsupport.ProblemClassificationProperties{ - // DisplayName: to.Ptr("Reservation Management / Other Iissues or Requests"), - // SecondaryConsentEnabled: []*armsupport.SecondaryConsentEnabled{ - // { - // Type: to.Ptr("DatabricksConsent"), - // Description: to.Ptr("For faster resolution, allow Microsoft and Databricks to temporarily have read and write access to your Databricks workspace. We will only access to read and write to your cluster for the purpose of resolving your support issue and in conformance with Microsoft's Privacy Policy."), - // }}, - // }, - // }, - // { - // Name: to.Ptr("problemClassification_guid_4"), - // Type: to.Ptr("Microsoft.Support/problemClassifications"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid/problemClassifications/problemClassification_guid_4"), - // Properties: &armsupport.ProblemClassificationProperties{ - // DisplayName: to.Ptr("Other General Billing Questions"), - // SecondaryConsentEnabled: []*armsupport.SecondaryConsentEnabled{ - // { - // Type: to.Ptr("DatabricksConsent"), - // Description: to.Ptr("For faster resolution, allow Microsoft and Databricks to temporarily have read and write access to your Databricks workspace. We will only access to read and write to your cluster for the purpose of resolving your support issue and in conformance with Microsoft's Privacy Policy."), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetProblemClassification.json -func ExampleProblemClassificationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProblemClassificationsClient().Get(ctx, "service_guid", "problemClassification_guid", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProblemClassification = armsupport.ProblemClassification{ - // Name: to.Ptr("problemClassification_guid"), - // Type: to.Ptr("Microsoft.Support/problemClassifications"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid/problemClassifications/problemClassification_guid"), - // Properties: &armsupport.ProblemClassificationProperties{ - // DisplayName: to.Ptr("Reservation Management / Exchanges and Refunds"), - // }, - // } -} diff --git a/sdk/resourcemanager/support/armsupport/problemclassificationsnosubscription_client.go b/sdk/resourcemanager/support/armsupport/problemclassificationsnosubscription_client.go new file mode 100644 index 000000000000..6926573ba913 --- /dev/null +++ b/sdk/resourcemanager/support/armsupport/problemclassificationsnosubscription_client.go @@ -0,0 +1,101 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsupport + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ProblemClassificationsNoSubscriptionClient contains the methods for the ProblemClassificationsNoSubscription group. +// Don't use this type directly, use NewProblemClassificationsNoSubscriptionClient() instead. +type ProblemClassificationsNoSubscriptionClient struct { + internal *arm.Client +} + +// NewProblemClassificationsNoSubscriptionClient creates a new instance of ProblemClassificationsNoSubscriptionClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewProblemClassificationsNoSubscriptionClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ProblemClassificationsNoSubscriptionClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ProblemClassificationsNoSubscriptionClient{ + internal: cl, + } + return client, nil +} + +// ClassifyProblems - Classify the right problem classifications (categories) available for a specific Azure service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - problemServiceName - Name of the Azure service for which the problem classifications need to be retrieved. +// - problemClassificationsClassificationInput - Input to check. +// - options - ProblemClassificationsNoSubscriptionClientClassifyProblemsOptions contains the optional parameters for the ProblemClassificationsNoSubscriptionClient.ClassifyProblems +// method. +func (client *ProblemClassificationsNoSubscriptionClient) ClassifyProblems(ctx context.Context, problemServiceName string, problemClassificationsClassificationInput ProblemClassificationsClassificationInput, options *ProblemClassificationsNoSubscriptionClientClassifyProblemsOptions) (ProblemClassificationsNoSubscriptionClientClassifyProblemsResponse, error) { + var err error + const operationName = "ProblemClassificationsNoSubscriptionClient.ClassifyProblems" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.classifyProblemsCreateRequest(ctx, problemServiceName, problemClassificationsClassificationInput, options) + if err != nil { + return ProblemClassificationsNoSubscriptionClientClassifyProblemsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ProblemClassificationsNoSubscriptionClientClassifyProblemsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProblemClassificationsNoSubscriptionClientClassifyProblemsResponse{}, err + } + resp, err := client.classifyProblemsHandleResponse(httpResp) + return resp, err +} + +// classifyProblemsCreateRequest creates the ClassifyProblems request. +func (client *ProblemClassificationsNoSubscriptionClient) classifyProblemsCreateRequest(ctx context.Context, problemServiceName string, problemClassificationsClassificationInput ProblemClassificationsClassificationInput, options *ProblemClassificationsNoSubscriptionClientClassifyProblemsOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Support/services/{problemServiceName}/classifyProblems" + if problemServiceName == "" { + return nil, errors.New("parameter problemServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{problemServiceName}", url.PathEscape(problemServiceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, problemClassificationsClassificationInput); err != nil { + return nil, err + } + return req, nil +} + +// classifyProblemsHandleResponse handles the ClassifyProblems response. +func (client *ProblemClassificationsNoSubscriptionClient) classifyProblemsHandleResponse(resp *http.Response) (ProblemClassificationsNoSubscriptionClientClassifyProblemsResponse, error) { + result := ProblemClassificationsNoSubscriptionClientClassifyProblemsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProblemClassificationsClassificationOutput); err != nil { + return ProblemClassificationsNoSubscriptionClientClassifyProblemsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/support/armsupport/responses.go b/sdk/resourcemanager/support/armsupport/responses.go index 02a80c53eac8..154efb0d8227 100644 --- a/sdk/resourcemanager/support/armsupport/responses.go +++ b/sdk/resourcemanager/support/armsupport/responses.go @@ -150,12 +150,24 @@ type FilesNoSubscriptionClientUploadResponse struct { // placeholder for future response values } +// LookUpResourceIDClientPostResponse contains the response from method LookUpResourceIDClient.Post. +type LookUpResourceIDClientPostResponse struct { + // The look up resource id response + LookUpResourceIDResponse +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { // The list of operations supported by Microsoft Support resource provider. OperationsListResult } +// ProblemClassificationsClientClassifyProblemsResponse contains the response from method ProblemClassificationsClient.ClassifyProblems. +type ProblemClassificationsClientClassifyProblemsResponse struct { + // Output of the problem classification Classification API. + ProblemClassificationsClassificationOutput +} + // ProblemClassificationsClientGetResponse contains the response from method ProblemClassificationsClient.Get. type ProblemClassificationsClientGetResponse struct { // ProblemClassification resource object. @@ -168,6 +180,24 @@ type ProblemClassificationsClientListResponse struct { ProblemClassificationsListResult } +// ProblemClassificationsNoSubscriptionClientClassifyProblemsResponse contains the response from method ProblemClassificationsNoSubscriptionClient.ClassifyProblems. +type ProblemClassificationsNoSubscriptionClientClassifyProblemsResponse struct { + // Output of the problem classification Classification API. + ProblemClassificationsClassificationOutput +} + +// ServiceClassificationsClientClassifyServicesResponse contains the response from method ServiceClassificationsClient.ClassifyServices. +type ServiceClassificationsClientClassifyServicesResponse struct { + // Output of the service classification API. + ServiceClassificationOutput +} + +// ServiceClassificationsNoSubscriptionClientClassifyServicesResponse contains the response from method ServiceClassificationsNoSubscriptionClient.ClassifyServices. +type ServiceClassificationsNoSubscriptionClientClassifyServicesResponse struct { + // Output of the service classification API. + ServiceClassificationOutput +} + // ServicesClientGetResponse contains the response from method ServicesClient.Get. type ServicesClientGetResponse struct { // Object that represents a Service resource. diff --git a/sdk/resourcemanager/support/armsupport/serviceclassifications_client.go b/sdk/resourcemanager/support/armsupport/serviceclassifications_client.go new file mode 100644 index 000000000000..692ab866547d --- /dev/null +++ b/sdk/resourcemanager/support/armsupport/serviceclassifications_client.go @@ -0,0 +1,103 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsupport + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ServiceClassificationsClient contains the methods for the ServiceClassifications group. +// Don't use this type directly, use NewServiceClassificationsClient() instead. +type ServiceClassificationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewServiceClassificationsClient creates a new instance of ServiceClassificationsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewServiceClassificationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceClassificationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServiceClassificationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// ClassifyServices - Classify the list of right Azure services. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - serviceClassificationRequest - Input to check. +// - options - ServiceClassificationsClientClassifyServicesOptions contains the optional parameters for the ServiceClassificationsClient.ClassifyServices +// method. +func (client *ServiceClassificationsClient) ClassifyServices(ctx context.Context, serviceClassificationRequest ServiceClassificationRequest, options *ServiceClassificationsClientClassifyServicesOptions) (ServiceClassificationsClientClassifyServicesResponse, error) { + var err error + const operationName = "ServiceClassificationsClient.ClassifyServices" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.classifyServicesCreateRequest(ctx, serviceClassificationRequest, options) + if err != nil { + return ServiceClassificationsClientClassifyServicesResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceClassificationsClientClassifyServicesResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceClassificationsClientClassifyServicesResponse{}, err + } + resp, err := client.classifyServicesHandleResponse(httpResp) + return resp, err +} + +// classifyServicesCreateRequest creates the ClassifyServices request. +func (client *ServiceClassificationsClient) classifyServicesCreateRequest(ctx context.Context, serviceClassificationRequest ServiceClassificationRequest, options *ServiceClassificationsClientClassifyServicesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Support/classifyServices" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, serviceClassificationRequest); err != nil { + return nil, err + } + return req, nil +} + +// classifyServicesHandleResponse handles the ClassifyServices response. +func (client *ServiceClassificationsClient) classifyServicesHandleResponse(resp *http.Response) (ServiceClassificationsClientClassifyServicesResponse, error) { + result := ServiceClassificationsClientClassifyServicesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceClassificationOutput); err != nil { + return ServiceClassificationsClientClassifyServicesResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/support/armsupport/serviceclassificationsnosubscription_client.go b/sdk/resourcemanager/support/armsupport/serviceclassificationsnosubscription_client.go new file mode 100644 index 000000000000..a0f5ea008b2f --- /dev/null +++ b/sdk/resourcemanager/support/armsupport/serviceclassificationsnosubscription_client.go @@ -0,0 +1,93 @@ +//go:build go1.18 +// +build go1.18 + +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsupport + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" +) + +// ServiceClassificationsNoSubscriptionClient contains the methods for the ServiceClassificationsNoSubscription group. +// Don't use this type directly, use NewServiceClassificationsNoSubscriptionClient() instead. +type ServiceClassificationsNoSubscriptionClient struct { + internal *arm.Client +} + +// NewServiceClassificationsNoSubscriptionClient creates a new instance of ServiceClassificationsNoSubscriptionClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewServiceClassificationsNoSubscriptionClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceClassificationsNoSubscriptionClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServiceClassificationsNoSubscriptionClient{ + internal: cl, + } + return client, nil +} + +// ClassifyServices - Classify the list of right Azure services. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-06-01-preview +// - serviceClassificationRequest - Input to check. +// - options - ServiceClassificationsNoSubscriptionClientClassifyServicesOptions contains the optional parameters for the ServiceClassificationsNoSubscriptionClient.ClassifyServices +// method. +func (client *ServiceClassificationsNoSubscriptionClient) ClassifyServices(ctx context.Context, serviceClassificationRequest ServiceClassificationRequest, options *ServiceClassificationsNoSubscriptionClientClassifyServicesOptions) (ServiceClassificationsNoSubscriptionClientClassifyServicesResponse, error) { + var err error + const operationName = "ServiceClassificationsNoSubscriptionClient.ClassifyServices" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.classifyServicesCreateRequest(ctx, serviceClassificationRequest, options) + if err != nil { + return ServiceClassificationsNoSubscriptionClientClassifyServicesResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServiceClassificationsNoSubscriptionClientClassifyServicesResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceClassificationsNoSubscriptionClientClassifyServicesResponse{}, err + } + resp, err := client.classifyServicesHandleResponse(httpResp) + return resp, err +} + +// classifyServicesCreateRequest creates the ClassifyServices request. +func (client *ServiceClassificationsNoSubscriptionClient) classifyServicesCreateRequest(ctx context.Context, serviceClassificationRequest ServiceClassificationRequest, options *ServiceClassificationsNoSubscriptionClientClassifyServicesOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Support/classifyServices" + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-06-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, serviceClassificationRequest); err != nil { + return nil, err + } + return req, nil +} + +// classifyServicesHandleResponse handles the ClassifyServices response. +func (client *ServiceClassificationsNoSubscriptionClient) classifyServicesHandleResponse(resp *http.Response) (ServiceClassificationsNoSubscriptionClientClassifyServicesResponse, error) { + result := ServiceClassificationsNoSubscriptionClientClassifyServicesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceClassificationOutput); err != nil { + return ServiceClassificationsNoSubscriptionClientClassifyServicesResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/support/armsupport/services_client.go b/sdk/resourcemanager/support/armsupport/services_client.go index a56ddea26e7e..0c5175b548cc 100644 --- a/sdk/resourcemanager/support/armsupport/services_client.go +++ b/sdk/resourcemanager/support/armsupport/services_client.go @@ -43,8 +43,8 @@ func NewServicesClient(credential azcore.TokenCredential, options *arm.ClientOpt // Get - Gets a specific Azure service for support ticket creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 -// - serviceName - Name of the Azure service. +// Generated from API version 2023-06-01-preview +// - serviceName - Name of the Azure service for which the problem classifications need to be retrieved. // - options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. func (client *ServicesClient) Get(ctx context.Context, serviceName string, options *ServicesClientGetOptions) (ServicesClientGetResponse, error) { var err error @@ -80,7 +80,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, serviceName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -102,7 +102,7 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of // service and problem classification Ids. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - options - ServicesClientListOptions contains the optional parameters for the ServicesClient.NewListPager method. func (client *ServicesClient) NewListPager(options *ServicesClientListOptions) *runtime.Pager[ServicesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServicesClientListResponse]{ @@ -136,7 +136,7 @@ func (client *ServicesClient) listCreateRequest(ctx context.Context, options *Se return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/support/armsupport/services_client_example_test.go b/sdk/resourcemanager/support/armsupport/services_client_example_test.go deleted file mode 100644 index 95a79a2d1374..000000000000 --- a/sdk/resourcemanager/support/armsupport/services_client_example_test.go +++ /dev/null @@ -1,151 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListServices.json -func ExampleServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServicesListResult = armsupport.ServicesListResult{ - // Value: []*armsupport.Service{ - // { - // Name: to.Ptr("service_guid_1"), - // Type: to.Ptr("Microsoft.Support/services"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid_1"), - // Properties: &armsupport.ServiceProperties{ - // DisplayName: to.Ptr("Billing"), - // ResourceTypes: []*string{ - // }, - // }, - // }, - // { - // Name: to.Ptr("service_guid_2"), - // Type: to.Ptr("Microsoft.Support/services"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid_2"), - // Properties: &armsupport.ServiceProperties{ - // DisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ResourceTypes: []*string{ - // }, - // }, - // }, - // { - // Name: to.Ptr("service_guid_3"), - // Type: to.Ptr("Microsoft.Support/services"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid_3"), - // Properties: &armsupport.ServiceProperties{ - // DisplayName: to.Ptr("Subscription management"), - // ResourceTypes: []*string{ - // }, - // }, - // }, - // { - // Name: to.Ptr("service_guid_4"), - // Type: to.Ptr("Microsoft.Support/services"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid_4"), - // Properties: &armsupport.ServiceProperties{ - // DisplayName: to.Ptr("Data Explorer"), - // ResourceTypes: []*string{ - // to.Ptr("MICROSOFT.KUSTO/CLUSTERS"), - // to.Ptr("MICROSOFT.KUSTO/DATABASES")}, - // }, - // }, - // { - // Name: to.Ptr("service_guid_5"), - // Type: to.Ptr("Microsoft.Support/services"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid_5"), - // Properties: &armsupport.ServiceProperties{ - // DisplayName: to.Ptr("Virtual Machine running Windows"), - // ResourceTypes: []*string{ - // to.Ptr("MICROSOFT.CLASSICCOMPUTE/VIRTUALMACHINES"), - // to.Ptr("MICROSOFT.COMPUTE/VIRTUALMACHINES")}, - // }, - // }, - // { - // Name: to.Ptr("service_guid_6"), - // Type: to.Ptr("Microsoft.Support/services"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid_6"), - // Properties: &armsupport.ServiceProperties{ - // DisplayName: to.Ptr("Virtual Machine running Linux"), - // ResourceTypes: []*string{ - // to.Ptr("MICROSOFT.CLASSICCOMPUTE/VIRTUALMACHINES"), - // to.Ptr("MICROSOFT.COMPUTE/VIRTUALMACHINES")}, - // }, - // }, - // { - // Name: to.Ptr("service_guid_7"), - // Type: to.Ptr("Microsoft.Support/services"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid_7"), - // Properties: &armsupport.ServiceProperties{ - // DisplayName: to.Ptr("Virtual Network"), - // ResourceTypes: []*string{ - // to.Ptr("MICROSOFT.NETWORK/VIRTUALNETWORKS"), - // to.Ptr("MICROSOFT.CLASSICNETWORK/VIRTUALNETWORKS")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetService.json -func ExampleServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Get(ctx, "service_guid", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsupport.Service{ - // Name: to.Ptr("service_guid"), - // Type: to.Ptr("Microsoft.Support/services"), - // ID: to.Ptr("/providers/Microsoft.Support/services/service_guid"), - // Properties: &armsupport.ServiceProperties{ - // DisplayName: to.Ptr("Virtual Machine running Windows"), - // ResourceTypes: []*string{ - // to.Ptr("MICROSOFT.CLASSICCOMPUTE/VIRTUALMACHINES"), - // to.Ptr("MICROSOFT.COMPUTE/VIRTUALMACHINES")}, - // }, - // } -} diff --git a/sdk/resourcemanager/support/armsupport/tickets_client.go b/sdk/resourcemanager/support/armsupport/tickets_client.go index 99ac19f70cbf..30aae2909ac3 100644 --- a/sdk/resourcemanager/support/armsupport/tickets_client.go +++ b/sdk/resourcemanager/support/armsupport/tickets_client.go @@ -48,7 +48,7 @@ func NewTicketsClient(subscriptionID string, credential azcore.TokenCredential, // name for support ticket creation for the selected subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - checkNameAvailabilityInput - Input to check. // - options - TicketsClientCheckNameAvailabilityOptions contains the optional parameters for the TicketsClient.CheckNameAvailability // method. @@ -86,7 +86,7 @@ func (client *TicketsClient) checkNameAvailabilityCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkNameAvailabilityInput); err != nil { @@ -124,7 +124,7 @@ func (client *TicketsClient) checkNameAvailabilityHandleResponse(resp *http.Resp // (CSP) partner tenant. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - createSupportTicketParameters - Support ticket request payload. // - options - TicketsClientBeginCreateOptions contains the optional parameters for the TicketsClient.BeginCreate method. @@ -166,7 +166,7 @@ func (client *TicketsClient) BeginCreate(ctx context.Context, supportTicketName // (CSP) partner tenant. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview func (client *TicketsClient) create(ctx context.Context, supportTicketName string, createSupportTicketParameters TicketDetails, options *TicketsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "TicketsClient.BeginCreate" @@ -204,7 +204,7 @@ func (client *TicketsClient) createCreateRequest(ctx context.Context, supportTic return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createSupportTicketParameters); err != nil { @@ -218,7 +218,7 @@ func (client *TicketsClient) createCreateRequest(ctx context.Context, supportTic // error. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - options - TicketsClientGetOptions contains the optional parameters for the TicketsClient.Get method. func (client *TicketsClient) Get(ctx context.Context, supportTicketName string, options *TicketsClientGetOptions) (TicketsClientGetResponse, error) { @@ -259,7 +259,7 @@ func (client *TicketsClient) getCreateRequest(ctx context.Context, supportTicket return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *TicketsClient) getHandleResponse(resp *http.Response) (TicketsClie // Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, // a request for data might cause an error. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - options - TicketsClientListOptions contains the optional parameters for the TicketsClient.NewListPager method. func (client *TicketsClient) NewListPager(options *TicketsClientListOptions) *runtime.Pager[TicketsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[TicketsClientListResponse]{ @@ -323,7 +323,7 @@ func (client *TicketsClient) listCreateRequest(ctx context.Context, options *Tic if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +345,7 @@ func (client *TicketsClient) listHandleResponse(resp *http.Response) (TicketsCli // adding a new communication using the Communications API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - updateSupportTicket - UpdateSupportTicket object. // - options - TicketsClientUpdateOptions contains the optional parameters for the TicketsClient.Update method. @@ -387,7 +387,7 @@ func (client *TicketsClient) updateCreateRequest(ctx context.Context, supportTic return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateSupportTicket); err != nil { diff --git a/sdk/resourcemanager/support/armsupport/tickets_client_example_test.go b/sdk/resourcemanager/support/armsupport/tickets_client_example_test.go deleted file mode 100644 index be2fbc90167b..000000000000 --- a/sdk/resourcemanager/support/armsupport/tickets_client_example_test.go +++ /dev/null @@ -1,2876 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "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/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailabilityWithSubscription.json -func ExampleTicketsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTicketsClient().CheckNameAvailability(ctx, armsupport.CheckNameAvailabilityInput{ - Name: to.Ptr("sampleName"), - Type: to.Ptr(armsupport.TypeMicrosoftSupportSupportTickets), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityOutput = armsupport.CheckNameAvailabilityOutput{ - // Message: to.Ptr("Name not available"), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("Name is already in use"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json -func ExampleTicketsClient_NewListPager_listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsClient().NewListPager(&armsupport.TicketsClientListOptions{Top: nil, - Filter: to.Ptr("createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Linux"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // TechnicalTicketDetails: &armsupport.TechnicalTicketDetails{ - // ResourceID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"), - // }, - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testticket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket2"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T21:36:18.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183771"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInUpdatingStateBySubscription.json -func ExampleTicketsClient_NewListPager_listSupportTicketsCreatedOnOrAfterACertainDateAndInUpdatingStateForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsClient().NewListPager(&armsupport.TicketsClientListOptions{Top: nil, - Filter: to.Ptr("createdDate ge 2020-03-10T22:08:51Z and status eq 'Updating'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Linux"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Updating"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // TechnicalTicketDetails: &armsupport.TechnicalTicketDetails{ - // ResourceID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"), - // }, - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testticket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket2"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T21:36:18.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Updating"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183771"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsBySubscription.json -func ExampleTicketsClient_NewListPager_listSupportTicketsForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsClient().NewListPager(&armsupport.TicketsClientListOptions{Top: nil, - Filter: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Linux"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // TechnicalTicketDetails: &armsupport.TechnicalTicketDetails{ - // ResourceID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"), - // }, - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testticket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket2"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183771"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json -func ExampleTicketsClient_NewListPager_listSupportTicketsInOpenStateForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsClient().NewListPager(&armsupport.TicketsClientListOptions{Top: nil, - Filter: to.Ptr("status eq 'Open'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Linux"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // TechnicalTicketDetails: &armsupport.TechnicalTicketDetails{ - // ResourceID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"), - // }, - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testticket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket2"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183771"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInUpdatingStateBySubscription.json -func ExampleTicketsClient_NewListPager_listSupportTicketsInUpdatingStateForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsClient().NewListPager(&armsupport.TicketsClientListOptions{Top: nil, - Filter: to.Ptr("status eq 'Updating'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Linux"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Updating"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // TechnicalTicketDetails: &armsupport.TechnicalTicketDetails{ - // ResourceID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"), - // }, - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testticket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket2"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Updating"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183771"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsProblemClassificationIdEqualsForSubscription.json -func ExampleTicketsClient_NewListPager_listSupportTicketsWithACertainProblemClassificationIdForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsClient().NewListPager(&armsupport.TicketsClientListOptions{Top: nil, - Filter: to.Ptr("ProblemClassificationId eq 'compute_vm_problemClassification_guid'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testTicket1"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testTicket1"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T21:52:10.000Z"); return t}()), - // EnrollmentID: to.Ptr(""), - // FileWorkspaceName: to.Ptr("testTicket1"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-12T23:05:19.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Compute-VM (cores-vCPUs) subscription limit increases"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/service_guid/problemClassifications/compute_vm_problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("service_displayName"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/service_guid"), - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("2205060010000072"), - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testTicket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testTicket2"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T21:38:42.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testTicket2"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T21:39:14.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Compute-VM (cores-vCPUs) subscription limit increases"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/service_guid/problemClassifications/compute_vm_problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("service_displayName"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/service_guid"), - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("2205040010000077"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsServiceIdEqualsForSubscription.json -func ExampleTicketsClient_NewListPager_listSupportTicketsWithACertainServiceIdForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsClient().NewListPager(&armsupport.TicketsClientListOptions{Top: nil, - Filter: to.Ptr("ServiceId eq 'vm_windows_service_guid'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testticket1"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T21:52:10.000Z"); return t}()), - // EnrollmentID: to.Ptr(""), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-12T23:05:19.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("problemClassification_displayName"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/vm_windows_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Windows"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/vm_windows_service_guid"), - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("2205040010000082"), - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testticket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T21:38:42.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T21:39:14.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("problemClassification_displayName"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/vm_windows_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Windows"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/vm_windows_service_guid"), - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("2205040010000080"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetSubscriptionSupportTicketDetails.json -func ExampleTicketsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTicketsClient().Get(ctx, "testticket", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183770"), - // Title: to.Ptr("Test - please ignore"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateAdvancedDiagnosticConsentOfSupportTicketForSubscription.json -func ExampleTicketsClient_Update_updateAdvancedDiagnosticConsentOfASubscriptionSupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTicketsClient().Update(ctx, "testticket", armsupport.UpdateSupportTicket{ - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // AdditionalEmailAddresses: []*string{ - // to.Ptr("tname@contoso.com"), - // to.Ptr("teamtest@contoso.com")}, - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("test.name@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelCritical), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183770"), - // Title: to.Ptr("Test - please ignore"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateContactDetailsOfSupportTicketForSubscription.json -func ExampleTicketsClient_Update_updateContactDetailsOfASubscriptionSupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTicketsClient().Update(ctx, "testticket", armsupport.UpdateSupportTicket{ - ContactDetails: &armsupport.UpdateContactProfile{ - AdditionalEmailAddresses: []*string{ - to.Ptr("tname@contoso.com"), - to.Ptr("teamtest@contoso.com")}, - Country: to.Ptr("USA"), - FirstName: to.Ptr("first name"), - LastName: to.Ptr("last name"), - PhoneNumber: to.Ptr("123-456-7890"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("test.name@contoso.com"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // AdditionalEmailAddresses: []*string{ - // to.Ptr("tname@contoso.com"), - // to.Ptr("teamtest@contoso.com")}, - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("first name"), - // LastName: to.Ptr("last name"), - // PhoneNumber: to.Ptr("123-456-7890"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("test.name@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelCritical), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183770"), - // Title: to.Ptr("Test - please ignore"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateSeverityOfSupportTicketForSubscription.json -func ExampleTicketsClient_Update_updateSeverityOfASubscriptionSupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTicketsClient().Update(ctx, "testticket", armsupport.UpdateSupportTicket{ - Severity: to.Ptr(armsupport.SeverityLevelCritical), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // AdditionalEmailAddresses: []*string{ - // to.Ptr("tname@contoso.com"), - // to.Ptr("teamtest@contoso.com")}, - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("test.name@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelCritical), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183770"), - // Title: to.Ptr("Test - please ignore"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateStatusOfSupportTicketForSubscription.json -func ExampleTicketsClient_Update_updateStatusOfASubscriptionSupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTicketsClient().Update(ctx, "testticket", armsupport.UpdateSupportTicket{ - Status: to.Ptr(armsupport.StatusClosed), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // AdditionalEmailAddresses: []*string{ - // to.Ptr("tname@contoso.com"), - // to.Ptr("teamtest@contoso.com")}, - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("test.name@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelCritical), - // Status: to.Ptr("Closed"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183770"), - // Title: to.Ptr("Test - please ignore"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicketForSubscription.json -func ExampleTicketsClient_BeginCreate_createATicketForBillingRelatedIssues() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid"), - ServiceID: to.Ptr("/providers/Microsoft.Support/services/billing_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Refund request"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Billing"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/billing_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json -func ExampleTicketsClient_BeginCreate_createATicketForSubscriptionManagementRelatedIssuesForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid"), - ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Transfer ownership of my subscription"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicketForSubscription.json -func ExampleTicketsClient_BeginCreate_createATicketForTechnicalIssueRelatedToASpecificResourceForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid"), - ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - SecondaryConsent: []*armsupport.SecondaryConsent{ - { - Type: to.Ptr("virtualmachinerunninglinuxservice"), - UserConsent: to.Ptr(armsupport.UserConsentYes), - }}, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - TechnicalTicketDetails: &armsupport.TechnicalTicketDetails{ - ResourceID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"), - }, - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("virtualmachinerunninglinuxservice"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Linux"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // TechnicalTicketDetails: &armsupport.TechnicalTicketDetails{ - // ResourceID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver"), - // }, - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestSubType: to.Ptr("Account"), - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Batch"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestSubType: to.Ptr("Account"), - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForAzureSqlManagedInstance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestSubType: to.Ptr("SQLMI"), - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"), - Region: to.Ptr("EastUS"), - }, - { - Payload: to.Ptr("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("SQL Database Managed Instance"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestSubType: to.Ptr("SQLMI"), - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"), - // Region: to.Ptr("EastUS"), - // }, - // { - // Payload: to.Ptr("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSubscription.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestSubType: to.Ptr("Subscription"), - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"NewLimit\":200,\"Type\":\"Account\"}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Batch"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestSubType: to.Ptr("Subscription"), - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"NewLimit\":200,\"Type\":\"Account\"}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateCoresQuotaTicketForSubscription.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForComputeVmCores() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"SKU\":\"DSv3 Series\",\"NewLimit\":104}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Compute-VM (cores-vCPUs) subscription limit increases"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"VmFamily\":\"DSv3 Series\",\"NewLimit\":104}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForDtUsForAzureSynapseAnalytics() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestSubType: to.Ptr("DTUs"), - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"ServerName\":\"testserver\",\"NewLimit\":54000}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("SQL Data Warehouse"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestSubType: to.Ptr("DTUs"), - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"ServerName\":\"testserver\",\"NewLimit\":54000}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForDtUsForSqlDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestSubType: to.Ptr("DTUs"), - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"ServerName\":\"testserver\",\"NewLimit\":54000}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("SQL database"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestSubType: to.Ptr("DTUs"), - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"ServerName\":\"testserver\",\"NewLimit\":54000}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestSubType: to.Ptr("BatchAml"), - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"NewLimit\":200,\"Type\":\"LowPriority\"}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Machine Learning service"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestSubType: to.Ptr("Account"), - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"NewLimit\":200,\"Type\":\"LowPriority\"}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestSubType: to.Ptr("Account"), - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Batch"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestSubType: to.Ptr("Account"), - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForPoolsForABatchAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestSubType: to.Ptr("Account"), - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Batch"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestSubType: to.Ptr("Account"), - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestSubType: to.Ptr("Servers"), - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"NewLimit\":200}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("SQL Data Warehouse"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestSubType: to.Ptr("Servers"), - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"NewLimit\":200}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForServersForSqlDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestSubType: to.Ptr("Servers"), - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"NewLimit\":200}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("SQL database"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestSubType: to.Ptr("Servers"), - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"NewLimit\":200}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateGenericQuotaTicket.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("Increase the maximum throughput per container limit to 10000 for account foo bar"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid"), - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("Increase the maximum throughput per container limit to 10000 for account foo bar"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Cosmos DB"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForSpecificVmFamilyCoresForMachineLearningService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestSubType: to.Ptr("BatchAml"), - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Machine Learning service"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestSubType: to.Ptr("Account"), - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json -func ExampleTicketsClient_BeginCreate_createATicketToRequestQuotaIncreaseForSpecificVmFamilyCoresForABatchAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"), - QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - QuotaChangeRequestSubType: to.Ptr("Account"), - QuotaChangeRequestVersion: to.Ptr("1.0"), - QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - { - Payload: to.Ptr("{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"), - Region: to.Ptr("EastUS"), - }}, - }, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testticket"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Batch"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid"), - // QuotaTicketDetails: &armsupport.QuotaTicketDetails{ - // QuotaChangeRequestSubType: to.Ptr("Account"), - // QuotaChangeRequestVersion: to.Ptr("1.0"), - // QuotaChangeRequests: []*armsupport.QuotaChangeRequest{ - // { - // Payload: to.Ptr("{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}"), - // Region: to.Ptr("EastUS"), - // }}, - // }, - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Service and subscription limits (quotas)"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/quota_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} diff --git a/sdk/resourcemanager/support/armsupport/ticketsnosubscription_client.go b/sdk/resourcemanager/support/armsupport/ticketsnosubscription_client.go index 154ed8d87dab..edff99e6b188 100644 --- a/sdk/resourcemanager/support/armsupport/ticketsnosubscription_client.go +++ b/sdk/resourcemanager/support/armsupport/ticketsnosubscription_client.go @@ -45,7 +45,7 @@ func NewTicketsNoSubscriptionClient(credential azcore.TokenCredential, options * // name for support ticket creation for the selected subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - checkNameAvailabilityInput - Input to check. // - options - TicketsNoSubscriptionClientCheckNameAvailabilityOptions contains the optional parameters for the TicketsNoSubscriptionClient.CheckNameAvailability // method. @@ -79,7 +79,7 @@ func (client *TicketsNoSubscriptionClient) checkNameAvailabilityCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkNameAvailabilityInput); err != nil { @@ -110,7 +110,7 @@ func (client *TicketsNoSubscriptionClient) checkNameAvailabilityHandleResponse(r // issue requires gathering diagnostic information from your Azure resources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - createSupportTicketParameters - Support ticket request payload. // - options - TicketsNoSubscriptionClientBeginCreateOptions contains the optional parameters for the TicketsNoSubscriptionClient.BeginCreate @@ -146,7 +146,7 @@ func (client *TicketsNoSubscriptionClient) BeginCreate(ctx context.Context, supp // issue requires gathering diagnostic information from your Azure resources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview func (client *TicketsNoSubscriptionClient) create(ctx context.Context, supportTicketName string, createSupportTicketParameters TicketDetails, options *TicketsNoSubscriptionClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "TicketsNoSubscriptionClient.BeginCreate" @@ -180,7 +180,7 @@ func (client *TicketsNoSubscriptionClient) createCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, createSupportTicketParameters); err != nil { @@ -194,7 +194,7 @@ func (client *TicketsNoSubscriptionClient) createCreateRequest(ctx context.Conte // error. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - options - TicketsNoSubscriptionClientGetOptions contains the optional parameters for the TicketsNoSubscriptionClient.Get // method. @@ -232,7 +232,7 @@ func (client *TicketsNoSubscriptionClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *TicketsNoSubscriptionClient) getHandleResponse(resp *http.Response // Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, // a request for data might cause an error. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - options - TicketsNoSubscriptionClientListOptions contains the optional parameters for the TicketsNoSubscriptionClient.NewListPager // method. func (client *TicketsNoSubscriptionClient) NewListPager(options *TicketsNoSubscriptionClientListOptions) *runtime.Pager[TicketsNoSubscriptionClientListResponse] { @@ -294,7 +294,7 @@ func (client *TicketsNoSubscriptionClient) listCreateRequest(ctx context.Context if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -315,7 +315,7 @@ func (client *TicketsNoSubscriptionClient) listHandleResponse(resp *http.Respons // adding a new communication using the Communications API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2023-06-01-preview // - supportTicketName - Support ticket name. // - updateSupportTicket - UpdateSupportTicket object. // - options - TicketsNoSubscriptionClientUpdateOptions contains the optional parameters for the TicketsNoSubscriptionClient.Update @@ -354,7 +354,7 @@ func (client *TicketsNoSubscriptionClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2023-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, updateSupportTicket); err != nil { diff --git a/sdk/resourcemanager/support/armsupport/ticketsnosubscription_client_example_test.go b/sdk/resourcemanager/support/armsupport/ticketsnosubscription_client_example_test.go deleted file mode 100644 index 00b4f8c3f13d..000000000000 --- a/sdk/resourcemanager/support/armsupport/ticketsnosubscription_client_example_test.go +++ /dev/null @@ -1,1461 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// 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. -// DO NOT EDIT. - -package armsupport_test - -import ( - "context" - "log" - - "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/resourcemanager/support/armsupport" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailability.json -func ExampleTicketsNoSubscriptionClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTicketsNoSubscriptionClient().CheckNameAvailability(ctx, armsupport.CheckNameAvailabilityInput{ - Name: to.Ptr("sampleName"), - Type: to.Ptr(armsupport.TypeMicrosoftSupportSupportTickets), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityOutput = armsupport.CheckNameAvailabilityOutput{ - // Message: to.Ptr("Name not available"), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("Name is already in use"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTickets.json -func ExampleTicketsNoSubscriptionClient_NewListPager_listSupportTickets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsNoSubscriptionClient().NewListPager(&armsupport.TicketsNoSubscriptionClientListOptions{Top: nil, - Filter: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Linux"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testticket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket2"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183771"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenState.json -func ExampleTicketsNoSubscriptionClient_NewListPager_listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsNoSubscriptionClient().NewListPager(&armsupport.TicketsNoSubscriptionClientListOptions{Top: nil, - Filter: to.Ptr("createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Linux"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testticket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket2"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T21:36:18.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183771"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInUpdatingState.json -func ExampleTicketsNoSubscriptionClient_NewListPager_listSupportTicketsCreatedOnOrAfterACertainDateAndInUpdatingState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsNoSubscriptionClient().NewListPager(&armsupport.TicketsNoSubscriptionClientListOptions{Top: nil, - Filter: to.Ptr("createdDate ge 2020-03-10T22:08:51Z and status eq 'Updating'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Linux"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Updating"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testticket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket2"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T21:36:18.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-12T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-11T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Updating"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183771"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInOpenState.json -func ExampleTicketsNoSubscriptionClient_NewListPager_listSupportTicketsInOpenState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsNoSubscriptionClient().NewListPager(&armsupport.TicketsNoSubscriptionClientListOptions{Top: nil, - Filter: to.Ptr("status eq 'Open'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Linux"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testticket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket2"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183771"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInUpdatingState.json -func ExampleTicketsNoSubscriptionClient_NewListPager_listSupportTicketsInUpdatingState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsNoSubscriptionClient().NewListPager(&armsupport.TicketsNoSubscriptionClientListOptions{Top: nil, - Filter: to.Ptr("status eq 'Updating'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Linux"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Updating"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testticket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket2"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Updating"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183771"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsProblemClassificationIdEquals.json -func ExampleTicketsNoSubscriptionClient_NewListPager_listSupportTicketsWithACertainProblemClassificationId() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsNoSubscriptionClient().NewListPager(&armsupport.TicketsNoSubscriptionClientListOptions{Top: nil, - Filter: to.Ptr("ProblemClassificationId eq 'compute_vm_problemClassification_guid'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testTicket1"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testTicket1"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T21:52:10.000Z"); return t}()), - // EnrollmentID: to.Ptr(""), - // FileWorkspaceName: to.Ptr("testTicket1"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-12T23:05:19.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Compute-VM (cores-vCPUs) subscription limit increases"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/service_guid/problemClassifications/compute_vm_problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("service_displayName"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/service_guid"), - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("2205060010000072"), - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testTicket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testTicket2"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T21:38:42.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("testTicket2"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T21:39:14.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Compute-VM (cores-vCPUs) subscription limit increases"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/service_guid/problemClassifications/compute_vm_problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("service_displayName"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/service_guid"), - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("2205040010000077"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsServiceIdEquals.json -func ExampleTicketsNoSubscriptionClient_NewListPager_listSupportTicketsWithACertainServiceId() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTicketsNoSubscriptionClient().NewListPager(&armsupport.TicketsNoSubscriptionClientListOptions{Top: nil, - Filter: to.Ptr("ServiceId eq 'vm_windows_service_guid'"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TicketsListResult = armsupport.TicketsListResult{ - // Value: []*armsupport.TicketDetails{ - // { - // Name: to.Ptr("testticket1"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T21:52:10.000Z"); return t}()), - // EnrollmentID: to.Ptr(""), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-12T23:05:19.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("problemClassification_displayName"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/vm_windows_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Windows"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/vm_windows_service_guid"), - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("2205040010000082"), - // Title: to.Ptr("my title"), - // }, - // }, - // { - // Name: to.Ptr("testticket2"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T21:38:42.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-05-04T21:39:14.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("problemClassification_displayName"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/vm_windows_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("VirtualMachine"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Windows"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/vm_windows_service_guid"), - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("2205040010000080"), - // Title: to.Ptr("Test - please ignore"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetSupportTicketDetails.json -func ExampleTicketsNoSubscriptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTicketsNoSubscriptionClient().Get(ctx, "testticket", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelMinimal), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183770"), - // Title: to.Ptr("Test - please ignore"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateAdvancedDiagnosticConsentOfSupportTicket.json -func ExampleTicketsNoSubscriptionClient_Update_updateAdvancedDiagnosticConsentOfASupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTicketsNoSubscriptionClient().Update(ctx, "testticket", armsupport.UpdateSupportTicket{ - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // AdditionalEmailAddresses: []*string{ - // to.Ptr("tname@contoso.com"), - // to.Ptr("teamtest@contoso.com")}, - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("test.name@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelCritical), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183770"), - // Title: to.Ptr("Test - please ignore"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateContactDetailsOfSupportTicket.json -func ExampleTicketsNoSubscriptionClient_Update_updateContactDetailsOfASupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTicketsNoSubscriptionClient().Update(ctx, "testticket", armsupport.UpdateSupportTicket{ - ContactDetails: &armsupport.UpdateContactProfile{ - AdditionalEmailAddresses: []*string{ - to.Ptr("tname@contoso.com"), - to.Ptr("teamtest@contoso.com")}, - Country: to.Ptr("USA"), - FirstName: to.Ptr("first name"), - LastName: to.Ptr("last name"), - PhoneNumber: to.Ptr("123-456-7890"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("test.name@contoso.com"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // AdditionalEmailAddresses: []*string{ - // to.Ptr("tname@contoso.com"), - // to.Ptr("teamtest@contoso.com")}, - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("first name"), - // LastName: to.Ptr("last name"), - // PhoneNumber: to.Ptr("123-456-7890"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("test.name@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelCritical), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183770"), - // Title: to.Ptr("Test - please ignore"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateSeverityOfSupportTicket.json -func ExampleTicketsNoSubscriptionClient_Update_updateSeverityOfASupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTicketsNoSubscriptionClient().Update(ctx, "testticket", armsupport.UpdateSupportTicket{ - Severity: to.Ptr(armsupport.SeverityLevelCritical), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // AdditionalEmailAddresses: []*string{ - // to.Ptr("tname@contoso.com"), - // to.Ptr("teamtest@contoso.com")}, - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("test.name@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelCritical), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // EmailAddress: to.Ptr("xyz@contoso.com"), - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183770"), - // Title: to.Ptr("Test - please ignore"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateStatusOfSupportTicket.json -func ExampleTicketsNoSubscriptionClient_Update_updateStatusOfASupportTicket() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTicketsNoSubscriptionClient().Update(ctx, "testticket", armsupport.UpdateSupportTicket{ - Status: to.Ptr(armsupport.StatusClosed), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("This is a test - please ignore"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // AdditionalEmailAddresses: []*string{ - // to.Ptr("tname@contoso.com"), - // to.Ptr("teamtest@contoso.com")}, - // Country: to.Ptr("USA"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("test.name@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Add or Edit VAT, TAX ID, or PO Number"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelCritical), - // Status: to.Ptr("Closed"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("118032014183770"), - // Title: to.Ptr("Test - please ignore"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicket.json -func ExampleTicketsNoSubscriptionClient_BeginCreate_createATicketForBillingRelatedIssues() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsNoSubscriptionClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid"), - ServiceID: to.Ptr("/providers/Microsoft.Support/services/billing_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentNo), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Refund request"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Billing"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/billing_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicket.json -func ExampleTicketsNoSubscriptionClient_BeginCreate_createATicketForSubscriptionManagementRelatedIssues() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsNoSubscriptionClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid"), - ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Transfer ownership of my subscription"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid"), - // Require24X7Response: to.Ptr(false), - // ServiceDisplayName: to.Ptr("Subscription management"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/subscription_management_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/106483d9f698ac3b6c0d481ab0c5fab14152e21f/specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicket.json -func ExampleTicketsNoSubscriptionClient_BeginCreate_createATicketForTechnicalIssueRelatedToASpecificResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsupport.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewTicketsNoSubscriptionClient().BeginCreate(ctx, "testticket", armsupport.TicketDetails{ - Properties: &armsupport.TicketDetailsProperties{ - Description: to.Ptr("my description"), - AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - ContactDetails: &armsupport.ContactProfile{ - Country: to.Ptr("usa"), - FirstName: to.Ptr("abc"), - LastName: to.Ptr("xyz"), - PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - PreferredSupportLanguage: to.Ptr("en-US"), - PreferredTimeZone: to.Ptr("Pacific Standard Time"), - PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - }, - FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid"), - ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - SecondaryConsent: []*armsupport.SecondaryConsent{ - { - Type: to.Ptr("virtualmachinerunninglinuxservice"), - UserConsent: to.Ptr(armsupport.UserConsentYes), - }}, - ServiceID: to.Ptr("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc"), - Severity: to.Ptr(armsupport.SeverityLevelModerate), - SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - Title: to.Ptr("my title"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TicketDetails = armsupport.TicketDetails{ - // Name: to.Ptr("testticket"), - // Type: to.Ptr("Microsoft.Support/supportTickets"), - // ID: to.Ptr("/providers/Microsoft.Support/supportTickets/testticket"), - // Properties: &armsupport.TicketDetailsProperties{ - // Description: to.Ptr("my description"), - // AdvancedDiagnosticConsent: to.Ptr(armsupport.ConsentYes), - // ContactDetails: &armsupport.ContactProfile{ - // Country: to.Ptr("usa"), - // FirstName: to.Ptr("abc"), - // LastName: to.Ptr("xyz"), - // PreferredContactMethod: to.Ptr(armsupport.PreferredContactMethodEmail), - // PreferredSupportLanguage: to.Ptr("en-US"), - // PreferredTimeZone: to.Ptr("Pacific Standard Time"), - // PrimaryEmailAddress: to.Ptr("abc@contoso.com"), - // }, - // CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // FileWorkspaceName: to.Ptr("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - // ModifiedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:23.000Z"); return t}()), - // ProblemClassificationDisplayName: to.Ptr("Connectivity / Cannot connect to virtual machine by using RDP or SSH"), - // ProblemClassificationID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid"), - // ProblemScopingQuestions: to.Ptr("{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}"), - // Require24X7Response: to.Ptr(false), - // SecondaryConsent: []*armsupport.SecondaryConsent{ - // { - // Type: to.Ptr("virtualmachinerunninglinuxservice"), - // UserConsent: to.Ptr(armsupport.UserConsentYes), - // }}, - // ServiceDisplayName: to.Ptr("Virtual Machine running Linux"), - // ServiceID: to.Ptr("/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid"), - // ServiceLevelAgreement: &armsupport.ServiceLevelAgreement{ - // ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-21T17:36:18.000Z"); return t}()), - // SLAMinutes: to.Ptr[int32](240), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-03-20T21:36:18.000Z"); return t}()), - // }, - // Severity: to.Ptr(armsupport.SeverityLevelModerate), - // Status: to.Ptr("Open"), - // SupportEngineer: &armsupport.Engineer{ - // }, - // SupportPlanDisplayName: to.Ptr("Premier"), - // SupportPlanID: to.Ptr("U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw="), - // SupportPlanType: to.Ptr("Premier"), - // SupportTicketID: to.Ptr("119120321001170"), - // Title: to.Ptr("my title"), - // }, - // } -}