From a6bf0ff4553b77344688b9eae679eec70d0e17d1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 14 Nov 2024 13:12:26 +0000 Subject: [PATCH] CodeGen from PR 31541 in Azure/azure-rest-api-specs Merge 3a2b1f8e1fec5c1d8c5af5f8de21b0b5c9708f6b into b755f17708315a4941a3e9a9d6320ce3bf173eef --- .../armcomputeschedule/CHANGELOG.md | 15 + .../armcomputeschedule/autorest.md | 7 +- .../armcomputeschedule/constants.go | 4 +- .../computeschedule/armcomputeschedule/go.mod | 12 +- .../computeschedule/armcomputeschedule/go.sum | 17 - .../armcomputeschedule/models.go | 66 +- .../armcomputeschedule/models_serde.go | 34 +- .../armcomputeschedule/operations_client.go | 4 +- .../operations_client_example_test.go | 85 -- .../scheduledactions_client.go | 36 +- .../scheduledactions_client_example_test.go | 852 ------------------ 11 files changed, 91 insertions(+), 1041 deletions(-) delete mode 100644 sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client_example_test.go diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/CHANGELOG.md b/sdk/resourcemanager/computeschedule/armcomputeschedule/CHANGELOG.md index 0540d5931124..cd8f7298b4a3 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/CHANGELOG.md +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/CHANGELOG.md @@ -1,5 +1,20 @@ # Release History +## 1.0.0 (2024-11-14) +### Breaking Changes + +- Type of `OperationErrorDetails.ErrorDetails` has been changed from `*time.Time` to `*string` +- Field `CrpOperationID`, `TimeStamp` of struct `OperationErrorDetails` has been removed +- Field `TimeZone` of struct `ResourceOperationDetails` has been removed +- Field `DeadLine`, `TimeZone` of struct `Schedule` has been removed + +### Features Added + +- New field `AzureOperationID`, `Timestamp` in struct `OperationErrorDetails` +- New field `Timezone` in struct `ResourceOperationDetails` +- New field `Deadline`, `Timezone` in struct `Schedule` + + ## 0.1.0 (2024-09-27) ### Other Changes diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/autorest.md b/sdk/resourcemanager/computeschedule/armcomputeschedule/autorest.md index e944348282d9..ae6633d35cf4 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/autorest.md +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/computeschedule/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/computeschedule/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.0 -tag: package-2024-08-15-preview +module-version: 1.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/constants.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/constants.go index 1fb518798fba..373c327a661b 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/constants.go +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/constants.go @@ -10,7 +10,7 @@ package armcomputeschedule const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computeschedule/armcomputeschedule" - moduleVersion = "v0.1.0" + moduleVersion = "v1.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -54,7 +54,7 @@ type OperationState string const ( // OperationStateBlocked - Operations that are blocked OperationStateBlocked OperationState = "Blocked" - // OperationStateCancelled - Operations that have been cancelled by the user + // OperationStateCancelled - Operations that have been Cancelled by the user OperationStateCancelled OperationState = "Cancelled" // OperationStateExecuting - Operations that are in the process of being executed OperationStateExecuting OperationState = "Executing" diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/go.mod b/sdk/resourcemanager/computeschedule/armcomputeschedule/go.mod index 453bd0a6a43a..30211c801d67 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/go.mod +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computeschedule/arm go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.24.0 // indirect golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/go.sum b/sdk/resourcemanager/computeschedule/armcomputeschedule/go.sum index b33184a7575b..875dd857a1bd 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/go.sum +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 h1:jBQA3cKT4L2rWMpgE7Yt3Hwh2aUj8KXjIGLxjHeYNNo= github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0/go.mod h1:4OG6tQ9EOP/MT0NMjDlRzWoVFxfu9rN9B2X+tlSVktg= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/models.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/models.go index ffe9dcefc02a..1d69ca460054 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/models.go +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/models.go @@ -12,7 +12,7 @@ import "time" // CancelOperationsRequest - This is the request to cancel running operations in scheduled actions using the operation ids type CancelOperationsRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The list of operation ids to cancel operations on @@ -42,7 +42,7 @@ type DeallocateResourceOperationResponse struct { // ExecuteDeallocateRequest - The ExecuteDeallocateRequest request for executeDeallocate operations type ExecuteDeallocateRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The execution parameters for the request @@ -54,7 +54,7 @@ type ExecuteDeallocateRequest struct { // ExecuteHibernateRequest - The ExecuteHibernateRequest request for executeHibernate operations type ExecuteHibernateRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The execution parameters for the request @@ -66,7 +66,7 @@ type ExecuteHibernateRequest struct { // ExecuteStartRequest - The ExecuteStartRequest request for executeStart operations type ExecuteStartRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The execution parameters for the request @@ -99,7 +99,7 @@ type GetOperationErrorsResponse struct { // GetOperationStatusRequest - This is the request to get operation status using operationids type GetOperationStatusRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The list of operation ids to get the status of @@ -168,17 +168,17 @@ type OperationDisplay struct { // OperationErrorDetails - This defines a list of operation errors associated with a unique operationId type OperationErrorDetails struct { - // REQUIRED; CRP operationid of the operation for deeper analysis - CrpOperationID *string - // REQUIRED; The error code of the operation ErrorCode *string // REQUIRED; The error details of the operation - ErrorDetails *time.Time + ErrorDetails *string - // REQUIRED; The timestamp of the error occurence - TimeStamp *time.Time + // The compute operationid of the Start/Deallocate/Hibernate request + AzureOperationID *string + + // The timestamp of the error occurence + Timestamp *time.Time } // OperationErrorsResult - This is the first level of operation errors from the request when clients get errors per vm operation @@ -232,38 +232,38 @@ type ResourceOperation struct { // ResourceOperationDetails - The details of a response from an operation on a resource type ResourceOperationDetails struct { - // REQUIRED; Deadline for the operation + // REQUIRED; Operation identifier for the unique operation + OperationID *string + + // Time the operation was complete if errors are null + CompletedAt *time.Time + + // Deadline for the operation Deadline *time.Time - // REQUIRED; Type of deadline of the operation + // Type of deadline of the operation DeadlineType *DeadlineType - // REQUIRED; Type of operation performed on the resources + // Type of operation performed on the resources OpType *ResourceOperationType - // REQUIRED; Operation identifier for the unique operation - OperationID *string - - // REQUIRED; Unique identifier for the resource involved in the operation, eg ArmId + // Unique identifier for the resource involved in the operation, eg ArmId ResourceID *string - // REQUIRED; Current state of the operation - State *OperationState - - // REQUIRED; Subscription id attached to the request - SubscriptionID *string - - // Time the operation was complete if errors are null - CompletedAt *time.Time - // Operation level errors if they exist ResourceOperationError *ResourceOperationError // Retry policy the user can pass RetryPolicy *RetryPolicy + // Current state of the operation + State *OperationState + + // Subscription id attached to the request + SubscriptionID *string + // Timezone for the operation - TimeZone *string + Timezone *string } // ResourceOperationError - These describe errors that occur at the resource level @@ -293,13 +293,13 @@ type RetryPolicy struct { // Schedule - The schedule details for the user request type Schedule struct { // REQUIRED; The deadline for the operation - DeadLine *time.Time + Deadline *time.Time // REQUIRED; The deadlinetype of the operation, this can either be InitiateAt or CompleteBy DeadlineType *DeadlineType // REQUIRED; The timezone for the operation - TimeZone *string + Timezone *string } // StartResourceOperationResponse - The response from a start request @@ -319,7 +319,7 @@ type StartResourceOperationResponse struct { // SubmitDeallocateRequest - The deallocate request for resources type SubmitDeallocateRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The execution parameters for the request @@ -334,7 +334,7 @@ type SubmitDeallocateRequest struct { // SubmitHibernateRequest - This is the request for hibernate type SubmitHibernateRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The execution parameters for the request @@ -349,7 +349,7 @@ type SubmitHibernateRequest struct { // SubmitStartRequest - This is the request for start type SubmitStartRequest struct { - // REQUIRED; Correlationid item + // REQUIRED; CorrelationId item Correlationid *string // REQUIRED; The execution parameters for the request diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/models_serde.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/models_serde.go index c55c4955f270..62c71e75afcf 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/models_serde.go +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/models_serde.go @@ -484,10 +484,10 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationErrorDetails. func (o OperationErrorDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "crpOperationId", o.CrpOperationID) + populate(objectMap, "azureOperationId", o.AzureOperationID) populate(objectMap, "errorCode", o.ErrorCode) - populateDateTimeRFC3339(objectMap, "errorDetails", o.ErrorDetails) - populateDateTimeRFC3339(objectMap, "timeStamp", o.TimeStamp) + populate(objectMap, "errorDetails", o.ErrorDetails) + populateDateTimeRFC3339(objectMap, "timestamp", o.Timestamp) return json.Marshal(objectMap) } @@ -500,17 +500,17 @@ func (o *OperationErrorDetails) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "crpOperationId": - err = unpopulate(val, "CrpOperationID", &o.CrpOperationID) + case "azureOperationId": + err = unpopulate(val, "AzureOperationID", &o.AzureOperationID) delete(rawMsg, key) case "errorCode": err = unpopulate(val, "ErrorCode", &o.ErrorCode) delete(rawMsg, key) case "errorDetails": - err = unpopulateDateTimeRFC3339(val, "ErrorDetails", &o.ErrorDetails) + err = unpopulate(val, "ErrorDetails", &o.ErrorDetails) delete(rawMsg, key) - case "timeStamp": - err = unpopulateDateTimeRFC3339(val, "TimeStamp", &o.TimeStamp) + case "timestamp": + err = unpopulateDateTimeRFC3339(val, "Timestamp", &o.Timestamp) delete(rawMsg, key) } if err != nil { @@ -654,7 +654,7 @@ func (r ResourceOperationDetails) MarshalJSON() ([]byte, error) { populate(objectMap, "retryPolicy", r.RetryPolicy) populate(objectMap, "state", r.State) populate(objectMap, "subscriptionId", r.SubscriptionID) - populate(objectMap, "timeZone", r.TimeZone) + populate(objectMap, "timezone", r.Timezone) return json.Marshal(objectMap) } @@ -697,8 +697,8 @@ func (r *ResourceOperationDetails) UnmarshalJSON(data []byte) error { case "subscriptionId": err = unpopulate(val, "SubscriptionID", &r.SubscriptionID) delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &r.TimeZone) + case "timezone": + err = unpopulate(val, "Timezone", &r.Timezone) delete(rawMsg, key) } if err != nil { @@ -800,9 +800,9 @@ func (r *RetryPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Schedule. func (s Schedule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "deadLine", s.DeadLine) + populateDateTimeRFC3339(objectMap, "deadline", s.Deadline) populate(objectMap, "deadlineType", s.DeadlineType) - populate(objectMap, "timeZone", s.TimeZone) + populate(objectMap, "timezone", s.Timezone) return json.Marshal(objectMap) } @@ -815,14 +815,14 @@ func (s *Schedule) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "deadLine": - err = unpopulateDateTimeRFC3339(val, "DeadLine", &s.DeadLine) + case "deadline": + err = unpopulateDateTimeRFC3339(val, "Deadline", &s.Deadline) delete(rawMsg, key) case "deadlineType": err = unpopulate(val, "DeadlineType", &s.DeadlineType) delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &s.TimeZone) + case "timezone": + err = unpopulate(val, "Timezone", &s.Timezone) delete(rawMsg, key) } if err != nil { diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client.go index eb20a5fc8271..90c8dbfcfb1b 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client.go +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client_example_test.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client_example_test.go deleted file mode 100644 index 57bacbc6ea56..000000000000 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/operations_client_example_test.go +++ /dev/null @@ -1,85 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcomputeschedule_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computeschedule/armcomputeschedule" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaxGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armcomputeschedule.OperationListResult{ - // Value: []*armcomputeschedule.Operation{ - // { - // Name: to.Ptr("ennucrkvxylbsli"), - // ActionType: to.Ptr(armcomputeschedule.ActionTypeInternal), - // Display: &armcomputeschedule.OperationDisplay{ - // Description: to.Ptr("tsqbr"), - // Operation: to.Ptr("sjldnlycokfcufegoktphlwpvxkx"), - // Provider: to.Ptr("brssqjspiggui"), - // Resource: to.Ptr("aujpznmlzjgsyynq"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armcomputeschedule.OriginUser), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/Operations_List_MinimumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaxGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armcomputeschedule.OperationListResult{ - // } - } -} diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client.go index 8e18116fac53..158ee1f6f569 100644 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client.go +++ b/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client.go @@ -46,7 +46,7 @@ func NewScheduledActionsClient(subscriptionID string, credential azcore.TokenCre // VirtualMachinesCancelOperations - virtualMachinesCancelOperations: cancelOperations for a virtual machine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesCancelOperationsOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesCancelOperations @@ -89,7 +89,7 @@ func (client *ScheduledActionsClient) virtualMachinesCancelOperationsCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -110,7 +110,7 @@ func (client *ScheduledActionsClient) virtualMachinesCancelOperationsHandleRespo // VirtualMachinesExecuteDeallocate - virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesExecuteDeallocateOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesExecuteDeallocate @@ -153,7 +153,7 @@ func (client *ScheduledActionsClient) virtualMachinesExecuteDeallocateCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -174,7 +174,7 @@ func (client *ScheduledActionsClient) virtualMachinesExecuteDeallocateHandleResp // VirtualMachinesExecuteHibernate - virtualMachinesExecuteHibernate: executeHibernate for a virtual machine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesExecuteHibernateOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesExecuteHibernate @@ -217,7 +217,7 @@ func (client *ScheduledActionsClient) virtualMachinesExecuteHibernateCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -238,7 +238,7 @@ func (client *ScheduledActionsClient) virtualMachinesExecuteHibernateHandleRespo // VirtualMachinesExecuteStart - virtualMachinesExecuteStart: executeStart for a virtual machine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesExecuteStartOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesExecuteStart @@ -281,7 +281,7 @@ func (client *ScheduledActionsClient) virtualMachinesExecuteStartCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -303,7 +303,7 @@ func (client *ScheduledActionsClient) virtualMachinesExecuteStartHandleResponse( // on a virtual machine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesGetOperationErrorsOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesGetOperationErrors @@ -346,7 +346,7 @@ func (client *ScheduledActionsClient) virtualMachinesGetOperationErrorsCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -367,7 +367,7 @@ func (client *ScheduledActionsClient) virtualMachinesGetOperationErrorsHandleRes // VirtualMachinesGetOperationStatus - virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesGetOperationStatusOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesGetOperationStatus @@ -410,7 +410,7 @@ func (client *ScheduledActionsClient) virtualMachinesGetOperationStatusCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -431,7 +431,7 @@ func (client *ScheduledActionsClient) virtualMachinesGetOperationStatusHandleRes // VirtualMachinesSubmitDeallocate - virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesSubmitDeallocateOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesSubmitDeallocate @@ -474,7 +474,7 @@ func (client *ScheduledActionsClient) virtualMachinesSubmitDeallocateCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -495,7 +495,7 @@ func (client *ScheduledActionsClient) virtualMachinesSubmitDeallocateHandleRespo // VirtualMachinesSubmitHibernate - virtualMachinesSubmitHibernate: submitHibernate for a virtual machine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesSubmitHibernateOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesSubmitHibernate @@ -538,7 +538,7 @@ func (client *ScheduledActionsClient) virtualMachinesSubmitHibernateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { @@ -559,7 +559,7 @@ func (client *ScheduledActionsClient) virtualMachinesSubmitHibernateHandleRespon // VirtualMachinesSubmitStart - virtualMachinesSubmitStart: submitStart for a virtual machine // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-15-preview +// Generated from API version 2024-10-01 // - locationparameter - The location name. // - requestBody - The request body // - options - ScheduledActionsClientVirtualMachinesSubmitStartOptions contains the optional parameters for the ScheduledActionsClient.VirtualMachinesSubmitStart @@ -602,7 +602,7 @@ func (client *ScheduledActionsClient) virtualMachinesSubmitStartCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-15-preview") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, requestBody); err != nil { diff --git a/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client_example_test.go b/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client_example_test.go deleted file mode 100644 index 4cc4adc82b15..000000000000 --- a/sdk/resourcemanager/computeschedule/armcomputeschedule/scheduledactions_client_example_test.go +++ /dev/null @@ -1,852 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armcomputeschedule_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/computeschedule/armcomputeschedule" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesCancelOperations_scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesCancelOperations(ctx, "tdxypnse", armcomputeschedule.CancelOperationsRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3c1"), - OperationIDs: []*string{ - to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CancelOperationsResponse = armcomputeschedule.CancelOperationsResponse{ - // Results: []*armcomputeschedule.ResourceOperation{ - // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), - // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource1"), - // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), - // }, - // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), - // RetryWindowInMinutes: to.Ptr[int32](27), - // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), - // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource1"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesCancelOperations_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesCancelOperations_scheduledActionsVirtualMachinesCancelOperationsGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesCancelOperations(ctx, "lwapkjsbltcqp", armcomputeschedule.CancelOperationsRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3c1"), - OperationIDs: []*string{ - to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34r")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CancelOperationsResponse = armcomputeschedule.CancelOperationsResponse{ - // Results: []*armcomputeschedule.ResourceOperation{ - // { - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesExecuteDeallocate_scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteDeallocate(ctx, "mklyzgztbivwzo", armcomputeschedule.ExecuteDeallocateRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eddf1f3c1"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{ - OptimizationPreference: to.Ptr(armcomputeschedule.OptimizationPreferenceCost), - RetryPolicy: &armcomputeschedule.RetryPolicy{ - RetryCount: to.Ptr[int32](30), - RetryWindowInMinutes: to.Ptr[int32](27), - }, - }, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeallocateResourceOperationResponse = armcomputeschedule.DeallocateResourceOperationResponse{ - // Type: to.Ptr("eokrhxypminzcgplibblmwojvjd"), - // Description: to.Ptr("ndhb"), - // Location: to.Ptr("qbbvrdisvjgxirnzdvdsodkt"), - // Results: []*armcomputeschedule.ResourceOperation{ - // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), - // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2"), - // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), - // }, - // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), - // RetryWindowInMinutes: to.Ptr[int32](27), - // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), - // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesExecuteDeallocate_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesExecuteDeallocate_scheduledActionsVirtualMachinesExecuteDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteDeallocate(ctx, "irbtacrhjgfpyvhvjo", armcomputeschedule.ExecuteDeallocateRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eddf1f3c1"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{}, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeallocateResourceOperationResponse = armcomputeschedule.DeallocateResourceOperationResponse{ - // Type: to.Ptr("eokrhxypminzcgplibblmwojvjd"), - // Description: to.Ptr("ndhb"), - // Location: to.Ptr("qbbvrdisvjgxirnzdvdsodkt"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesExecuteHibernate_scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteHibernate(ctx, "sejdmamuhhvfpljomwumsplc", armcomputeschedule.ExecuteHibernateRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3c1"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{ - OptimizationPreference: to.Ptr(armcomputeschedule.OptimizationPreferenceCost), - RetryPolicy: &armcomputeschedule.RetryPolicy{ - RetryCount: to.Ptr[int32](30), - RetryWindowInMinutes: to.Ptr[int32](27), - }, - }, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HibernateResourceOperationResponse = armcomputeschedule.HibernateResourceOperationResponse{ - // Type: to.Ptr("mkmgbfpkiudefzhdppgjmqztx"), - // Description: to.Ptr("wbxeejgkmtwtkcsepidgox"), - // Location: to.Ptr("rvlnzczpesuvusbmbcjctzcinzlr"), - // Results: []*armcomputeschedule.ResourceOperation{ - // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), - // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), - // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), - // }, - // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), - // RetryWindowInMinutes: to.Ptr[int32](27), - // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), - // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesExecuteHibernate_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesExecuteHibernate_scheduledActionsVirtualMachinesExecuteHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteHibernate(ctx, "kga", armcomputeschedule.ExecuteHibernateRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3c1"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{}, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HibernateResourceOperationResponse = armcomputeschedule.HibernateResourceOperationResponse{ - // Type: to.Ptr("mkmgbfpkiudefzhdppgjmqztx"), - // Description: to.Ptr("wbxeejgkmtwtkcsepidgox"), - // Location: to.Ptr("rvlnzczpesuvusbmbcjctzcinzlr"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesExecuteStart_scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteStart(ctx, "ysfrwcfmfsh", armcomputeschedule.ExecuteStartRequest{ - Correlationid: to.Ptr("23230d2f-1dca-4610-afb4-dd25eec1f34"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{ - OptimizationPreference: to.Ptr(armcomputeschedule.OptimizationPreferenceCost), - RetryPolicy: &armcomputeschedule.RetryPolicy{ - RetryCount: to.Ptr[int32](30), - RetryWindowInMinutes: to.Ptr[int32](27), - }, - }, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StartResourceOperationResponse = armcomputeschedule.StartResourceOperationResponse{ - // Type: to.Ptr("gxmnjtgu"), - // Description: to.Ptr("raacd"), - // Location: to.Ptr("uvlidhowwv"), - // Results: []*armcomputeschedule.ResourceOperation{ - // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), - // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4"), - // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), - // }, - // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), - // RetryWindowInMinutes: to.Ptr[int32](27), - // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), - // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesExecuteStart_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesExecuteStart_scheduledActionsVirtualMachinesExecuteStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesExecuteStart(ctx, "qegbgjculewswqvnmaclcgpqqidl", armcomputeschedule.ExecuteStartRequest{ - Correlationid: to.Ptr("23230d2f-1dca-4610-afb4-dd25eec1f34"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{}, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StartResourceOperationResponse = armcomputeschedule.StartResourceOperationResponse{ - // Type: to.Ptr("gxmnjtgu"), - // Description: to.Ptr("raacd"), - // Location: to.Ptr("uvlidhowwv"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesGetOperationErrors_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesGetOperationErrors_csScheduledActionsVirtualMachinesGetOperationErrorsMax() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesGetOperationErrors(ctx, "hfsa", armcomputeschedule.GetOperationErrorsRequest{ - OperationIDs: []*string{ - to.Ptr("DE84A209-5715-43E7-BC76-3E208A9A323")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GetOperationErrorsResponse = armcomputeschedule.GetOperationErrorsResponse{ - // Results: []*armcomputeschedule.OperationErrorsResult{ - // { - // OperationID: to.Ptr("DE84A209-5715-43E7-BC76-3E208A9A323"), - // ActivationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:14.771Z"); return t}()), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:14.771Z"); return t}()), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:14.771Z"); return t}()), - // OperationErrors: []*armcomputeschedule.OperationErrorDetails{ - // { - // CrpOperationID: to.Ptr("DE84A209-5715-43E7-BC76-3E208A9A32C5"), - // ErrorCode: to.Ptr("nr"), - // ErrorDetails: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:14.771Z"); return t}()), - // TimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:14.771Z"); return t}()), - // }}, - // RequestErrorCode: to.Ptr("hyfvxj"), - // RequestErrorDetails: to.Ptr("heqpzxzbtrimbxalapqypezeflkyo"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesGetOperationErrors_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesGetOperationErrors_csScheduledActionsVirtualMachinesGetOperationErrorsMin() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesGetOperationErrors(ctx, "ggxoaxzxtdbi", armcomputeschedule.GetOperationErrorsRequest{ - OperationIDs: []*string{ - to.Ptr("qeicik")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GetOperationErrorsResponse = armcomputeschedule.GetOperationErrorsResponse{ - // Results: []*armcomputeschedule.OperationErrorsResult{ - // { - // OperationID: to.Ptr("wetjrhx"), - // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:14.771Z"); return t}()), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesGetOperationStatus_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesGetOperationStatus_scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesGetOperationStatus(ctx, "csay", armcomputeschedule.GetOperationStatusRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3c1"), - OperationIDs: []*string{ - to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3df")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GetOperationStatusResponse = armcomputeschedule.GetOperationStatusResponse{ - // Results: []*armcomputeschedule.ResourceOperation{ - // { - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesGetOperationStatus_scheduledActionsVirtualMachinesGetOperationStatusGeneratedByMinimumSetRuleGeneratedByMaximumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesGetOperationStatus(ctx, "htxxasfxaesuecem", armcomputeschedule.GetOperationStatusRequest{ - Correlationid: to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3c1"), - OperationIDs: []*string{ - to.Ptr("01080d2f-1dca-4610-afb4-dd25eec1f3df")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GetOperationStatusResponse = armcomputeschedule.GetOperationStatusResponse{ - // Results: []*armcomputeschedule.ResourceOperation{ - // { - // ErrorCode: to.Ptr("ipyvwgk"), - // ErrorDetails: to.Ptr("dfegatwcb"), - // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("brvr"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:13.928Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-08-08T19:00:13.928Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), - // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("ryxlbd"), - // ErrorDetails: to.Ptr("vdwoj"), - // }, - // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](5), - // RetryWindowInMinutes: to.Ptr[int32](17), - // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("l"), - // TimeZone: to.Ptr("ggsopagtvrtsjltyyccqgufgm"), - // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesSubmitDeallocate_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesSubmitDeallocate_scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitDeallocate(ctx, "ibfxsvilwrgqttuslbduzdtxcckdet", armcomputeschedule.SubmitDeallocateRequest{ - Correlationid: to.Ptr("23519o2f-1dca-4610-afb4-dd25eec1f34"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{ - OptimizationPreference: to.Ptr(armcomputeschedule.OptimizationPreferenceCost), - RetryPolicy: &armcomputeschedule.RetryPolicy{ - RetryCount: to.Ptr[int32](30), - RetryWindowInMinutes: to.Ptr[int32](27), - }, - }, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2")}, - }, - Schedule: &armcomputeschedule.Schedule{ - DeadLine: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:53.361Z"); return t }()), - DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - TimeZone: to.Ptr("zlcujrtgxtgyik"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeallocateResourceOperationResponse = armcomputeschedule.DeallocateResourceOperationResponse{ - // Type: to.Ptr("eokrhxypminzcgplibblmwojvjd"), - // Description: to.Ptr("ndhb"), - // Location: to.Ptr("qbbvrdisvjgxirnzdvdsodkt"), - // Results: []*armcomputeschedule.ResourceOperation{ - // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), - // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2"), - // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), - // }, - // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), - // RetryWindowInMinutes: to.Ptr[int32](27), - // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), - // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesSubmitDeallocate_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesSubmitDeallocate_scheduledActionsVirtualMachinesSubmitDeallocateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitDeallocate(ctx, "qwfcdtmshnlownbkyh", armcomputeschedule.SubmitDeallocateRequest{ - Correlationid: to.Ptr("23519o2f-1dca-4610-afb4-dd25eec1f34"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{}, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource2")}, - }, - Schedule: &armcomputeschedule.Schedule{ - DeadLine: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:53.361Z"); return t }()), - DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - TimeZone: to.Ptr("zlcujrtgxtgyik"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeallocateResourceOperationResponse = armcomputeschedule.DeallocateResourceOperationResponse{ - // Type: to.Ptr("eokrhxypminzcgplibblmwojvjd"), - // Description: to.Ptr("ndhb"), - // Location: to.Ptr("qbbvrdisvjgxirnzdvdsodkt"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesSubmitHibernate_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesSubmitHibernate_scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitHibernate(ctx, "bgxeayimbxqzev", armcomputeschedule.SubmitHibernateRequest{ - Correlationid: to.Ptr("23519o2f-1dca-4610-afb4-dd25eec1f34"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{ - OptimizationPreference: to.Ptr(armcomputeschedule.OptimizationPreferenceCost), - RetryPolicy: &armcomputeschedule.RetryPolicy{ - RetryCount: to.Ptr[int32](30), - RetryWindowInMinutes: to.Ptr[int32](27), - }, - }, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3")}, - }, - Schedule: &armcomputeschedule.Schedule{ - DeadLine: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:53.361Z"); return t }()), - DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - TimeZone: to.Ptr("zlcujrtgxtgyik"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HibernateResourceOperationResponse = armcomputeschedule.HibernateResourceOperationResponse{ - // Type: to.Ptr("mkmgbfpkiudefzhdppgjmqztx"), - // Description: to.Ptr("wbxeejgkmtwtkcsepidgox"), - // Location: to.Ptr("rvlnzczpesuvusbmbcjctzcinzlr"), - // Results: []*armcomputeschedule.ResourceOperation{ - // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), - // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), - // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), - // }, - // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), - // RetryWindowInMinutes: to.Ptr[int32](27), - // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), - // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesSubmitHibernate_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesSubmitHibernate_scheduledActionsVirtualMachinesSubmitHibernateGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitHibernate(ctx, "fvjciwudfbndlqumcgqs", armcomputeschedule.SubmitHibernateRequest{ - Correlationid: to.Ptr("23519o2f-1dca-4610-afb4-dd25eec1f34"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{}, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3")}, - }, - Schedule: &armcomputeschedule.Schedule{ - DeadLine: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:53.361Z"); return t }()), - DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - TimeZone: to.Ptr("zlcujrtgxtgyik"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HibernateResourceOperationResponse = armcomputeschedule.HibernateResourceOperationResponse{ - // Type: to.Ptr("mkmgbfpkiudefzhdppgjmqztx"), - // Description: to.Ptr("wbxeejgkmtwtkcsepidgox"), - // Location: to.Ptr("rvlnzczpesuvusbmbcjctzcinzlr"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesSubmitStart_MaximumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesSubmitStart_scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitStart(ctx, "fxiidszhrokwjmewlahfqjiocnes", armcomputeschedule.SubmitStartRequest{ - Correlationid: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{ - OptimizationPreference: to.Ptr(armcomputeschedule.OptimizationPreferenceCost), - RetryPolicy: &armcomputeschedule.RetryPolicy{ - RetryCount: to.Ptr[int32](30), - RetryWindowInMinutes: to.Ptr[int32](27), - }, - }, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4")}, - }, - Schedule: &armcomputeschedule.Schedule{ - DeadLine: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:53.361Z"); return t }()), - DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - TimeZone: to.Ptr("zlcujrtgxtgyik"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StartResourceOperationResponse = armcomputeschedule.StartResourceOperationResponse{ - // Type: to.Ptr("gxmnjtgu"), - // Description: to.Ptr("raacd"), - // Location: to.Ptr("uvlidhowwv"), - // Results: []*armcomputeschedule.ResourceOperation{ - // { - // ErrorCode: to.Ptr("pliurpaykwv"), - // ErrorDetails: to.Ptr("mbqwkpxl"), - // Operation: &armcomputeschedule.ResourceOperationDetails{ - // OperationID: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - // CompletedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // Deadline: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:52.974Z"); return t}()), - // DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - // OpType: to.Ptr(armcomputeschedule.ResourceOperationTypeUnknown), - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4"), - // ResourceOperationError: &armcomputeschedule.ResourceOperationError{ - // ErrorCode: to.Ptr("fticyqukvkillwd"), - // ErrorDetails: to.Ptr("yimgxqrkp"), - // }, - // RetryPolicy: &armcomputeschedule.RetryPolicy{ - // RetryCount: to.Ptr[int32](30), - // RetryWindowInMinutes: to.Ptr[int32](27), - // }, - // State: to.Ptr(armcomputeschedule.OperationStateUnknown), - // SubscriptionID: to.Ptr("52C81249-550F-459E-9B6E-5BAB6EE62227"), - // TimeZone: to.Ptr("lsoalxijilbrqum"), - // }, - // ResourceID: to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a287afb3721dee0d88f11502ec123470bc52a28/specification/computeschedule/resource-manager/Microsoft.ComputeSchedule/preview/2024-08-15-preview/examples/ScheduledActions_VirtualMachinesSubmitStart_MinimumSet_Gen.json -func ExampleScheduledActionsClient_VirtualMachinesSubmitStart_scheduledActionsVirtualMachinesSubmitStartGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcomputeschedule.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScheduledActionsClient().VirtualMachinesSubmitStart(ctx, "httzei", armcomputeschedule.SubmitStartRequest{ - Correlationid: to.Ptr("23480d2f-1dca-4610-afb4-dd25eec1f34"), - ExecutionParameters: &armcomputeschedule.ExecutionParameters{}, - Resources: &armcomputeschedule.Resources{ - IDs: []*string{ - to.Ptr("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource4")}, - }, - Schedule: &armcomputeschedule.Schedule{ - DeadLine: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-12T18:06:53.361Z"); return t }()), - DeadlineType: to.Ptr(armcomputeschedule.DeadlineTypeUnknown), - TimeZone: to.Ptr("zlcujrtgxtgyik"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StartResourceOperationResponse = armcomputeschedule.StartResourceOperationResponse{ - // Type: to.Ptr("gxmnjtgu"), - // Description: to.Ptr("raacd"), - // Location: to.Ptr("uvlidhowwv"), - // } -}