From d8d0f90bd61502b96d1452064ff15e5df509ba48 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 19 Sep 2022 05:36:50 +0000 Subject: [PATCH] CodeGen from PR 20588 in Azure/azure-rest-api-specs make compilationJobs name segment consistent and ARM spec conformant (#20588) * make compilationJobs name segment consistent and ARM spec conformant * update segment descriptions * update examples for property rename --- .../automation/armautomation/CHANGELOG.md | 12 + .../armautomation/account_client.go | 2 - .../armautomation/activity_client.go | 1 - .../activity_client_example_test.go | 68 ------ ...strationinformation_client_example_test.go | 65 ------ .../automationaccount_client_example_test.go | 171 -------------- .../automationclient_client_example_test.go | 43 ---- .../automation/armautomation/autorest.md | 6 +- .../armautomation/certificate_client.go | 1 - .../certificate_client_example_test.go | 149 ------------- .../armautomation/connection_client.go | 1 - .../connection_client_example_test.go | 157 ------------- .../armautomation/connectiontype_client.go | 1 - .../connectiontype_client_example_test.go | 132 ----------- .../automation/armautomation/constants.go | 2 +- .../armautomation/credential_client.go | 1 - .../credential_client_example_test.go | 150 ------------- ...dautomationaccounts_client_example_test.go | 37 --- .../armautomation/dsccompilationjob_client.go | 1 - .../dsccompilationjob_client_example_test.go | 123 ---------- ...ompilationjobstream_client_example_test.go | 40 ---- .../armautomation/dscconfiguration_client.go | 27 ++- .../dscconfiguration_client_example_test.go | 114 ---------- .../armautomation/dscnode_client.go | 1 - .../dscnode_client_example_test.go | 123 ---------- .../dscnodeconfiguration_client.go | 1 - ...scnodeconfiguration_client_example_test.go | 135 ----------- .../automation/armautomation/fields_client.go | 1 - .../fields_client_example_test.go | 45 ---- .../automation/armautomation/go.mod | 14 +- .../automation/armautomation/go.sum | 24 +- .../hybridrunbookworkergroup_client.go | 1 - ...drunbookworkergroup_client_example_test.go | 148 ------------ .../hybridrunbookworkers_client.go | 1 - ...ybridrunbookworkers_client_example_test.go | 145 ------------ .../automation/armautomation/job_client.go | 1 - .../armautomation/job_client_example_test.go | 211 ------------------ .../armautomation/jobschedule_client.go | 1 - .../jobschedule_client_example_test.go | 123 ---------- .../armautomation/jobstream_client.go | 1 - .../jobstream_client_example_test.go | 70 ------ .../armautomation/keys_client_example_test.go | 39 ---- .../linkedworkspace_client_example_test.go | 39 ---- .../automation/armautomation/models.go | 6 +- .../automation/armautomation/module_client.go | 1 - .../module_client_example_test.go | 158 ------------- ...odecountinformation_client_example_test.go | 40 ---- .../armautomation/nodereports_client.go | 1 - .../nodereports_client_example_test.go | 92 -------- .../armautomation/objectdatatypes_client.go | 2 - .../objectdatatypes_client_example_test.go | 72 ------ .../armautomation/operations_client.go | 1 - .../privateendpointconnections_client.go | 1 - ...endpointconnections_client_example_test.go | 127 ----------- .../privatelinkresources_client.go | 1 - ...rivatelinkresources_client_example_test.go | 43 ---- .../armautomation/python2package_client.go | 1 - .../python2package_client_example_test.go | 150 ------------- .../armautomation/runbook_client.go | 1 - .../runbook_client_example_test.go | 208 ----------------- .../runbookdraft_client_example_test.go | 82 ------- .../armautomation/schedule_client.go | 1 - .../schedule_client_example_test.go | 154 ------------- ...gurationmachineruns_client_example_test.go | 43 ---- ...teconfigurationruns_client_example_test.go | 44 ---- ...pdateconfigurations_client_example_test.go | 189 ---------------- .../armautomation/sourcecontrol_client.go | 1 - .../sourcecontrol_client_example_test.go | 162 -------------- .../sourcecontrolsyncjob_client.go | 1 - ...ourcecontrolsyncjob_client_example_test.go | 96 -------- .../sourcecontrolsyncjobstreams_client.go | 1 - ...ntrolsyncjobstreams_client_example_test.go | 70 ------ .../armautomation/statistics_client.go | 1 - .../statistics_client_example_test.go | 43 ---- .../testjob_client_example_test.go | 132 ----------- .../armautomation/testjobstreams_client.go | 1 - .../testjobstreams_client_example_test.go | 68 ------ .../automation/armautomation/usages_client.go | 1 - .../usages_client_example_test.go | 43 ---- .../armautomation/variable_client.go | 1 - .../variable_client_example_test.go | 148 ------------ .../armautomation/watcher_client.go | 1 - .../watcher_client_example_test.go | 191 ---------------- .../armautomation/webhook_client.go | 1 - .../webhook_client_example_test.go | 154 ------------- 85 files changed, 41 insertions(+), 4921 deletions(-) delete mode 100644 sdk/resourcemanager/automation/armautomation/activity_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/agentregistrationinformation_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/automationaccount_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/automationclient_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/certificate_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/connection_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/connectiontype_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/credential_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/deletedautomationaccounts_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/dsccompilationjob_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/dsccompilationjobstream_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/dscconfiguration_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/dscnode_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/dscnodeconfiguration_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/fields_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/hybridrunbookworkergroup_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/hybridrunbookworkers_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/job_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/jobschedule_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/jobstream_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/keys_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/linkedworkspace_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/module_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/nodecountinformation_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/nodereports_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/objectdatatypes_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/python2package_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/runbook_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/runbookdraft_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/schedule_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/softwareupdateconfigurationmachineruns_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/softwareupdateconfigurationruns_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/softwareupdateconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/sourcecontrol_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjob_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjobstreams_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/statistics_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/testjob_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/testjobstreams_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/usages_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/variable_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/watcher_client_example_test.go delete mode 100644 sdk/resourcemanager/automation/armautomation/webhook_client_example_test.go diff --git a/sdk/resourcemanager/automation/armautomation/CHANGELOG.md b/sdk/resourcemanager/automation/armautomation/CHANGELOG.md index 1c974ba710d9..db558525ffea 100644 --- a/sdk/resourcemanager/automation/armautomation/CHANGELOG.md +++ b/sdk/resourcemanager/automation/armautomation/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 0.8.0 (2022-09-19) +### Breaking Changes + +- Function `*DscConfigurationClient.UpdateWithJSON` parameter(s) have been changed from `(context.Context, string, string, string, DscConfigurationUpdateParameters, *DscConfigurationClientUpdateWithJSONOptions)` to `(context.Context, string, string, string, *DscConfigurationClientUpdateWithJSONOptions)` +- Function `*DscConfigurationClient.UpdateWithText` parameter(s) have been changed from `(context.Context, string, string, string, string, *DscConfigurationClientUpdateWithTextOptions)` to `(context.Context, string, string, string, *DscConfigurationClientUpdateWithTextOptions)` + +### Features Added + +- New field `Parameters` in struct `DscConfigurationClientUpdateWithJSONOptions` +- New field `Parameters` in struct `DscConfigurationClientUpdateWithTextOptions` + + ## 0.7.0 (2022-07-12) ### Breaking Changes diff --git a/sdk/resourcemanager/automation/armautomation/account_client.go b/sdk/resourcemanager/automation/armautomation/account_client.go index fdfef3396ae3..d7ba65d51caf 100644 --- a/sdk/resourcemanager/automation/armautomation/account_client.go +++ b/sdk/resourcemanager/automation/armautomation/account_client.go @@ -217,7 +217,6 @@ func (client *AccountClient) getHandleResponse(resp *http.Response) (AccountClie } // NewListPager - Retrieve a list of accounts within a given subscription. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-06-22 // options - AccountClientListOptions contains the optional parameters for the AccountClient.List method. func (client *AccountClient) NewListPager(options *AccountClientListOptions) *runtime.Pager[AccountClientListResponse] { @@ -276,7 +275,6 @@ func (client *AccountClient) listHandleResponse(resp *http.Response) (AccountCli } // NewListByResourceGroupPager - Retrieve a list of accounts within a given resource group. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-06-22 // resourceGroupName - Name of an Azure Resource group. // options - AccountClientListByResourceGroupOptions contains the optional parameters for the AccountClient.ListByResourceGroup diff --git a/sdk/resourcemanager/automation/armautomation/activity_client.go b/sdk/resourcemanager/automation/armautomation/activity_client.go index 4ce74c37a7fc..6f36adb362a6 100644 --- a/sdk/resourcemanager/automation/armautomation/activity_client.go +++ b/sdk/resourcemanager/automation/armautomation/activity_client.go @@ -123,7 +123,6 @@ func (client *ActivityClient) getHandleResponse(resp *http.Response) (ActivityCl } // NewListByModulePager - Retrieve a list of activities in the module identified by module name. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/activity_client_example_test.go b/sdk/resourcemanager/automation/armautomation/activity_client_example_test.go deleted file mode 100644 index a61e9bd41927..000000000000 --- a/sdk/resourcemanager/automation/armautomation/activity_client_example_test.go +++ /dev/null @@ -1,68 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getActivityInAModule.json -func ExampleActivityClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewActivityClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "OmsCompositeResources", - "Add-AzureRmAccount", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listActivitiesByModule.json -func ExampleActivityClient_NewListByModulePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewActivityClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByModulePager("rg", - "myAutomationAccount33", - "OmsCompositeResources", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/agentregistrationinformation_client_example_test.go b/sdk/resourcemanager/automation/armautomation/agentregistrationinformation_client_example_test.go deleted file mode 100644 index 062ef72482fa..000000000000 --- a/sdk/resourcemanager/automation/armautomation/agentregistrationinformation_client_example_test.go +++ /dev/null @@ -1,65 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getAgentRegistration.json -func ExampleAgentRegistrationInformationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewAgentRegistrationInformationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount18", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/regenerateAgentRegistrationKey.json -func ExampleAgentRegistrationInformationClient_RegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewAgentRegistrationInformationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RegenerateKey(ctx, - "rg", - "myAutomationAccount18", - armautomation.AgentRegistrationRegenerateKeyParameter{ - KeyName: to.Ptr(armautomation.AgentRegistrationKeyNamePrimary), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/automationaccount_client_example_test.go b/sdk/resourcemanager/automation/armautomation/automationaccount_client_example_test.go deleted file mode 100644 index c7b8bac913cb..000000000000 --- a/sdk/resourcemanager/automation/armautomation/automationaccount_client_example_test.go +++ /dev/null @@ -1,171 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/updateAutomationAccount.json -func ExampleAccountClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewAccountClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "myAutomationAccount9", - armautomation.AccountUpdateParameters{ - Name: to.Ptr("myAutomationAccount9"), - Location: to.Ptr("East US 2"), - Properties: &armautomation.AccountUpdateProperties{ - SKU: &armautomation.SKU{ - Name: to.Ptr(armautomation.SKUNameEnumFree), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/createOrUpdateAutomationAccount.json -func ExampleAccountClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewAccountClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg", - "myAutomationAccount9", - armautomation.AccountCreateOrUpdateParameters{ - Name: to.Ptr("myAutomationAccount9"), - Location: to.Ptr("East US 2"), - Properties: &armautomation.AccountCreateOrUpdateProperties{ - SKU: &armautomation.SKU{ - Name: to.Ptr(armautomation.SKUNameEnumFree), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/deleteAutomationAccount.json -func ExampleAccountClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewAccountClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount9", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/getAutomationAccount.json -func ExampleAccountClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewAccountClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount9", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/listAutomationAccountsByResourceGroup.json -func ExampleAccountClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewAccountClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("rg", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/listAutomationAccountsBySubscription.json -func ExampleAccountClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewAccountClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/automationclient_client_example_test.go b/sdk/resourcemanager/automation/armautomation/automationclient_client_example_test.go deleted file mode 100644 index ef939e814faa..000000000000 --- a/sdk/resourcemanager/automation/armautomation/automationclient_client_example_test.go +++ /dev/null @@ -1,43 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/serializeGraphRunbookContent.json -func ExampleClient_ConvertGraphRunbookContent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ConvertGraphRunbookContent(ctx, - "rg", - "MyAutomationAccount", - armautomation.GraphicalRunbookContent{ - GraphRunbookJSON: to.Ptr(""), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/autorest.md b/sdk/resourcemanager/automation/armautomation/autorest.md index ea6a0c168c80..10c82a118f85 100644 --- a/sdk/resourcemanager/automation/armautomation/autorest.md +++ b/sdk/resourcemanager/automation/armautomation/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/432872fac1d0f8edcae98a0e8504afc0ee302710/specification/automation/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/432872fac1d0f8edcae98a0e8504afc0ee302710/specification/automation/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/automation/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/automation/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.7.0 +module-version: 0.8.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/automation/armautomation/certificate_client.go b/sdk/resourcemanager/automation/armautomation/certificate_client.go index eff9393494ef..c6c592ee4b27 100644 --- a/sdk/resourcemanager/automation/armautomation/certificate_client.go +++ b/sdk/resourcemanager/automation/armautomation/certificate_client.go @@ -233,7 +233,6 @@ func (client *CertificateClient) getHandleResponse(resp *http.Response) (Certifi } // NewListByAutomationAccountPager - Retrieve a list of certificates. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/certificate_client_example_test.go b/sdk/resourcemanager/automation/armautomation/certificate_client_example_test.go deleted file mode 100644 index bb8b6db2a1b5..000000000000 --- a/sdk/resourcemanager/automation/armautomation/certificate_client_example_test.go +++ /dev/null @@ -1,149 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteCertificate.json -func ExampleCertificateClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewCertificateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount33", - "testCert", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getCertificate.json -func ExampleCertificateClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewCertificateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "testCert", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/createOrUpdateCertificate.json -func ExampleCertificateClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewCertificateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg", - "myAutomationAccount18", - "testCert", - armautomation.CertificateCreateOrUpdateParameters{ - Name: to.Ptr("testCert"), - Properties: &armautomation.CertificateCreateOrUpdateProperties{ - Description: to.Ptr("Sample Cert"), - Base64Value: to.Ptr("base 64 value of cert"), - IsExportable: to.Ptr(false), - Thumbprint: to.Ptr("thumbprint of cert"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/updateCertificate.json -func ExampleCertificateClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewCertificateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "myAutomationAccount33", - "testCert", - armautomation.CertificateUpdateParameters{ - Name: to.Ptr("testCert"), - Properties: &armautomation.CertificateUpdateProperties{ - Description: to.Ptr("sample certificate. Description updated"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listCertificatesByAutomationAccount.json -func ExampleCertificateClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewCertificateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount33", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/connection_client.go b/sdk/resourcemanager/automation/armautomation/connection_client.go index cb7c4e3f1c42..8059625a7d8a 100644 --- a/sdk/resourcemanager/automation/armautomation/connection_client.go +++ b/sdk/resourcemanager/automation/armautomation/connection_client.go @@ -233,7 +233,6 @@ func (client *ConnectionClient) getHandleResponse(resp *http.Response) (Connecti } // NewListByAutomationAccountPager - Retrieve a list of connections. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/connection_client_example_test.go b/sdk/resourcemanager/automation/armautomation/connection_client_example_test.go deleted file mode 100644 index 4a72bc387227..000000000000 --- a/sdk/resourcemanager/automation/armautomation/connection_client_example_test.go +++ /dev/null @@ -1,157 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteConnection.json -func ExampleConnectionClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewConnectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount28", - "myConnection", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getConnection.json -func ExampleConnectionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewConnectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount28", - "myConnection", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/createOrUpdateConnection.json -func ExampleConnectionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewConnectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg", - "myAutomationAccount28", - "mysConnection", - armautomation.ConnectionCreateOrUpdateParameters{ - Name: to.Ptr("mysConnection"), - Properties: &armautomation.ConnectionCreateOrUpdateProperties{ - Description: to.Ptr("my description goes here"), - ConnectionType: &armautomation.ConnectionTypeAssociationProperty{ - Name: to.Ptr("Azure"), - }, - FieldDefinitionValues: map[string]*string{ - "AutomationCertificateName": to.Ptr("mysCertificateName"), - "SubscriptionID": to.Ptr("subid"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/updateConnection.json -func ExampleConnectionClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewConnectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "myAutomationAccount28", - "myConnection", - armautomation.ConnectionUpdateParameters{ - Name: to.Ptr("myConnection"), - Properties: &armautomation.ConnectionUpdateProperties{ - Description: to.Ptr("my description goes here"), - FieldDefinitionValues: map[string]*string{ - "AutomationCertificateName": to.Ptr("myCertificateName"), - "SubscriptionID": to.Ptr("b5e4748c-f69a-467c-8749-e2f9c8cd3009"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listConnectionsByAutomationAccount_First100.json -func ExampleConnectionClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewConnectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount28", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/connectiontype_client.go b/sdk/resourcemanager/automation/armautomation/connectiontype_client.go index 5ae133f5627a..ca7bd4350138 100644 --- a/sdk/resourcemanager/automation/armautomation/connectiontype_client.go +++ b/sdk/resourcemanager/automation/armautomation/connectiontype_client.go @@ -233,7 +233,6 @@ func (client *ConnectionTypeClient) getHandleResponse(resp *http.Response) (Conn } // NewListByAutomationAccountPager - Retrieve a list of connection types. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/connectiontype_client_example_test.go b/sdk/resourcemanager/automation/armautomation/connectiontype_client_example_test.go deleted file mode 100644 index c497201abc30..000000000000 --- a/sdk/resourcemanager/automation/armautomation/connectiontype_client_example_test.go +++ /dev/null @@ -1,132 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteConnectionType.json -func ExampleConnectionTypeClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewConnectionTypeClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount22", - "myCT", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getConnectionType.json -func ExampleConnectionTypeClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewConnectionTypeClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount22", - "myCT", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/createOrUpdateConnectionType.json -func ExampleConnectionTypeClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewConnectionTypeClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CreateOrUpdate(ctx, - "rg", - "myAutomationAccount22", - "myCT", - armautomation.ConnectionTypeCreateOrUpdateParameters{ - Name: to.Ptr("myCT"), - Properties: &armautomation.ConnectionTypeCreateOrUpdateProperties{ - FieldDefinitions: map[string]*armautomation.FieldDefinition{ - "myBoolField": { - Type: to.Ptr("bool"), - IsEncrypted: to.Ptr(false), - IsOptional: to.Ptr(false), - }, - "myStringField": { - Type: to.Ptr("string"), - IsEncrypted: to.Ptr(false), - IsOptional: to.Ptr(false), - }, - "myStringFieldEncrypted": { - Type: to.Ptr("string"), - IsEncrypted: to.Ptr(true), - IsOptional: to.Ptr(false), - }, - }, - IsGlobal: to.Ptr(false), - }, - }, - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getAllConnectionTypes_First100.json -func ExampleConnectionTypeClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewConnectionTypeClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount25", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/constants.go b/sdk/resourcemanager/automation/armautomation/constants.go index 1118a682f3ea..17db0a0a0398 100644 --- a/sdk/resourcemanager/automation/armautomation/constants.go +++ b/sdk/resourcemanager/automation/armautomation/constants.go @@ -11,7 +11,7 @@ package armautomation const ( moduleName = "armautomation" - moduleVersion = "v0.7.0" + moduleVersion = "v0.8.0" ) // AgentRegistrationKeyName - Gets or sets the agent registration key name - primary or secondary. diff --git a/sdk/resourcemanager/automation/armautomation/credential_client.go b/sdk/resourcemanager/automation/armautomation/credential_client.go index 15a6a32fd815..25e64b1d72c4 100644 --- a/sdk/resourcemanager/automation/armautomation/credential_client.go +++ b/sdk/resourcemanager/automation/armautomation/credential_client.go @@ -233,7 +233,6 @@ func (client *CredentialClient) getHandleResponse(resp *http.Response) (Credenti } // NewListByAutomationAccountPager - Retrieve a list of credentials. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/credential_client_example_test.go b/sdk/resourcemanager/automation/armautomation/credential_client_example_test.go deleted file mode 100644 index 734dc55f1905..000000000000 --- a/sdk/resourcemanager/automation/armautomation/credential_client_example_test.go +++ /dev/null @@ -1,150 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteCredentialExisting.json -func ExampleCredentialClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewCredentialClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount20", - "myCredential", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getCredential.json -func ExampleCredentialClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewCredentialClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount18", - "myCredential", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/createOrUpdateCredential.json -func ExampleCredentialClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewCredentialClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg", - "myAutomationAccount18", - "myCredential", - armautomation.CredentialCreateOrUpdateParameters{ - Name: to.Ptr("myCredential"), - Properties: &armautomation.CredentialCreateOrUpdateProperties{ - Description: to.Ptr("my description goes here"), - Password: to.Ptr(""), - UserName: to.Ptr("mylingaiah"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/updateCredential_patch.json -func ExampleCredentialClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewCredentialClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "myAutomationAccount18", - "myCredential", - armautomation.CredentialUpdateParameters{ - Name: to.Ptr("myCredential"), - Properties: &armautomation.CredentialUpdateProperties{ - Description: to.Ptr("my description goes here"), - Password: to.Ptr(""), - UserName: to.Ptr("mylingaiah"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listCredentialsByAutomationAccount.json -func ExampleCredentialClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewCredentialClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount20", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/deletedautomationaccounts_client_example_test.go b/sdk/resourcemanager/automation/armautomation/deletedautomationaccounts_client_example_test.go deleted file mode 100644 index 8fc7a3e5dd86..000000000000 --- a/sdk/resourcemanager/automation/armautomation/deletedautomationaccounts_client_example_test.go +++ /dev/null @@ -1,37 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2022-01-31/examples/getDeletedAutomationAccount.json -func ExampleDeletedAutomationAccountsClient_ListBySubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDeletedAutomationAccountsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListBySubscription(ctx, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/dsccompilationjob_client.go b/sdk/resourcemanager/automation/armautomation/dsccompilationjob_client.go index 9a569054d855..a9c51def65b9 100644 --- a/sdk/resourcemanager/automation/armautomation/dsccompilationjob_client.go +++ b/sdk/resourcemanager/automation/armautomation/dsccompilationjob_client.go @@ -251,7 +251,6 @@ func (client *DscCompilationJobClient) getStreamHandleResponse(resp *http.Respon } // NewListByAutomationAccountPager - Retrieve a list of dsc compilation jobs. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/dsccompilationjob_client_example_test.go b/sdk/resourcemanager/automation/armautomation/dsccompilationjob_client_example_test.go deleted file mode 100644 index 630e4f4eceb1..000000000000 --- a/sdk/resourcemanager/automation/armautomation/dsccompilationjob_client_example_test.go +++ /dev/null @@ -1,123 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/createCompilationJob.json -func ExampleDscCompilationJobClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscCompilationJobClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "rg", - "myAutomationAccount33", - "TestCompilationJob", - armautomation.DscCompilationJobCreateParameters{ - Properties: &armautomation.DscCompilationJobCreateProperties{ - Configuration: &armautomation.DscConfigurationAssociationProperty{ - Name: to.Ptr("SetupServer"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getCompilationJob.json -func ExampleDscCompilationJobClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscCompilationJobClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "TestCompilationJob", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listCompilationJobsByAutomationAccount.json -func ExampleDscCompilationJobClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscCompilationJobClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount33", - &armautomation.DscCompilationJobClientListByAutomationAccountOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/compilationJobStreamByJobStreamId.json -func ExampleDscCompilationJobClient_GetStream() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscCompilationJobClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetStream(ctx, - "rg", - "myAutomationAccount33", - "836d4e06-2d88-46b4-8500-7febd4906838", - "836d4e06-2d88-46b4-8500-7febd4906838_00636481062421684835_00000000000000000008", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/dsccompilationjobstream_client_example_test.go b/sdk/resourcemanager/automation/armautomation/dsccompilationjobstream_client_example_test.go deleted file mode 100644 index 112fb96e6fe7..000000000000 --- a/sdk/resourcemanager/automation/armautomation/dsccompilationjobstream_client_example_test.go +++ /dev/null @@ -1,40 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/compilationJobStreamList.json -func ExampleDscCompilationJobStreamClient_ListByJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscCompilationJobStreamClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByJob(ctx, - "rg", - "myAutomationAccount33", - "836d4e06-2d88-46b4-8500-7febd4906838", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/dscconfiguration_client.go b/sdk/resourcemanager/automation/armautomation/dscconfiguration_client.go index 0f3ae7037834..2a0e1f6a5311 100644 --- a/sdk/resourcemanager/automation/armautomation/dscconfiguration_client.go +++ b/sdk/resourcemanager/automation/armautomation/dscconfiguration_client.go @@ -364,7 +364,6 @@ func (client *DscConfigurationClient) getContentHandleResponse(resp *http.Respon } // NewListByAutomationAccountPager - Retrieve a list of configurations. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2019-06-01 // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. @@ -451,11 +450,10 @@ func (client *DscConfigurationClient) listByAutomationAccountHandleResponse(resp // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. // configurationName - The create or update parameters for configuration. -// parameters - The create or update parameters for configuration. // options - DscConfigurationClientUpdateWithJSONOptions contains the optional parameters for the DscConfigurationClient.UpdateWithJSON // method. -func (client *DscConfigurationClient) UpdateWithJSON(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationUpdateParameters, options *DscConfigurationClientUpdateWithJSONOptions) (DscConfigurationClientUpdateWithJSONResponse, error) { - req, err := client.updateWithJSONCreateRequest(ctx, resourceGroupName, automationAccountName, configurationName, parameters, options) +func (client *DscConfigurationClient) UpdateWithJSON(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, options *DscConfigurationClientUpdateWithJSONOptions) (DscConfigurationClientUpdateWithJSONResponse, error) { + req, err := client.updateWithJSONCreateRequest(ctx, resourceGroupName, automationAccountName, configurationName, options) if err != nil { return DscConfigurationClientUpdateWithJSONResponse{}, err } @@ -470,7 +468,7 @@ func (client *DscConfigurationClient) UpdateWithJSON(ctx context.Context, resour } // updateWithJSONCreateRequest creates the UpdateWithJSON request. -func (client *DscConfigurationClient) updateWithJSONCreateRequest(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters DscConfigurationUpdateParameters, options *DscConfigurationClientUpdateWithJSONOptions) (*policy.Request, error) { +func (client *DscConfigurationClient) updateWithJSONCreateRequest(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, options *DscConfigurationClientUpdateWithJSONOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -496,7 +494,10 @@ func (client *DscConfigurationClient) updateWithJSONCreateRequest(ctx context.Co reqQP.Set("api-version", "2019-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if options != nil && options.Parameters != nil { + return req, runtime.MarshalAsJSON(req, *options.Parameters) + } + return req, nil } // updateWithJSONHandleResponse handles the UpdateWithJSON response. @@ -514,11 +515,10 @@ func (client *DscConfigurationClient) updateWithJSONHandleResponse(resp *http.Re // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. // configurationName - The create or update parameters for configuration. -// parameters - The create or update parameters for configuration. // options - DscConfigurationClientUpdateWithTextOptions contains the optional parameters for the DscConfigurationClient.UpdateWithText // method. -func (client *DscConfigurationClient) UpdateWithText(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters string, options *DscConfigurationClientUpdateWithTextOptions) (DscConfigurationClientUpdateWithTextResponse, error) { - req, err := client.updateWithTextCreateRequest(ctx, resourceGroupName, automationAccountName, configurationName, parameters, options) +func (client *DscConfigurationClient) UpdateWithText(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, options *DscConfigurationClientUpdateWithTextOptions) (DscConfigurationClientUpdateWithTextResponse, error) { + req, err := client.updateWithTextCreateRequest(ctx, resourceGroupName, automationAccountName, configurationName, options) if err != nil { return DscConfigurationClientUpdateWithTextResponse{}, err } @@ -533,7 +533,7 @@ func (client *DscConfigurationClient) UpdateWithText(ctx context.Context, resour } // updateWithTextCreateRequest creates the UpdateWithText request. -func (client *DscConfigurationClient) updateWithTextCreateRequest(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, parameters string, options *DscConfigurationClientUpdateWithTextOptions) (*policy.Request, error) { +func (client *DscConfigurationClient) updateWithTextCreateRequest(ctx context.Context, resourceGroupName string, automationAccountName string, configurationName string, options *DscConfigurationClientUpdateWithTextOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -559,8 +559,11 @@ func (client *DscConfigurationClient) updateWithTextCreateRequest(ctx context.Co reqQP.Set("api-version", "2019-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - body := streaming.NopCloser(strings.NewReader(parameters)) - return req, req.SetBody(body, "text/plain; charset=utf-8") + if options != nil && options.Parameters != nil { + body := streaming.NopCloser(strings.NewReader(*options.Parameters)) + return req, req.SetBody(body, "text/plain; charset=utf-8") + } + return req, nil } // updateWithTextHandleResponse handles the UpdateWithText response. diff --git a/sdk/resourcemanager/automation/armautomation/dscconfiguration_client_example_test.go b/sdk/resourcemanager/automation/armautomation/dscconfiguration_client_example_test.go deleted file mode 100644 index e1008a7f2e12..000000000000 --- a/sdk/resourcemanager/automation/armautomation/dscconfiguration_client_example_test.go +++ /dev/null @@ -1,114 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/deleteDscConfiguration.json -func ExampleDscConfigurationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount33", - "TemplateBasic", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/getDscConfiguration.json -func ExampleDscConfigurationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "TemplateBasic", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/getDscConfigurationContent.json -func ExampleDscConfigurationClient_GetContent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetContent(ctx, - "rg", - "myAutomationAccount33", - "ConfigName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/getAllDscConfigurations.json -func ExampleDscConfigurationClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount33", - &armautomation.DscConfigurationClientListByAutomationAccountOptions{Filter: nil, - Skip: nil, - Top: nil, - Inlinecount: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/dscnode_client.go b/sdk/resourcemanager/automation/armautomation/dscnode_client.go index e9a76b70b464..0dfc3873af76 100644 --- a/sdk/resourcemanager/automation/armautomation/dscnode_client.go +++ b/sdk/resourcemanager/automation/armautomation/dscnode_client.go @@ -171,7 +171,6 @@ func (client *DscNodeClient) getHandleResponse(resp *http.Response) (DscNodeClie } // NewListByAutomationAccountPager - Retrieve a list of dsc nodes. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/dscnode_client_example_test.go b/sdk/resourcemanager/automation/armautomation/dscnode_client_example_test.go deleted file mode 100644 index 4442994b1ef9..000000000000 --- a/sdk/resourcemanager/automation/armautomation/dscnode_client_example_test.go +++ /dev/null @@ -1,123 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteDscNode.json -func ExampleDscNodeClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscNodeClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount9", - "e1243a76-a9bd-432f-bde3-ad8f317ee786", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getDscNode.json -func ExampleDscNodeClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscNodeClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "nodeId", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/updateDscNode.json -func ExampleDscNodeClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscNodeClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "myAutomationAccount33", - "nodeId", - armautomation.DscNodeUpdateParameters{ - NodeID: to.Ptr("nodeId"), - Properties: &armautomation.DscNodeUpdateParametersProperties{ - NodeConfiguration: &armautomation.DscNodeConfigurationAssociationProperty{ - Name: to.Ptr("SetupServer.localhost"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listAllDscNodesByAutomationAccount.json -func ExampleDscNodeClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscNodeClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount33", - &armautomation.DscNodeClientListByAutomationAccountOptions{Filter: nil, - Skip: nil, - Top: nil, - Inlinecount: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/dscnodeconfiguration_client.go b/sdk/resourcemanager/automation/armautomation/dscnodeconfiguration_client.go index ff3a04eb02f8..9cd10b68bf4e 100644 --- a/sdk/resourcemanager/automation/armautomation/dscnodeconfiguration_client.go +++ b/sdk/resourcemanager/automation/armautomation/dscnodeconfiguration_client.go @@ -242,7 +242,6 @@ func (client *DscNodeConfigurationClient) getHandleResponse(resp *http.Response) } // NewListByAutomationAccountPager - Retrieve a list of dsc node configurations. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/dscnodeconfiguration_client_example_test.go b/sdk/resourcemanager/automation/armautomation/dscnodeconfiguration_client_example_test.go deleted file mode 100644 index b2bbfc7fe8b6..000000000000 --- a/sdk/resourcemanager/automation/armautomation/dscnodeconfiguration_client_example_test.go +++ /dev/null @@ -1,135 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteDscNodeConfiguration.json -func ExampleDscNodeConfigurationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscNodeConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount20", - "configName.nodeConfigName", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getDscNodeConfiguration.json -func ExampleDscNodeConfigurationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscNodeConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "SetupServer.localhost", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/createOrUpdateDscNodeConfiguration.json -func ExampleDscNodeConfigurationClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscNodeConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg", - "myAutomationAccount20", - "configName.nodeConfigName", - armautomation.DscNodeConfigurationCreateOrUpdateParameters{ - Name: to.Ptr("configName.nodeConfigName"), - Properties: &armautomation.DscNodeConfigurationCreateOrUpdateParametersProperties{ - Configuration: &armautomation.DscConfigurationAssociationProperty{ - Name: to.Ptr("configName"), - }, - IncrementNodeConfigurationBuild: to.Ptr(true), - Source: &armautomation.ContentSource{ - Type: to.Ptr(armautomation.ContentSourceTypeEmbeddedContent), - Hash: &armautomation.ContentHash{ - Algorithm: to.Ptr("sha256"), - Value: to.Ptr("6DE256A57F01BFA29B88696D5E77A383D6E61484C7686E8DB955FA10ACE9FFE5"), - }, - Value: to.Ptr("\r\ninstance of MSFT_RoleResource as $MSFT_RoleResource1ref\r\n{\r\nResourceID = \"[WindowsFeature]IIS\";\r\n Ensure = \"Present\";\r\n SourceInfo = \"::3::32::WindowsFeature\";\r\n Name = \"Web-Server\";\r\n ModuleName = \"PsDesiredStateConfiguration\";\r\n\r\nModuleVersion = \"1.0\";\r\r\n ConfigurationName = \"configName\";\r\r\n};\r\ninstance of OMI_ConfigurationDocument\r\n\r\r\n {\r\n Version=\"2.0.0\";\r\n \r\r\n MinimumCompatibleVersion = \"1.0.0\";\r\n \r\r\n CompatibleVersionAdditionalProperties= {\"Omi_BaseResource:ConfigurationName\"};\r\n \r\r\n Author=\"weijiel\";\r\n \r\r\n GenerationDate=\"03/30/2017 13:40:25\";\r\n \r\r\n GenerationHost=\"TEST-BACKEND\";\r\n \r\r\n Name=\"configName\";\r\n\r\r\n };\r\n"), - Version: to.Ptr("1.0"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listDscNodeConfigurations.json -func ExampleDscNodeConfigurationClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewDscNodeConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount33", - &armautomation.DscNodeConfigurationClientListByAutomationAccountOptions{Filter: nil, - Skip: nil, - Top: nil, - Inlinecount: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/fields_client.go b/sdk/resourcemanager/automation/armautomation/fields_client.go index eb0d3fe45a94..caa74361247e 100644 --- a/sdk/resourcemanager/automation/armautomation/fields_client.go +++ b/sdk/resourcemanager/automation/armautomation/fields_client.go @@ -57,7 +57,6 @@ func NewFieldsClient(subscriptionID string, credential azcore.TokenCredential, o } // NewListByTypePager - Retrieve a list of fields of a given type identified by module name. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/fields_client_example_test.go b/sdk/resourcemanager/automation/armautomation/fields_client_example_test.go deleted file mode 100644 index e01296df03bc..000000000000 --- a/sdk/resourcemanager/automation/armautomation/fields_client_example_test.go +++ /dev/null @@ -1,45 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listFieldsByModuleAndType.json -func ExampleFieldsClient_NewListByTypePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewFieldsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTypePager("rg", - "MyAutomationAccount", - "MyModule", - "MyCustomType", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/go.mod b/sdk/resourcemanager/automation/armautomation/go.mod index e091aafc41ba..9b5f15827419 100644 --- a/sdk/resourcemanager/automation/armautomation/go.mod +++ b/sdk/resourcemanager/automation/armautomation/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautom go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/automation/armautomation/go.sum b/sdk/resourcemanager/automation/armautomation/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/automation/armautomation/go.sum +++ b/sdk/resourcemanager/automation/armautomation/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/automation/armautomation/hybridrunbookworkergroup_client.go b/sdk/resourcemanager/automation/armautomation/hybridrunbookworkergroup_client.go index e1256aec15e7..3cc44389ad7e 100644 --- a/sdk/resourcemanager/automation/armautomation/hybridrunbookworkergroup_client.go +++ b/sdk/resourcemanager/automation/armautomation/hybridrunbookworkergroup_client.go @@ -235,7 +235,6 @@ func (client *HybridRunbookWorkerGroupClient) getHandleResponse(resp *http.Respo } // NewListByAutomationAccountPager - Retrieve a list of hybrid runbook worker groups. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-02-22 // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/hybridrunbookworkergroup_client_example_test.go b/sdk/resourcemanager/automation/armautomation/hybridrunbookworkergroup_client_example_test.go deleted file mode 100644 index 4c3d53ae4dfa..000000000000 --- a/sdk/resourcemanager/automation/armautomation/hybridrunbookworkergroup_client_example_test.go +++ /dev/null @@ -1,148 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2022-02-22/examples/deleteHybridRunbookWorkerGroup.json -func ExampleHybridRunbookWorkerGroupClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewHybridRunbookWorkerGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount20", - "myGroup", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2022-02-22/examples/getHybridRunbookWorkerGroup.json -func ExampleHybridRunbookWorkerGroupClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewHybridRunbookWorkerGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "testaccount", - "TestHybridGroup", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2022-02-22/examples/putHybridRunbookWorkerGroup.json -func ExampleHybridRunbookWorkerGroupClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewHybridRunbookWorkerGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "rg", - "testaccount", - "TestHybridGroup", - armautomation.HybridRunbookWorkerGroupCreateOrUpdateParameters{ - Properties: &armautomation.HybridRunbookWorkerGroupCreateOrUpdateProperties{ - Credential: &armautomation.RunAsCredentialAssociationProperty{ - Name: to.Ptr("myRunAsCredentialName"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2022-02-22/examples/updateHybridRunbookWorkerGroup.json -func ExampleHybridRunbookWorkerGroupClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewHybridRunbookWorkerGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "testaccount", - "TestHybridGroup", - armautomation.HybridRunbookWorkerGroupCreateOrUpdateParameters{ - Properties: &armautomation.HybridRunbookWorkerGroupCreateOrUpdateProperties{ - Credential: &armautomation.RunAsCredentialAssociationProperty{ - Name: to.Ptr("myRunAsCredentialUpdatedName"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2022-02-22/examples/listHybridRunbookWorkerGroup.json -func ExampleHybridRunbookWorkerGroupClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewHybridRunbookWorkerGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "testaccount", - &armautomation.HybridRunbookWorkerGroupClientListByAutomationAccountOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/hybridrunbookworkers_client.go b/sdk/resourcemanager/automation/armautomation/hybridrunbookworkers_client.go index f4c24d2de10d..53490e95e870 100644 --- a/sdk/resourcemanager/automation/armautomation/hybridrunbookworkers_client.go +++ b/sdk/resourcemanager/automation/armautomation/hybridrunbookworkers_client.go @@ -250,7 +250,6 @@ func (client *HybridRunbookWorkersClient) getHandleResponse(resp *http.Response) } // NewListByHybridRunbookWorkerGroupPager - Retrieve a list of hybrid runbook workers. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-06-22 // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/hybridrunbookworkers_client_example_test.go b/sdk/resourcemanager/automation/armautomation/hybridrunbookworkers_client_example_test.go deleted file mode 100644 index 890670498094..000000000000 --- a/sdk/resourcemanager/automation/armautomation/hybridrunbookworkers_client_example_test.go +++ /dev/null @@ -1,145 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/deleteHybridRunbookWorker.json -func ExampleHybridRunbookWorkersClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewHybridRunbookWorkersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount20", - "myGroup", - "c010ad12-ef14-4a2a-aa9e-ef22c4745ddd", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/getHybridRunbookWorker.json -func ExampleHybridRunbookWorkersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewHybridRunbookWorkersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "testaccount", - "TestHybridGroup", - "c010ad12-ef14-4a2a-aa9e-ef22c4745ddd", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/putHybridRunbookWorker.json -func ExampleHybridRunbookWorkersClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewHybridRunbookWorkersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "rg", - "testaccount", - "TestHybridGroup", - "c010ad12-ef14-4a2a-aa9e-ef22c4745ddd", - armautomation.HybridRunbookWorkerCreateParameters{ - Properties: &armautomation.HybridRunbookWorkerCreateOrUpdateParameters{ - VMResourceID: to.Ptr("/subscriptions/vmsubid/resourceGroups/vmrg/providers/Microsoft.Compute/virtualMachines/vmname"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/moveHybridRunbookWorker.json -func ExampleHybridRunbookWorkersClient_Move() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewHybridRunbookWorkersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Move(ctx, - "rg", - "testaccount", - "TestHybridGroup", - "c010ad12-ef14-4a2a-aa9e-ef22c4745ddd", - armautomation.HybridRunbookWorkerMoveParameters{ - HybridRunbookWorkerGroupName: to.Ptr("TestHybridGroup2"), - }, - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/listHybridRunbookWorker.json -func ExampleHybridRunbookWorkersClient_NewListByHybridRunbookWorkerGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewHybridRunbookWorkersClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHybridRunbookWorkerGroupPager("rg", - "testaccount", - "TestHybridGroup", - &armautomation.HybridRunbookWorkersClientListByHybridRunbookWorkerGroupOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/job_client.go b/sdk/resourcemanager/automation/armautomation/job_client.go index 7e1981c6b248..7f4e4fa97245 100644 --- a/sdk/resourcemanager/automation/armautomation/job_client.go +++ b/sdk/resourcemanager/automation/armautomation/job_client.go @@ -320,7 +320,6 @@ func (client *JobClient) getRunbookContentHandleResponse(resp *http.Response) (J } // NewListByAutomationAccountPager - Retrieve a list of jobs. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2019-06-01 // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/job_client_example_test.go b/sdk/resourcemanager/automation/armautomation/job_client_example_test.go deleted file mode 100644 index 3bf0154e14bd..000000000000 --- a/sdk/resourcemanager/automation/armautomation/job_client_example_test.go +++ /dev/null @@ -1,211 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/job/getJobOutput.json -func ExampleJobClient_GetOutput() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetOutput(ctx, - "mygroup", - "ContoseAutomationAccount", - "foo", - &armautomation.JobClientGetOutputOptions{ClientRequestID: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/job/getJobRunbookContent.json -func ExampleJobClient_GetRunbookContent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetRunbookContent(ctx, - "mygroup", - "ContoseAutomationAccount", - "foo", - &armautomation.JobClientGetRunbookContentOptions{ClientRequestID: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/job/suspendJob.json -func ExampleJobClient_Suspend() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Suspend(ctx, - "mygroup", - "ContoseAutomationAccount", - "foo", - &armautomation.JobClientSuspendOptions{ClientRequestID: 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/job/stopJob.json -func ExampleJobClient_Stop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Stop(ctx, - "mygroup", - "ContoseAutomationAccount", - "foo", - &armautomation.JobClientStopOptions{ClientRequestID: 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/job/getJob.json -func ExampleJobClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "mygroup", - "ContoseAutomationAccount", - "foo", - &armautomation.JobClientGetOptions{ClientRequestID: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/job/createJob.json -func ExampleJobClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, - "mygroup", - "ContoseAutomationAccount", - "foo", - armautomation.JobCreateParameters{ - Properties: &armautomation.JobCreateProperties{ - Parameters: map[string]*string{ - "key01": to.Ptr("value01"), - "key02": to.Ptr("value02"), - }, - RunOn: to.Ptr(""), - Runbook: &armautomation.RunbookAssociationProperty{ - Name: to.Ptr("TestRunbook"), - }, - }, - }, - &armautomation.JobClientCreateOptions{ClientRequestID: 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/job/listJobsByAutomationAccount.json -func ExampleJobClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("mygroup", - "ContoseAutomationAccount", - &armautomation.JobClientListByAutomationAccountOptions{Filter: nil, - ClientRequestID: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/job/resumeJob.json -func ExampleJobClient_Resume() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Resume(ctx, - "mygroup", - "ContoseAutomationAccount", - "foo", - &armautomation.JobClientResumeOptions{ClientRequestID: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/automation/armautomation/jobschedule_client.go b/sdk/resourcemanager/automation/armautomation/jobschedule_client.go index 50a602942c93..7b507a839d39 100644 --- a/sdk/resourcemanager/automation/armautomation/jobschedule_client.go +++ b/sdk/resourcemanager/automation/armautomation/jobschedule_client.go @@ -223,7 +223,6 @@ func (client *JobScheduleClient) getHandleResponse(resp *http.Response) (JobSche } // NewListByAutomationAccountPager - Retrieve a list of job schedules. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/jobschedule_client_example_test.go b/sdk/resourcemanager/automation/armautomation/jobschedule_client_example_test.go deleted file mode 100644 index 0b5206e6408a..000000000000 --- a/sdk/resourcemanager/automation/armautomation/jobschedule_client_example_test.go +++ /dev/null @@ -1,123 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteJobSchedule.json -func ExampleJobScheduleClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobScheduleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "ContoseAutomationAccount", - "0fa462ba-3aa2-4138-83ca-9ebc3bc55cdc", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getJobSchedule.json -func ExampleJobScheduleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobScheduleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "ContoseAutomationAccount", - "0fa462ba-3aa2-4138-83ca-9ebc3bc55cdc", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/createJobSchedule.json -func ExampleJobScheduleClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobScheduleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, - "rg", - "ContoseAutomationAccount", - "0fa462ba-3aa2-4138-83ca-9ebc3bc55cdc", - armautomation.JobScheduleCreateParameters{ - Properties: &armautomation.JobScheduleCreateProperties{ - Parameters: map[string]*string{ - "jobscheduletag01": to.Ptr("jobschedulevalue01"), - "jobscheduletag02": to.Ptr("jobschedulevalue02"), - }, - Runbook: &armautomation.RunbookAssociationProperty{ - Name: to.Ptr("TestRunbook"), - }, - Schedule: &armautomation.ScheduleAssociationProperty{ - Name: to.Ptr("ScheduleNameGoesHere332204b5-debe-4348-a5c7-6357457189f2"), - }, - }, - }, - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listAllJobSchedulesByAutomationAccount.json -func ExampleJobScheduleClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobScheduleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "ContoseAutomationAccount", - &armautomation.JobScheduleClientListByAutomationAccountOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/jobstream_client.go b/sdk/resourcemanager/automation/armautomation/jobstream_client.go index e2dc153d5f83..c871523142ed 100644 --- a/sdk/resourcemanager/automation/armautomation/jobstream_client.go +++ b/sdk/resourcemanager/automation/armautomation/jobstream_client.go @@ -126,7 +126,6 @@ func (client *JobStreamClient) getHandleResponse(resp *http.Response) (JobStream } // NewListByJobPager - Retrieve a list of jobs streams identified by job name. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2019-06-01 // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/jobstream_client_example_test.go b/sdk/resourcemanager/automation/armautomation/jobstream_client_example_test.go deleted file mode 100644 index 2bd265be383f..000000000000 --- a/sdk/resourcemanager/automation/armautomation/jobstream_client_example_test.go +++ /dev/null @@ -1,70 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/job/getJobStream.json -func ExampleJobStreamClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobStreamClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "mygroup", - "ContoseAutomationAccount", - "foo", - "851b2101-686f-40e2-8a4b-5b8df08afbd1_00636535684910693884_00000000000000000001", - &armautomation.JobStreamClientGetOptions{ClientRequestID: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/job/listJobStreamsByJob.json -func ExampleJobStreamClient_NewListByJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewJobStreamClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByJobPager("mygroup", - "ContoseAutomationAccount", - "foo", - &armautomation.JobStreamClientListByJobOptions{Filter: nil, - ClientRequestID: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/keys_client_example_test.go b/sdk/resourcemanager/automation/armautomation/keys_client_example_test.go deleted file mode 100644 index 7e59fa5c2c17..000000000000 --- a/sdk/resourcemanager/automation/armautomation/keys_client_example_test.go +++ /dev/null @@ -1,39 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/listAutomationAccountKeys.json -func ExampleKeysClient_ListByAutomationAccount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewKeysClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByAutomationAccount(ctx, - "rg", - "MyAutomationAccount", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/linkedworkspace_client_example_test.go b/sdk/resourcemanager/automation/armautomation/linkedworkspace_client_example_test.go deleted file mode 100644 index 284cbdba7774..000000000000 --- a/sdk/resourcemanager/automation/armautomation/linkedworkspace_client_example_test.go +++ /dev/null @@ -1,39 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getLinkedWorkspace.json -func ExampleLinkedWorkspaceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewLinkedWorkspaceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "ContosoAutomationAccount", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/models.go b/sdk/resourcemanager/automation/armautomation/models.go index ea19463c21fd..ecf295a2e32f 100644 --- a/sdk/resourcemanager/automation/armautomation/models.go +++ b/sdk/resourcemanager/automation/armautomation/models.go @@ -1078,13 +1078,15 @@ type DscConfigurationClientListByAutomationAccountOptions struct { // DscConfigurationClientUpdateWithJSONOptions contains the optional parameters for the DscConfigurationClient.UpdateWithJSON // method. type DscConfigurationClientUpdateWithJSONOptions struct { - // placeholder for future optional parameters + // The create or update parameters for configuration. + Parameters *DscConfigurationUpdateParameters } // DscConfigurationClientUpdateWithTextOptions contains the optional parameters for the DscConfigurationClient.UpdateWithText // method. type DscConfigurationClientUpdateWithTextOptions struct { - // placeholder for future optional parameters + // The create or update parameters for configuration. + Parameters *string } // DscConfigurationCreateOrUpdateParameters - The parameters supplied to the create or update configuration operation. diff --git a/sdk/resourcemanager/automation/armautomation/module_client.go b/sdk/resourcemanager/automation/armautomation/module_client.go index fd6fcd9f9dcc..cf264dc3b00b 100644 --- a/sdk/resourcemanager/automation/armautomation/module_client.go +++ b/sdk/resourcemanager/automation/armautomation/module_client.go @@ -232,7 +232,6 @@ func (client *ModuleClient) getHandleResponse(resp *http.Response) (ModuleClient } // NewListByAutomationAccountPager - Retrieve a list of modules. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/module_client_example_test.go b/sdk/resourcemanager/automation/armautomation/module_client_example_test.go deleted file mode 100644 index e6570b05720b..000000000000 --- a/sdk/resourcemanager/automation/armautomation/module_client_example_test.go +++ /dev/null @@ -1,158 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteModule.json -func ExampleModuleClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewModuleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount33", - "OmsCompositeResources", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getModule.json -func ExampleModuleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewModuleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "OmsCompositeResources", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/createOrUpdateModule.json -func ExampleModuleClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewModuleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg", - "myAutomationAccount33", - "OmsCompositeResources", - armautomation.ModuleCreateOrUpdateParameters{ - Properties: &armautomation.ModuleCreateOrUpdateProperties{ - ContentLink: &armautomation.ContentLink{ - ContentHash: &armautomation.ContentHash{ - Algorithm: to.Ptr("sha265"), - Value: to.Ptr("07E108A962B81DD9C9BAA89BB47C0F6EE52B29E83758B07795E408D258B2B87A"), - }, - URI: to.Ptr("https://teststorage.blob.core.windows.net/dsccomposite/OmsCompositeResources.zip"), - Version: to.Ptr("1.0.0.0"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/updateModule.json -func ExampleModuleClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewModuleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "MyAutomationAccount", - "MyModule", - armautomation.ModuleUpdateParameters{ - Properties: &armautomation.ModuleUpdateProperties{ - ContentLink: &armautomation.ContentLink{ - ContentHash: &armautomation.ContentHash{ - Algorithm: to.Ptr("sha265"), - Value: to.Ptr("07E108A962B81DD9C9BAA89BB47C0F6EE52B29E83758B07795E408D258B2B87A"), - }, - URI: to.Ptr("https://teststorage.blob.core.windows.net/mycontainer/MyModule.zip"), - Version: to.Ptr("1.0.0.0"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listModulesByAutomationAccount.json -func ExampleModuleClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewModuleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount33", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/nodecountinformation_client_example_test.go b/sdk/resourcemanager/automation/armautomation/nodecountinformation_client_example_test.go deleted file mode 100644 index 82cec820e3a4..000000000000 --- a/sdk/resourcemanager/automation/armautomation/nodecountinformation_client_example_test.go +++ /dev/null @@ -1,40 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listPagedDscNodeConfigurationCounts.json -func ExampleNodeCountInformationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewNodeCountInformationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - armautomation.CountTypeNodeconfiguration, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/nodereports_client.go b/sdk/resourcemanager/automation/armautomation/nodereports_client.go index 3874bdab50c4..5fdc7f1478b2 100644 --- a/sdk/resourcemanager/automation/armautomation/nodereports_client.go +++ b/sdk/resourcemanager/automation/armautomation/nodereports_client.go @@ -189,7 +189,6 @@ func (client *NodeReportsClient) getContentHandleResponse(resp *http.Response) ( } // NewListByNodePager - Retrieve the Dsc node report list by node id. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/nodereports_client_example_test.go b/sdk/resourcemanager/automation/armautomation/nodereports_client_example_test.go deleted file mode 100644 index d2ca7d3a6f20..000000000000 --- a/sdk/resourcemanager/automation/armautomation/nodereports_client_example_test.go +++ /dev/null @@ -1,92 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listDscNodeReportsByNode.json -func ExampleNodeReportsClient_NewListByNodePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewNodeReportsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByNodePager("rg", - "myAutomationAccount33", - "nodeId", - &armautomation.NodeReportsClientListByNodeOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getDscNodeReport.json -func ExampleNodeReportsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewNodeReportsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "nodeId", - "903a5ead-140c-11e7-a943-000d3a6140c9", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getDscNodeReportContent.json -func ExampleNodeReportsClient_GetContent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewNodeReportsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetContent(ctx, - "rg", - "myAutomationAccount33", - "nodeId", - "reportId", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/objectdatatypes_client.go b/sdk/resourcemanager/automation/armautomation/objectdatatypes_client.go index d87a67eb2a58..c1a06c6d2078 100644 --- a/sdk/resourcemanager/automation/armautomation/objectdatatypes_client.go +++ b/sdk/resourcemanager/automation/armautomation/objectdatatypes_client.go @@ -57,7 +57,6 @@ func NewObjectDataTypesClient(subscriptionID string, credential azcore.TokenCred } // NewListFieldsByModuleAndTypePager - Retrieve a list of fields of a given type identified by module name. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. @@ -131,7 +130,6 @@ func (client *ObjectDataTypesClient) listFieldsByModuleAndTypeHandleResponse(res } // NewListFieldsByTypePager - Retrieve a list of fields of a given type across all accessible modules. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/objectdatatypes_client_example_test.go b/sdk/resourcemanager/automation/armautomation/objectdatatypes_client_example_test.go deleted file mode 100644 index 013dd6d44a20..000000000000 --- a/sdk/resourcemanager/automation/armautomation/objectdatatypes_client_example_test.go +++ /dev/null @@ -1,72 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listFieldsByModuleAndType.json -func ExampleObjectDataTypesClient_NewListFieldsByModuleAndTypePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewObjectDataTypesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListFieldsByModuleAndTypePager("rg", - "MyAutomationAccount", - "MyModule", - "MyCustomType", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listFieldsByType.json -func ExampleObjectDataTypesClient_NewListFieldsByTypePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewObjectDataTypesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListFieldsByTypePager("rg", - "MyAutomationAccount", - "MyCustomType", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/operations_client.go b/sdk/resourcemanager/automation/armautomation/operations_client.go index 80b7e22eccec..1bdffda70426 100644 --- a/sdk/resourcemanager/automation/armautomation/operations_client.go +++ b/sdk/resourcemanager/automation/armautomation/operations_client.go @@ -50,7 +50,6 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available Automation REST API operations. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-06-22 // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { diff --git a/sdk/resourcemanager/automation/armautomation/privateendpointconnections_client.go b/sdk/resourcemanager/automation/armautomation/privateendpointconnections_client.go index f5e1438bbc2c..bb7083cc550f 100644 --- a/sdk/resourcemanager/automation/armautomation/privateendpointconnections_client.go +++ b/sdk/resourcemanager/automation/armautomation/privateendpointconnections_client.go @@ -255,7 +255,6 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res } // NewListByAutomationAccountPager - List all private endpoint connections on a Automation account. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/automation/armautomation/privateendpointconnections_client_example_test.go deleted file mode 100644 index 4fe0406953e4..000000000000 --- a/sdk/resourcemanager/automation/armautomation/privateendpointconnections_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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/PrivateEndpointConnectionListGet.json -func ExamplePrivateEndpointConnectionsClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg1", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "ddb1", - "privateEndpointConnectionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "ddb1", - "privateEndpointConnectionName", - armautomation.PrivateEndpointConnection{ - Properties: &armautomation.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armautomation.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "ddb1", - "privateEndpointConnectionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/automation/armautomation/privatelinkresources_client.go b/sdk/resourcemanager/automation/armautomation/privatelinkresources_client.go index c8af5458b45c..287ee559abad 100644 --- a/sdk/resourcemanager/automation/armautomation/privatelinkresources_client.go +++ b/sdk/resourcemanager/automation/armautomation/privatelinkresources_client.go @@ -57,7 +57,6 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke } // NewAutomationPager - Gets the private link resources that need to be created for Automation account. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/privatelinkresources_client_example_test.go b/sdk/resourcemanager/automation/armautomation/privatelinkresources_client_example_test.go deleted file mode 100644 index b65601cc769a..000000000000 --- a/sdk/resourcemanager/automation/armautomation/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,43 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/PrivateLinkResourceListGet.json -func ExamplePrivateLinkResourcesClient_NewAutomationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewPrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewAutomationPager("rg1", - "ddb1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/python2package_client.go b/sdk/resourcemanager/automation/armautomation/python2package_client.go index b77fa765fd27..97a46fdb5e89 100644 --- a/sdk/resourcemanager/automation/armautomation/python2package_client.go +++ b/sdk/resourcemanager/automation/armautomation/python2package_client.go @@ -233,7 +233,6 @@ func (client *Python2PackageClient) getHandleResponse(resp *http.Response) (Pyth } // NewListByAutomationAccountPager - Retrieve a list of python 2 packages. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/python2package_client_example_test.go b/sdk/resourcemanager/automation/armautomation/python2package_client_example_test.go deleted file mode 100644 index d21f7905f86c..000000000000 --- a/sdk/resourcemanager/automation/armautomation/python2package_client_example_test.go +++ /dev/null @@ -1,150 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deletePython2Package.json -func ExamplePython2PackageClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewPython2PackageClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount33", - "OmsCompositeResources", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getPython2Package.json -func ExamplePython2PackageClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewPython2PackageClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "OmsCompositeResources", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/createOrUpdatePython2Package.json -func ExamplePython2PackageClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewPython2PackageClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg", - "myAutomationAccount33", - "OmsCompositeResources", - armautomation.PythonPackageCreateParameters{ - Properties: &armautomation.PythonPackageCreateProperties{ - ContentLink: &armautomation.ContentLink{ - ContentHash: &armautomation.ContentHash{ - Algorithm: to.Ptr("sha265"), - Value: to.Ptr("07E108A962B81DD9C9BAA89BB47C0F6EE52B29E83758B07795E408D258B2B87A"), - }, - URI: to.Ptr("https://teststorage.blob.core.windows.net/dsccomposite/OmsCompositeResources.zip"), - Version: to.Ptr("1.0.0.0"), - }, - }, - Tags: map[string]*string{}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/updatePython2Package.json -func ExamplePython2PackageClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewPython2PackageClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "MyAutomationAccount", - "MyPython2Package", - armautomation.PythonPackageUpdateParameters{ - Tags: map[string]*string{}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listPython2PackagesByAutomationAccount.json -func ExamplePython2PackageClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewPython2PackageClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount33", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/runbook_client.go b/sdk/resourcemanager/automation/armautomation/runbook_client.go index 366fa7f4abdb..156ad7725ef1 100644 --- a/sdk/resourcemanager/automation/armautomation/runbook_client.go +++ b/sdk/resourcemanager/automation/armautomation/runbook_client.go @@ -285,7 +285,6 @@ func (client *RunbookClient) getContentCreateRequest(ctx context.Context, resour } // NewListByAutomationAccountPager - Retrieve a list of runbooks. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2018-06-30 // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/runbook_client_example_test.go b/sdk/resourcemanager/automation/armautomation/runbook_client_example_test.go deleted file mode 100644 index 170854606d18..000000000000 --- a/sdk/resourcemanager/automation/armautomation/runbook_client_example_test.go +++ /dev/null @@ -1,208 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/publishRunbook.json -func ExampleRunbookClient_BeginPublish() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewRunbookClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPublish(ctx, - "rg", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/getRunbookContent.json -func ExampleRunbookClient_GetContent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewRunbookClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetContent(ctx, - "rg", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/getRunbook.json -func ExampleRunbookClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewRunbookClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/createOrUpdateRunbook.json -func ExampleRunbookClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewRunbookClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - armautomation.RunbookCreateOrUpdateParameters{ - Name: to.Ptr("Get-AzureVMTutorial"), - Location: to.Ptr("East US 2"), - Properties: &armautomation.RunbookCreateOrUpdateProperties{ - Description: to.Ptr("Description of the Runbook"), - LogActivityTrace: to.Ptr[int32](1), - LogProgress: to.Ptr(true), - LogVerbose: to.Ptr(false), - PublishContentLink: &armautomation.ContentLink{ - ContentHash: &armautomation.ContentHash{ - Algorithm: to.Ptr("SHA256"), - Value: to.Ptr("115775B8FF2BE672D8A946BD0B489918C724DDE15A440373CA54461D53010A80"), - }, - URI: to.Ptr("https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1"), - }, - RunbookType: to.Ptr(armautomation.RunbookTypeEnumPowerShellWorkflow), - }, - Tags: map[string]*string{ - "tag01": to.Ptr("value01"), - "tag02": to.Ptr("value02"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/updateRunbook.json -func ExampleRunbookClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewRunbookClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "rg", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - armautomation.RunbookUpdateParameters{ - Properties: &armautomation.RunbookUpdateProperties{ - Description: to.Ptr("Updated Description of the Runbook"), - LogActivityTrace: to.Ptr[int32](1), - LogProgress: to.Ptr(true), - LogVerbose: to.Ptr(false), - }, - }, - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/deleteRunbook.json -func ExampleRunbookClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewRunbookClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/listRunbooksByAutomationAccount.json -func ExampleRunbookClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewRunbookClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "ContoseAutomationAccount", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/runbookdraft_client_example_test.go b/sdk/resourcemanager/automation/armautomation/runbookdraft_client_example_test.go deleted file mode 100644 index 25438431c6e3..000000000000 --- a/sdk/resourcemanager/automation/armautomation/runbookdraft_client_example_test.go +++ /dev/null @@ -1,82 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/getRunbookDraftContent.json -func ExampleRunbookDraftClient_GetContent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewRunbookDraftClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetContent(ctx, - "rg", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/getRunbookDraft.json -func ExampleRunbookDraftClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewRunbookDraftClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/undoDraftEditToLastKnownPublishedState.json -func ExampleRunbookDraftClient_UndoEdit() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewRunbookDraftClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.UndoEdit(ctx, - "rg", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/automation/armautomation/schedule_client.go b/sdk/resourcemanager/automation/armautomation/schedule_client.go index c06642bb2abe..49b7a18cdcab 100644 --- a/sdk/resourcemanager/automation/armautomation/schedule_client.go +++ b/sdk/resourcemanager/automation/armautomation/schedule_client.go @@ -232,7 +232,6 @@ func (client *ScheduleClient) getHandleResponse(resp *http.Response) (ScheduleCl } // NewListByAutomationAccountPager - Retrieve a list of schedules. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/schedule_client_example_test.go b/sdk/resourcemanager/automation/armautomation/schedule_client_example_test.go deleted file mode 100644 index 4a3479eadbe1..000000000000 --- a/sdk/resourcemanager/automation/armautomation/schedule_client_example_test.go +++ /dev/null @@ -1,154 +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. - -package armautomation_test - -import ( - "context" - "log" - - "time" - - "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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/createOrUpdateSchedule.json -func ExampleScheduleClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewScheduleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg", - "myAutomationAccount33", - "mySchedule", - armautomation.ScheduleCreateOrUpdateParameters{ - Name: to.Ptr("mySchedule"), - Properties: &armautomation.ScheduleCreateOrUpdateProperties{ - Description: to.Ptr("my description of schedule goes here"), - AdvancedSchedule: &armautomation.AdvancedSchedule{}, - ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-04-01T17:28:57.2494819Z"); return t }()), - Frequency: to.Ptr(armautomation.ScheduleFrequencyHour), - Interval: float64(1), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-27T17:28:57.2494819Z"); return t }()), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/updateSchedule.json -func ExampleScheduleClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewScheduleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "myAutomationAccount33", - "mySchedule", - armautomation.ScheduleUpdateParameters{ - Name: to.Ptr("mySchedule"), - Properties: &armautomation.ScheduleUpdateProperties{ - Description: to.Ptr("my updated description of schedule goes here"), - IsEnabled: to.Ptr(false), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getSchedule.json -func ExampleScheduleClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewScheduleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "mySchedule", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteSchedule.json -func ExampleScheduleClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewScheduleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount33", - "mySchedule", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listSchedulesByAutomationAccount_First100.json -func ExampleScheduleClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewScheduleClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount33", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/softwareupdateconfigurationmachineruns_client_example_test.go b/sdk/resourcemanager/automation/armautomation/softwareupdateconfigurationmachineruns_client_example_test.go deleted file mode 100644 index e654e8badc01..000000000000 --- a/sdk/resourcemanager/automation/armautomation/softwareupdateconfigurationmachineruns_client_example_test.go +++ /dev/null @@ -1,43 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfigurationMachineRun/listSoftwareUpdateConfigurationMachineRuns.json -func ExampleSoftwareUpdateConfigurationMachineRunsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSoftwareUpdateConfigurationMachineRunsClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "mygroup", - "myaccount", - &armautomation.SoftwareUpdateConfigurationMachineRunsClientListOptions{ClientRequestID: nil, - Filter: nil, - Skip: nil, - Top: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/softwareupdateconfigurationruns_client_example_test.go b/sdk/resourcemanager/automation/armautomation/softwareupdateconfigurationruns_client_example_test.go deleted file mode 100644 index 87eb929f5178..000000000000 --- a/sdk/resourcemanager/automation/armautomation/softwareupdateconfigurationruns_client_example_test.go +++ /dev/null @@ -1,44 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfigurationRun/listFailedSoftwareUpdateConfigurationRuns.json -func ExampleSoftwareUpdateConfigurationRunsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSoftwareUpdateConfigurationRunsClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "mygroup", - "myaccount", - &armautomation.SoftwareUpdateConfigurationRunsClientListOptions{ClientRequestID: nil, - Filter: to.Ptr("properties/status%20eq%20'Failed'"), - Skip: nil, - Top: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/softwareupdateconfigurations_client_example_test.go b/sdk/resourcemanager/automation/armautomation/softwareupdateconfigurations_client_example_test.go deleted file mode 100644 index 6fb443329dcb..000000000000 --- a/sdk/resourcemanager/automation/armautomation/softwareupdateconfigurations_client_example_test.go +++ /dev/null @@ -1,189 +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. - -package armautomation_test - -import ( - "context" - "log" - - "time" - - "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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/createSoftwareUpdateConfiguration.json -func ExampleSoftwareUpdateConfigurationsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSoftwareUpdateConfigurationsClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "mygroup", - "myaccount", - "testpatch", - armautomation.SoftwareUpdateConfiguration{ - Properties: &armautomation.SoftwareUpdateConfigurationProperties{ - ScheduleInfo: &armautomation.SUCScheduleProperties{ - AdvancedSchedule: &armautomation.AdvancedSchedule{ - WeekDays: []*string{ - to.Ptr("Monday"), - to.Ptr("Thursday")}, - }, - ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-09T11:22:57+00:00"); return t }()), - Frequency: to.Ptr(armautomation.ScheduleFrequencyHour), - Interval: to.Ptr[int64](1), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-19T12:22:57+00:00"); return t }()), - TimeZone: to.Ptr("America/Los_Angeles"), - }, - Tasks: &armautomation.SoftwareUpdateConfigurationTasks{ - PostTask: &armautomation.TaskProperties{ - Source: to.Ptr("GetCache"), - }, - PreTask: &armautomation.TaskProperties{ - Parameters: map[string]*string{ - "COMPUTERNAME": to.Ptr("Computer1"), - }, - Source: to.Ptr("HelloWorld"), - }, - }, - UpdateConfiguration: &armautomation.UpdateConfiguration{ - AzureVirtualMachines: []*string{ - to.Ptr("/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-01"), - to.Ptr("/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-02"), - to.Ptr("/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources/providers/Microsoft.Compute/virtualMachines/vm-03")}, - Duration: to.Ptr("PT2H0M"), - NonAzureComputerNames: []*string{ - to.Ptr("box1.contoso.com"), - to.Ptr("box2.contoso.com")}, - OperatingSystem: to.Ptr(armautomation.OperatingSystemTypeWindows), - Targets: &armautomation.TargetProperties{ - AzureQueries: []*armautomation.AzureQueryProperties{ - { - Locations: []*string{ - to.Ptr("Japan East"), - to.Ptr("UK South")}, - Scope: []*string{ - to.Ptr("/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067/resourceGroups/myresources"), - to.Ptr("/subscriptions/5ae68d89-69a4-454f-b5ce-e443cc4e0067")}, - TagSettings: &armautomation.TagSettingsProperties{ - FilterOperator: to.Ptr(armautomation.TagOperatorsAll), - Tags: map[string][]*string{ - "tag1": { - to.Ptr("tag1Value1"), - to.Ptr("tag1Value2"), - to.Ptr("tag1Value3")}, - "tag2": { - to.Ptr("tag2Value1"), - to.Ptr("tag2Value2"), - to.Ptr("tag2Value3")}, - }, - }, - }}, - NonAzureQueries: []*armautomation.NonAzureQueryProperties{ - { - FunctionAlias: to.Ptr("SavedSearch1"), - WorkspaceID: to.Ptr("WorkspaceId1"), - }, - { - FunctionAlias: to.Ptr("SavedSearch2"), - WorkspaceID: to.Ptr("WorkspaceId2"), - }}, - }, - Windows: &armautomation.WindowsProperties{ - ExcludedKbNumbers: []*string{ - to.Ptr("168934"), - to.Ptr("168973")}, - IncludedUpdateClassifications: to.Ptr(armautomation.WindowsUpdateClassesCritical), - RebootSetting: to.Ptr("IfRequired"), - }, - }, - }, - }, - &armautomation.SoftwareUpdateConfigurationsClientCreateOptions{ClientRequestID: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/getSoftwareUpdateConfigurationByName.json -func ExampleSoftwareUpdateConfigurationsClient_GetByName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSoftwareUpdateConfigurationsClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByName(ctx, - "mygroup", - "myaccount", - "mypatch", - &armautomation.SoftwareUpdateConfigurationsClientGetByNameOptions{ClientRequestID: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/deleteSoftwareUpdateConfiguration.json -func ExampleSoftwareUpdateConfigurationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSoftwareUpdateConfigurationsClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "mygroup", - "myaccount", - "mypatch", - &armautomation.SoftwareUpdateConfigurationsClientDeleteOptions{ClientRequestID: 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/listSoftwareUpdateConfigurations.json -func ExampleSoftwareUpdateConfigurationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSoftwareUpdateConfigurationsClient("1a7d4044-286c-4acb-969a-96639265bf2e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "mygroup", - "myaccount", - &armautomation.SoftwareUpdateConfigurationsClientListOptions{ClientRequestID: nil, - Filter: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/sourcecontrol_client.go b/sdk/resourcemanager/automation/armautomation/sourcecontrol_client.go index f31d25a54196..f9e532409aa6 100644 --- a/sdk/resourcemanager/automation/armautomation/sourcecontrol_client.go +++ b/sdk/resourcemanager/automation/armautomation/sourcecontrol_client.go @@ -233,7 +233,6 @@ func (client *SourceControlClient) getHandleResponse(resp *http.Response) (Sourc } // NewListByAutomationAccountPager - Retrieve a list of source controls. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/sourcecontrol_client_example_test.go b/sdk/resourcemanager/automation/armautomation/sourcecontrol_client_example_test.go deleted file mode 100644 index b7a5a6650325..000000000000 --- a/sdk/resourcemanager/automation/armautomation/sourcecontrol_client_example_test.go +++ /dev/null @@ -1,162 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/sourceControl/createOrUpdateSourceControl.json -func ExampleSourceControlClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSourceControlClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg", - "sampleAccount9", - "sampleSourceControl", - armautomation.SourceControlCreateOrUpdateParameters{ - Properties: &armautomation.SourceControlCreateOrUpdateProperties{ - Description: to.Ptr("my description"), - AutoSync: to.Ptr(true), - Branch: to.Ptr("master"), - FolderPath: to.Ptr("/folderOne/folderTwo"), - PublishRunbook: to.Ptr(true), - RepoURL: to.Ptr("https://sampleUser.visualstudio.com/myProject/_git/myRepository"), - SecurityToken: &armautomation.SourceControlSecurityTokenProperties{ - AccessToken: to.Ptr("3a326f7a0dcd343ea58fee21f2fd5fb4c1234567"), - TokenType: to.Ptr(armautomation.TokenTypePersonalAccessToken), - }, - SourceType: to.Ptr(armautomation.SourceTypeVsoGit), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/sourceControl/updateSourceControl_patch.json -func ExampleSourceControlClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSourceControlClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "sampleAccount9", - "sampleSourceControl", - armautomation.SourceControlUpdateParameters{ - Properties: &armautomation.SourceControlUpdateProperties{ - Description: to.Ptr("my description"), - AutoSync: to.Ptr(true), - Branch: to.Ptr("master"), - FolderPath: to.Ptr("/folderOne/folderTwo"), - PublishRunbook: to.Ptr(true), - SecurityToken: &armautomation.SourceControlSecurityTokenProperties{ - AccessToken: to.Ptr("3a326f7a0dcd343ea58fee21f2fd5fb4c1234567"), - TokenType: to.Ptr(armautomation.TokenTypePersonalAccessToken), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/sourceControl/deleteSourceControl.json -func ExampleSourceControlClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSourceControlClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "sampleAccount9", - "sampleSourceControl", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/sourceControl/getSourceControl.json -func ExampleSourceControlClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSourceControlClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "sampleAccount9", - "sampleSourceControl", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/sourceControl/getAllSourceControls.json -func ExampleSourceControlClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSourceControlClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "sampleAccount9", - &armautomation.SourceControlClientListByAutomationAccountOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjob_client.go b/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjob_client.go index cac2d24fe6c4..72d91d0dc0e5 100644 --- a/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjob_client.go +++ b/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjob_client.go @@ -186,7 +186,6 @@ func (client *SourceControlSyncJobClient) getHandleResponse(resp *http.Response) } // NewListByAutomationAccountPager - Retrieve a list of source control sync jobs. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjob_client_example_test.go b/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjob_client_example_test.go deleted file mode 100644 index 9c3491ded40f..000000000000 --- a/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjob_client_example_test.go +++ /dev/null @@ -1,96 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/sourceControlSyncJob/createSourceControlSyncJob.json -func ExampleSourceControlSyncJobClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSourceControlSyncJobClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, - "rg", - "myAutomationAccount33", - "MySourceControl", - "ce6fe3e3-9db3-4096-a6b4-82bfb4c10a9a", - armautomation.SourceControlSyncJobCreateParameters{ - Properties: &armautomation.SourceControlSyncJobCreateProperties{ - CommitID: to.Ptr("9de0980bfb45026a3d97a1b0522d98a9f604226e"), - }, - }, - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/sourceControlSyncJob/getSourceControlSyncJob.json -func ExampleSourceControlSyncJobClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSourceControlSyncJobClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "MySourceControl", - "ce6fe3e3-9db3-4096-a6b4-82bfb4c10a9a", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/sourceControlSyncJob/getAllSourceControlSyncJobs.json -func ExampleSourceControlSyncJobClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSourceControlSyncJobClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount33", - "MySourceControl", - &armautomation.SourceControlSyncJobClientListByAutomationAccountOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjobstreams_client.go b/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjobstreams_client.go index f8855bb1398d..333b7ed7990e 100644 --- a/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjobstreams_client.go +++ b/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjobstreams_client.go @@ -126,7 +126,6 @@ func (client *SourceControlSyncJobStreamsClient) getHandleResponse(resp *http.Re } // NewListBySyncJobPager - Retrieve a list of sync job streams identified by sync job id. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjobstreams_client_example_test.go b/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjobstreams_client_example_test.go deleted file mode 100644 index f323012cf671..000000000000 --- a/sdk/resourcemanager/automation/armautomation/sourcecontrolsyncjobstreams_client_example_test.go +++ /dev/null @@ -1,70 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/sourceControlSyncJobStreams/getSourceControlSyncJobStreams.json -func ExampleSourceControlSyncJobStreamsClient_NewListBySyncJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSourceControlSyncJobStreamsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySyncJobPager("rg", - "myAutomationAccount33", - "MySourceControl", - "ce6fe3e3-9db3-4096-a6b4-82bfb4c10a2b", - &armautomation.SourceControlSyncJobStreamsClientListBySyncJobOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/sourceControlSyncJobStreams/getSourceControlSyncJobStreamsByStreamId.json -func ExampleSourceControlSyncJobStreamsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewSourceControlSyncJobStreamsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "MySourceControl", - "ce6fe3e3-9db3-4096-a6b4-82bfb4c10a2b", - "b86c5c31-e9fd-4734-8764-ddd6c101e706_00636596855139029522_00000000000000000007", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/automation/armautomation/statistics_client.go b/sdk/resourcemanager/automation/armautomation/statistics_client.go index a93978ccd386..f9c8fbe18cfe 100644 --- a/sdk/resourcemanager/automation/armautomation/statistics_client.go +++ b/sdk/resourcemanager/automation/armautomation/statistics_client.go @@ -57,7 +57,6 @@ func NewStatisticsClient(subscriptionID string, credential azcore.TokenCredentia } // NewListByAutomationAccountPager - Retrieve the statistics for the account. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-06-22 // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/statistics_client_example_test.go b/sdk/resourcemanager/automation/armautomation/statistics_client_example_test.go deleted file mode 100644 index ff7550175be6..000000000000 --- a/sdk/resourcemanager/automation/armautomation/statistics_client_example_test.go +++ /dev/null @@ -1,43 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/getStatisticsOfAutomationAccount.json -func ExampleStatisticsClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewStatisticsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount11", - &armautomation.StatisticsClientListByAutomationAccountOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/testjob_client_example_test.go b/sdk/resourcemanager/automation/armautomation/testjob_client_example_test.go deleted file mode 100644 index 8134a877d0fe..000000000000 --- a/sdk/resourcemanager/automation/armautomation/testjob_client_example_test.go +++ /dev/null @@ -1,132 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/createTestJob.json -func ExampleTestJobClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewTestJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Create(ctx, - "mygroup", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - armautomation.TestJobCreateParameters{ - Parameters: map[string]*string{ - "key01": to.Ptr("value01"), - "key02": to.Ptr("value02"), - }, - RunOn: to.Ptr(""), - }, - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/getTestJob.json -func ExampleTestJobClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewTestJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "mygroup", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/resumeTestJob.json -func ExampleTestJobClient_Resume() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewTestJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Resume(ctx, - "mygroup", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/stopTestJob.json -func ExampleTestJobClient_Stop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewTestJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Stop(ctx, - "mygroup", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/suspendTestJob.json -func ExampleTestJobClient_Suspend() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewTestJobClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Suspend(ctx, - "mygroup", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/automation/armautomation/testjobstreams_client.go b/sdk/resourcemanager/automation/armautomation/testjobstreams_client.go index 4b83ee6f4dcf..cb81fdb05c13 100644 --- a/sdk/resourcemanager/automation/armautomation/testjobstreams_client.go +++ b/sdk/resourcemanager/automation/armautomation/testjobstreams_client.go @@ -123,7 +123,6 @@ func (client *TestJobStreamsClient) getHandleResponse(resp *http.Response) (Test } // NewListByTestJobPager - Retrieve a list of test job streams identified by runbook name. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2018-06-30 // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/testjobstreams_client_example_test.go b/sdk/resourcemanager/automation/armautomation/testjobstreams_client_example_test.go deleted file mode 100644 index 54b9c180c7c0..000000000000 --- a/sdk/resourcemanager/automation/armautomation/testjobstreams_client_example_test.go +++ /dev/null @@ -1,68 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/getTestJobStream.json -func ExampleTestJobStreamsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewTestJobStreamsClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "mygroup", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - "851b2101-686f-40e2-8a4b-5b8df08afbd1_00636535684910693884_00000000000000000001", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2018-06-30/examples/listTestJobStreamsByJob.json -func ExampleTestJobStreamsClient_NewListByTestJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewTestJobStreamsClient("51766542-3ed7-4a72-a187-0c8ab644ddab", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTestJobPager("mygroup", - "ContoseAutomationAccount", - "Get-AzureVMTutorial", - &armautomation.TestJobStreamsClientListByTestJobOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/usages_client.go b/sdk/resourcemanager/automation/armautomation/usages_client.go index 65053bebd3bd..8e8688e2da0b 100644 --- a/sdk/resourcemanager/automation/armautomation/usages_client.go +++ b/sdk/resourcemanager/automation/armautomation/usages_client.go @@ -57,7 +57,6 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o } // NewListByAutomationAccountPager - Retrieve the usage for the account id. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-06-22 // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/usages_client_example_test.go b/sdk/resourcemanager/automation/armautomation/usages_client_example_test.go deleted file mode 100644 index f839960ed0bb..000000000000 --- a/sdk/resourcemanager/automation/armautomation/usages_client_example_test.go +++ /dev/null @@ -1,43 +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. - -package armautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2021-06-22/examples/getUsagesOfAutomationAccount.json -func ExampleUsagesClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewUsagesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount11", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/variable_client.go b/sdk/resourcemanager/automation/armautomation/variable_client.go index 4249aeef8fa0..299d124e6a3d 100644 --- a/sdk/resourcemanager/automation/armautomation/variable_client.go +++ b/sdk/resourcemanager/automation/armautomation/variable_client.go @@ -232,7 +232,6 @@ func (client *VariableClient) getHandleResponse(resp *http.Response) (VariableCl } // NewListByAutomationAccountPager - Retrieve a list of variables. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/variable_client_example_test.go b/sdk/resourcemanager/automation/armautomation/variable_client_example_test.go deleted file mode 100644 index 4fd66c8ace67..000000000000 --- a/sdk/resourcemanager/automation/armautomation/variable_client_example_test.go +++ /dev/null @@ -1,148 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/createOrUpdateVariable.json -func ExampleVariableClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewVariableClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg", - "sampleAccount9", - "sampleVariable", - armautomation.VariableCreateOrUpdateParameters{ - Name: to.Ptr("sampleVariable"), - Properties: &armautomation.VariableCreateOrUpdateProperties{ - Description: to.Ptr("my description"), - IsEncrypted: to.Ptr(false), - Value: to.Ptr("\"ComputerName.domain.com\""), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/updateVariable_patch.json -func ExampleVariableClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewVariableClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "sampleAccount9", - "sampleVariable", - armautomation.VariableUpdateParameters{ - Name: to.Ptr("sampleVariable"), - Properties: &armautomation.VariableUpdateProperties{ - Value: to.Ptr("\"ComputerName3.domain.com\""), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteVariable.json -func ExampleVariableClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewVariableClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "sampleAccount9", - "sampleVariable", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getVariable.json -func ExampleVariableClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewVariableClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "sampleAccount9", - "sampleVariable", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listVariables_First100.json -func ExampleVariableClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewVariableClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "sampleAccount9", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/watcher_client.go b/sdk/resourcemanager/automation/armautomation/watcher_client.go index 5ab2a771280e..32817c9015be 100644 --- a/sdk/resourcemanager/automation/armautomation/watcher_client.go +++ b/sdk/resourcemanager/automation/armautomation/watcher_client.go @@ -232,7 +232,6 @@ func (client *WatcherClient) getHandleResponse(resp *http.Response) (WatcherClie } // NewListByAutomationAccountPager - Retrieve a list of watchers. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2020-01-13-preview // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/watcher_client_example_test.go b/sdk/resourcemanager/automation/armautomation/watcher_client_example_test.go deleted file mode 100644 index 9d38d1f7a2e7..000000000000 --- a/sdk/resourcemanager/automation/armautomation/watcher_client_example_test.go +++ /dev/null @@ -1,191 +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. - -package armautomation_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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/createOrUpdateWatcher.json -func ExampleWatcherClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewWatcherClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg", - "MyTestAutomationAccount", - "MyTestWatcher", - armautomation.Watcher{ - Properties: &armautomation.WatcherProperties{ - Description: to.Ptr("This is a test watcher."), - ExecutionFrequencyInSeconds: to.Ptr[int64](60), - ScriptName: to.Ptr("MyTestWatcherRunbook"), - ScriptRunOn: to.Ptr("MyTestHybridWorkerGroup"), - }, - Tags: map[string]*string{}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/getWatcher.json -func ExampleWatcherClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewWatcherClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "MyTestAutomationAccount", - "MyTestWatcher", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/updateWatcher.json -func ExampleWatcherClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewWatcherClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "MyTestAutomationAccount", - "MyTestWatcher", - armautomation.WatcherUpdateParameters{ - Name: to.Ptr("MyTestWatcher"), - Properties: &armautomation.WatcherUpdateProperties{ - ExecutionFrequencyInSeconds: to.Ptr[int64](600), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteWatcher.json -func ExampleWatcherClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewWatcherClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "MyTestAutomationAccount", - "MyTestWatcher", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/startWatcher.json -func ExampleWatcherClient_Start() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewWatcherClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Start(ctx, - "rg", - "MyTestAutomationAccount", - "MyTestWatcher", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/stopWatcher.json -func ExampleWatcherClient_Stop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewWatcherClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Stop(ctx, - "rg", - "MyTestAutomationAccount", - "MyTestWatcher", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/listWatchersByAutomationAccount.json -func ExampleWatcherClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewWatcherClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "MyTestAutomationAccount", - &armautomation.WatcherClientListByAutomationAccountOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/automation/armautomation/webhook_client.go b/sdk/resourcemanager/automation/armautomation/webhook_client.go index 9889f89bbd42..bf64947a6fe3 100644 --- a/sdk/resourcemanager/automation/armautomation/webhook_client.go +++ b/sdk/resourcemanager/automation/armautomation/webhook_client.go @@ -288,7 +288,6 @@ func (client *WebhookClient) getHandleResponse(resp *http.Response) (WebhookClie } // NewListByAutomationAccountPager - Retrieve a list of webhooks. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2015-10-31 // resourceGroupName - Name of an Azure Resource group. // automationAccountName - The name of the automation account. diff --git a/sdk/resourcemanager/automation/armautomation/webhook_client_example_test.go b/sdk/resourcemanager/automation/armautomation/webhook_client_example_test.go deleted file mode 100644 index 8f1321988266..000000000000 --- a/sdk/resourcemanager/automation/armautomation/webhook_client_example_test.go +++ /dev/null @@ -1,154 +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. - -package armautomation_test - -import ( - "context" - "log" - - "time" - - "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/automation/armautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/deleteWebhook.json -func ExampleWebhookClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewWebhookClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg", - "myAutomationAccount33", - "TestWebhook", - 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/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/getWebhook.json -func ExampleWebhookClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewWebhookClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg", - "myAutomationAccount33", - "TestWebhook", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/createOrUpdateWebhook.json -func ExampleWebhookClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewWebhookClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg", - "myAutomationAccount33", - "TestWebhook", - armautomation.WebhookCreateOrUpdateParameters{ - Name: to.Ptr("TestWebhook"), - Properties: &armautomation.WebhookCreateOrUpdateProperties{ - ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-29T22:18:13.7002872Z"); return t }()), - IsEnabled: to.Ptr(true), - Runbook: &armautomation.RunbookAssociationProperty{ - Name: to.Ptr("TestRunbook"), - }, - URI: to.Ptr(""), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/updateWebhook.json -func ExampleWebhookClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewWebhookClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg", - "myAutomationAccount33", - "TestWebhook", - armautomation.WebhookUpdateParameters{ - Name: to.Ptr("TestWebhook"), - Properties: &armautomation.WebhookUpdateProperties{ - Description: to.Ptr("updated webhook"), - IsEnabled: to.Ptr(false), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/listWebhooksByAutomationAccount.json -func ExampleWebhookClient_NewListByAutomationAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armautomation.NewWebhookClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAutomationAccountPager("rg", - "myAutomationAccount33", - &armautomation.WebhookClientListByAutomationAccountOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -}