diff --git a/sdk/resourcemanager/storageactions/armstorageactions/CHANGELOG.md b/sdk/resourcemanager/storageactions/armstorageactions/CHANGELOG.md index 78e70297904c..6554d25983f7 100644 --- a/sdk/resourcemanager/storageactions/armstorageactions/CHANGELOG.md +++ b/sdk/resourcemanager/storageactions/armstorageactions/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.0 (2024-05-08) +### Other Changes + + ## 0.1.0 (2024-03-08) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/armstorageactions` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html). diff --git a/sdk/resourcemanager/storageactions/armstorageactions/autorest.md b/sdk/resourcemanager/storageactions/armstorageactions/autorest.md index d3c7dd4440b3..bc9fbf672d06 100644 --- a/sdk/resourcemanager/storageactions/armstorageactions/autorest.md +++ b/sdk/resourcemanager/storageactions/armstorageactions/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/storageactions/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/storageactions/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.0 -tag: package-2023-01-01 +module-version: 1.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/storageactions/armstorageactions/constants.go b/sdk/resourcemanager/storageactions/armstorageactions/constants.go index f12590c7d52a..0dc2a6375ee4 100644 --- a/sdk/resourcemanager/storageactions/armstorageactions/constants.go +++ b/sdk/resourcemanager/storageactions/armstorageactions/constants.go @@ -10,7 +10,7 @@ package armstorageactions const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/armstorageactions" - moduleVersion = "v0.1.0" + moduleVersion = "v1.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/storageactions/armstorageactions/go.mod b/sdk/resourcemanager/storageactions/armstorageactions/go.mod index 869d53fc1ef5..ac783639614d 100644 --- a/sdk/resourcemanager/storageactions/armstorageactions/go.mod +++ b/sdk/resourcemanager/storageactions/armstorageactions/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/arms go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.22.0 // indirect golang.org/x/net v0.24.0 // indirect - golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect ) diff --git a/sdk/resourcemanager/storageactions/armstorageactions/go.sum b/sdk/resourcemanager/storageactions/armstorageactions/go.sum index 453385ef9f88..ffdff03203f8 100644 --- a/sdk/resourcemanager/storageactions/armstorageactions/go.sum +++ b/sdk/resourcemanager/storageactions/armstorageactions/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 h1:E+OJmp2tPvt1W+amx48v1eqbjDYsgN+RzP4q16yV5eM= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1/go.mod h1:a6xsAQUZg+VsS3TJ05SRp524Hs4pZ/AeFSr5ENf0Yjo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 h1:FDif4R1+UUR+00q6wquyX90K7A8dN+R5E8GEadoP7sU= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2/go.mod h1:aiYBYui4BJ/BJCAIKs92XiPyQfTaBWqvHujDwKb6CBU= github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 h1:rTfKOCZGy5ViVrlA74ZPE99a+SgoEE2K/yg3RyW9dFA= github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0/go.mod h1:4OG6tQ9EOP/MT0NMjDlRzWoVFxfu9rN9B2X+tlSVktg= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/storageactions/armstorageactions/models.go b/sdk/resourcemanager/storageactions/armstorageactions/models.go index c71b6fb8b33f..143d32a56393 100644 --- a/sdk/resourcemanager/storageactions/armstorageactions/models.go +++ b/sdk/resourcemanager/storageactions/armstorageactions/models.go @@ -18,7 +18,8 @@ type ElseCondition struct { // IfCondition - The if block of storage task operation type IfCondition struct { - // REQUIRED; The condition predicate which is composed of object properties, eg: blob and container properties. + // REQUIRED; Condition predicate to evaluate each object. See https://aka.ms/storagetaskconditions for valid properties and + // operators. Condition *string // REQUIRED; List of operations to execute when the condition predicate satisfies. @@ -96,13 +97,13 @@ type OperationListResult struct { // StorageTask - Represents Storage Task. type StorageTask struct { + // REQUIRED; The managed service identity of the resource. + Identity *ManagedServiceIdentity + // REQUIRED; The geo-location where the resource lives Location *string - // The managed service identity of the resource. - Identity *ManagedServiceIdentity - - // Properties of the storage task. + // REQUIRED; Properties of the storage task. Properties *StorageTaskProperties // Resource tags. @@ -131,19 +132,19 @@ type StorageTaskAction struct { Else *ElseCondition } -// StorageTaskAssignment - Fetch the Storage task assignment ARM ids. +// StorageTaskAssignment - Storage Task Assignment associated with this Storage Task. type StorageTaskAssignment struct { - // READ-ONLY; ARM Id of the storage task assignments, associated with the storage tasks. + // READ-ONLY; Resource ID of the Storage Task Assignment. ID *string } // StorageTaskAssignmentsListResult - The response from the List Storage Tasks operation. type StorageTaskAssignmentsListResult struct { - // READ-ONLY; Request URL that can be used to query next page of storage task assignment Ids. Returned when total number of - // requested storage task assignment Ids exceed maximum page size. + // READ-ONLY; Request URL that can be used to query next page of Resource IDs. Returned when total number of requested Resource + // IDs exceed maximum page size. NextLink *string - // READ-ONLY; Gets the list of storage task assignment Ids. + // READ-ONLY; List of Storage Task Assignment Resource IDs associated with this Storage Task. Value []*StorageTaskAssignment } @@ -186,13 +187,13 @@ type StorageTaskPreviewActionIfCondition struct { // StorageTaskPreviewActionProperties - Storage task preview action properties. type StorageTaskPreviewActionProperties struct { - // REQUIRED; Preview action container properties to be tested for a match with the provided condition. + // REQUIRED; Preview action to test Action *StorageTaskPreviewActionCondition - // REQUIRED; Preview action container properties to be tested for a match with the provided condition. + // REQUIRED; Properties of some sample blobs in the container to test for matches with the preview action. Blobs []*StorageTaskPreviewBlobProperties - // REQUIRED; Preview action container properties to be tested for a match with the provided condition. + // REQUIRED; Properties of a sample container to test for a match with the preview action. Container *StorageTaskPreviewContainerProperties } @@ -201,7 +202,7 @@ type StorageTaskPreviewBlobProperties struct { // metadata key value pairs to be tested for a match against the provided condition. Metadata []*StorageTaskPreviewKeyValueProperties - // property for the container name. + // Name of test blob Name *string // properties key value pairs to be tested for a match against the provided condition. @@ -219,7 +220,7 @@ type StorageTaskPreviewContainerProperties struct { // metadata key value pairs to be tested for a match against the provided condition. Metadata []*StorageTaskPreviewKeyValueProperties - // property for the container name. + // Name of test container Name *string } @@ -312,17 +313,17 @@ type StorageTaskReportProperties struct { // https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators StartTime *string - // READ-ONLY; Represents the Storage Account Id where the storage task definition was applied and executed. + // READ-ONLY; Resource ID of the Storage Account where this reported run executed. StorageAccountID *string // READ-ONLY; Full path to the verbose report stored in the reporting container as specified in the assignment execution context // for the storage account. SummaryReportPath *string - // READ-ONLY; Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + // READ-ONLY; Resource ID of the Storage Task Assignment associated with this reported run. TaskAssignmentID *string - // READ-ONLY; Storage Task Arm Id. + // READ-ONLY; Resource ID of the Storage Task applied during this run. TaskID *string // READ-ONLY; Storage Task Version @@ -353,7 +354,7 @@ type StorageTaskUpdateParameters struct { Tags map[string]*string } -// StorageTasksListResult - The response from the List Storage Tasks operation. +// StorageTasksListResult - The response from the List Storage Task operation. type StorageTasksListResult struct { // READ-ONLY; Request URL that can be used to query next page of storage tasks. Returned when total number of requested storage // tasks exceed maximum page size. diff --git a/sdk/resourcemanager/storageactions/armstorageactions/operations_client_example_test.go b/sdk/resourcemanager/storageactions/armstorageactions/operations_client_example_test.go deleted file mode 100644 index cc9f079cb9e5..000000000000 --- a/sdk/resourcemanager/storageactions/armstorageactions/operations_client_example_test.go +++ /dev/null @@ -1,76 +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 armstorageactions_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/armstorageactions" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/OperationsList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstorageactions.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 = armstorageactions.OperationListResult{ - // Value: []*armstorageactions.Operation{ - // { - // Name: to.Ptr("Microsoft.StorageActions/storageTasks/read"), - // Display: &armstorageactions.OperationDisplay{ - // Description: to.Ptr("Gets or Lists existing StorageTask resource(s)."), - // Operation: to.Ptr("Get or List StorageTask resource(s)."), - // Provider: to.Ptr("Microsoft StorageActions"), - // Resource: to.Ptr("StorageTasks"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.StorageActions/storageTasks/write"), - // Display: &armstorageactions.OperationDisplay{ - // Description: to.Ptr("Creates or Updates StorageTask resource."), - // Operation: to.Ptr("Create or Update StorageTask resource."), - // Provider: to.Ptr("Microsoft StorageActions"), - // Resource: to.Ptr("StorageTasks"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.StorageActions/storageTasks/delete"), - // Display: &armstorageactions.OperationDisplay{ - // Description: to.Ptr("Deletes StorageTask resource."), - // Operation: to.Ptr("Delete StorageTask resource."), - // Provider: to.Ptr("Microsoft StorageActions"), - // Resource: to.Ptr("StorageTasks"), - // }, - // IsDataAction: to.Ptr(false), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/storageactions/armstorageactions/options.go b/sdk/resourcemanager/storageactions/armstorageactions/options.go index ac56aa8e1613..8a2de73483c9 100644 --- a/sdk/resourcemanager/storageactions/armstorageactions/options.go +++ b/sdk/resourcemanager/storageactions/armstorageactions/options.go @@ -16,7 +16,7 @@ type OperationsClientListOptions struct { // StorageTaskAssignmentClientListOptions contains the optional parameters for the StorageTaskAssignmentClient.NewListPager // method. type StorageTaskAssignmentClientListOptions struct { - // Optional, specifies the maximum number of storage task assignment Ids to be included in the list response. + // Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included in the list response. Maxpagesize *string } @@ -65,6 +65,6 @@ type StorageTasksReportClientListOptions struct { // Optional. When specified, it can be used to query using reporting properties. Filter *string - // Optional, specifies the maximum number of storage task assignment Ids to be included in the list response. + // Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included in the list response. Maxpagesize *string } diff --git a/sdk/resourcemanager/storageactions/armstorageactions/responses.go b/sdk/resourcemanager/storageactions/armstorageactions/responses.go index 7d6d23ec56a2..11fea7aa25eb 100644 --- a/sdk/resourcemanager/storageactions/armstorageactions/responses.go +++ b/sdk/resourcemanager/storageactions/armstorageactions/responses.go @@ -39,13 +39,13 @@ type StorageTasksClientGetResponse struct { // StorageTasksClientListByResourceGroupResponse contains the response from method StorageTasksClient.NewListByResourceGroupPager. type StorageTasksClientListByResourceGroupResponse struct { - // The response from the List Storage Tasks operation. + // The response from the List Storage Task operation. StorageTasksListResult } // StorageTasksClientListBySubscriptionResponse contains the response from method StorageTasksClient.NewListBySubscriptionPager. type StorageTasksClientListBySubscriptionResponse struct { - // The response from the List Storage Tasks operation. + // The response from the List Storage Task operation. StorageTasksListResult } diff --git a/sdk/resourcemanager/storageactions/armstorageactions/storagetaskassignment_client.go b/sdk/resourcemanager/storageactions/armstorageactions/storagetaskassignment_client.go index 222d415a15be..41651b713439 100644 --- a/sdk/resourcemanager/storageactions/armstorageactions/storagetaskassignment_client.go +++ b/sdk/resourcemanager/storageactions/armstorageactions/storagetaskassignment_client.go @@ -43,7 +43,7 @@ func NewStorageTaskAssignmentClient(subscriptionID string, credential azcore.Tok return client, nil } -// NewListPager - Lists all the storage tasks available under the given resource group. +// NewListPager - Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. // // Generated from API version 2023-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. diff --git a/sdk/resourcemanager/storageactions/armstorageactions/storagetaskassignment_client_example_test.go b/sdk/resourcemanager/storageactions/armstorageactions/storagetaskassignment_client_example_test.go deleted file mode 100644 index dd6d9d852dde..000000000000 --- a/sdk/resourcemanager/storageactions/armstorageactions/storagetaskassignment_client_example_test.go +++ /dev/null @@ -1,58 +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 armstorageactions_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/armstorageactions" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTaskAssignmentIds.json -func ExampleStorageTaskAssignmentClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstorageactions.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStorageTaskAssignmentClient().NewListPager("rgroup1", "mytask1", &armstorageactions.StorageTaskAssignmentClientListOptions{Maxpagesize: 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.StorageTaskAssignmentsListResult = armstorageactions.StorageTaskAssignmentsListResult{ - // Value: []*armstorageactions.StorageTaskAssignment{ - // { - // ID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/microsoft.storage/storageaccounts/acc123/storagetaskassignments/assign123"), - // }, - // { - // ID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/microsoft.storage/storageaccounts/acc123/storagetaskassignments/assign455"), - // }, - // { - // ID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup3/providers/microsoft.storage/storageaccounts/accxx1/storagetaskassignments/assign123"), - // }, - // { - // ID: to.Ptr("/subscriptions/28e089f2-9607-4285-a0d0-64dbe3771929/resourcegroups/rgroup4/providers/microsoft.storage/storageaccounts/accxx2/storagetaskassignments/assign123"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/storageactions/armstorageactions/storagetasks_client_example_test.go b/sdk/resourcemanager/storageactions/armstorageactions/storagetasks_client_example_test.go deleted file mode 100644 index 60011b3e9d84..000000000000 --- a/sdk/resourcemanager/storageactions/armstorageactions/storagetasks_client_example_test.go +++ /dev/null @@ -1,735 +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 armstorageactions_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/storageactions/armstorageactions" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/PutStorageTask.json -func ExampleStorageTasksClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstorageactions.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTasksClient().BeginCreate(ctx, "res4228", "mytask1", armstorageactions.StorageTask{ - Location: to.Ptr("westus"), - Properties: &armstorageactions.StorageTaskProperties{ - Description: to.Ptr("My Storage task"), - Action: &armstorageactions.StorageTaskAction{ - Else: &armstorageactions.ElseCondition{ - Operations: []*armstorageactions.StorageTaskOperation{ - { - Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), - OnFailure: to.Ptr("break"), - OnSuccess: to.Ptr("continue"), - }}, - }, - If: &armstorageactions.IfCondition{ - Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), - Operations: []*armstorageactions.StorageTaskOperation{ - { - Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), - OnFailure: to.Ptr("break"), - OnSuccess: to.Ptr("continue"), - Parameters: map[string]*string{ - "tier": to.Ptr("Hot"), - }, - }}, - }, - }, - Enabled: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageTask = armstorageactions.StorageTask{ - // Name: to.Ptr("mytask1"), - // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), - // ID: to.Ptr("/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1"), - // Location: to.Ptr("westus"), - // Properties: &armstorageactions.StorageTaskProperties{ - // Description: to.Ptr("Storage task"), - // Action: &armstorageactions.StorageTaskAction{ - // Else: &armstorageactions.ElseCondition{ - // Operations: []*armstorageactions.StorageTaskOperation{ - // { - // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), - // OnFailure: to.Ptr("break"), - // OnSuccess: to.Ptr("continue"), - // }}, - // }, - // If: &armstorageactions.IfCondition{ - // Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), - // Operations: []*armstorageactions.StorageTaskOperation{ - // { - // Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), - // OnFailure: to.Ptr("break"), - // OnSuccess: to.Ptr("continue"), - // Parameters: map[string]*string{ - // "tier": to.Ptr("Hot"), - // }, - // }}, - // }, - // }, - // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-06T00:24:59.144Z"); return t}()), - // Enabled: to.Ptr(true), - // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), - // TaskVersion: to.Ptr[int64](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/DeleteStorageTask.json -func ExampleStorageTasksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstorageactions.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTasksClient().BeginDelete(ctx, "res4228", "mytask1", 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/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/GetStorageTask.json -func ExampleStorageTasksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstorageactions.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStorageTasksClient().Get(ctx, "res4228", "mytask1", 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.StorageTask = armstorageactions.StorageTask{ - // Name: to.Ptr("mytask1"), - // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), - // ID: to.Ptr("/subscriptions/1f31ba14-ce16-4281-b9b4-3e78da6e1616/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1"), - // Location: to.Ptr("westus"), - // Properties: &armstorageactions.StorageTaskProperties{ - // Description: to.Ptr("Storage task"), - // Action: &armstorageactions.StorageTaskAction{ - // Else: &armstorageactions.ElseCondition{ - // Operations: []*armstorageactions.StorageTaskOperation{ - // { - // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), - // OnFailure: to.Ptr("break"), - // OnSuccess: to.Ptr("continue"), - // }}, - // }, - // If: &armstorageactions.IfCondition{ - // Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), - // Operations: []*armstorageactions.StorageTaskOperation{ - // { - // Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), - // OnFailure: to.Ptr("break"), - // OnSuccess: to.Ptr("continue"), - // Parameters: map[string]*string{ - // "tier": to.Ptr("Hot"), - // }, - // }}, - // }, - // }, - // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-06T00:24:59.144Z"); return t}()), - // Enabled: to.Ptr(true), - // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), - // TaskVersion: to.Ptr[int64](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/PatchStorageTask.json -func ExampleStorageTasksClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstorageactions.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageTasksClient().BeginUpdate(ctx, "res4228", "mytask1", armstorageactions.StorageTaskUpdateParameters{ - Properties: &armstorageactions.StorageTaskProperties{ - Description: to.Ptr("My Storage task"), - Action: &armstorageactions.StorageTaskAction{ - Else: &armstorageactions.ElseCondition{ - Operations: []*armstorageactions.StorageTaskOperation{ - { - Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), - OnFailure: to.Ptr("break"), - OnSuccess: to.Ptr("continue"), - }}, - }, - If: &armstorageactions.IfCondition{ - Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), - Operations: []*armstorageactions.StorageTaskOperation{ - { - Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), - OnFailure: to.Ptr("break"), - OnSuccess: to.Ptr("continue"), - Parameters: map[string]*string{ - "tier": to.Ptr("Hot"), - }, - }}, - }, - }, - Enabled: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageTask = armstorageactions.StorageTask{ - // Name: to.Ptr("mytask1"), - // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), - // ID: to.Ptr("/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res4228/providers/Microsoft.StorageActions/storageTasks/mytask1"), - // Location: to.Ptr("westus"), - // Properties: &armstorageactions.StorageTaskProperties{ - // Description: to.Ptr("Storage task"), - // Action: &armstorageactions.StorageTaskAction{ - // Else: &armstorageactions.ElseCondition{ - // Operations: []*armstorageactions.StorageTaskOperation{ - // { - // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), - // OnFailure: to.Ptr("break"), - // OnSuccess: to.Ptr("continue"), - // }}, - // }, - // If: &armstorageactions.IfCondition{ - // Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), - // Operations: []*armstorageactions.StorageTaskOperation{ - // { - // Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), - // OnFailure: to.Ptr("break"), - // OnSuccess: to.Ptr("continue"), - // Parameters: map[string]*string{ - // "tier": to.Ptr("Hot"), - // }, - // }}, - // }, - // }, - // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-06T00:24:59.144Z"); return t}()), - // Enabled: to.Ptr(true), - // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), - // TaskVersion: to.Ptr[int64](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTasksBySubscription.json -func ExampleStorageTasksClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstorageactions.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStorageTasksClient().NewListBySubscriptionPager(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.StorageTasksListResult = armstorageactions.StorageTasksListResult{ - // Value: []*armstorageactions.StorageTask{ - // { - // Name: to.Ptr("mytask1"), - // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), - // ID: to.Ptr("/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res6117/providers/Microsoft.StorageActions/storageTasks/mytask1"), - // Location: to.Ptr("eastus"), - // Identity: &armstorageactions.ManagedServiceIdentity{ - // Type: to.Ptr(armstorageactions.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("2fd475e8-8923-4597-842f-7ce1adfc6c4a"), - // TenantID: to.Ptr("b4a2005c-32c1-434c-bbf0-ff486912fc75"), - // }, - // Properties: &armstorageactions.StorageTaskProperties{ - // Description: to.Ptr("Storage task"), - // Action: &armstorageactions.StorageTaskAction{ - // If: &armstorageactions.IfCondition{ - // Condition: to.Ptr("[[greater(Content-Length, '100')]]"), - // Operations: []*armstorageactions.StorageTaskOperation{ - // { - // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), - // OnFailure: to.Ptr("break"), - // OnSuccess: to.Ptr("continue"), - // }}, - // }, - // }, - // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-05T23:06:50.772Z"); return t}()), - // Enabled: to.Ptr(true), - // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), - // TaskVersion: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("mytask2"), - // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), - // ID: to.Ptr("/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res6117/providers/Microsoft.StorageActions/storageTasks/mytask2"), - // Location: to.Ptr("westus"), - // Properties: &armstorageactions.StorageTaskProperties{ - // Description: to.Ptr("Storage task"), - // Action: &armstorageactions.StorageTaskAction{ - // Else: &armstorageactions.ElseCondition{ - // Operations: []*armstorageactions.StorageTaskOperation{ - // { - // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), - // OnFailure: to.Ptr("break"), - // OnSuccess: to.Ptr("continue"), - // }}, - // }, - // If: &armstorageactions.IfCondition{ - // Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), - // Operations: []*armstorageactions.StorageTaskOperation{ - // { - // Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), - // OnFailure: to.Ptr("break"), - // OnSuccess: to.Ptr("continue"), - // Parameters: map[string]*string{ - // "tier": to.Ptr("Hot"), - // }, - // }}, - // }, - // }, - // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-06T00:24:59.144Z"); return t}()), - // Enabled: to.Ptr(true), - // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), - // TaskVersion: to.Ptr[int64](1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTasksByResourceGroup.json -func ExampleStorageTasksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstorageactions.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStorageTasksClient().NewListByResourceGroupPager("res6117", 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.StorageTasksListResult = armstorageactions.StorageTasksListResult{ - // Value: []*armstorageactions.StorageTask{ - // { - // Name: to.Ptr("mytask1"), - // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), - // ID: to.Ptr("/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res6117/providers/Microsoft.StorageActions/storageTasks/mytask1"), - // Location: to.Ptr("eastus"), - // Identity: &armstorageactions.ManagedServiceIdentity{ - // Type: to.Ptr(armstorageactions.ManagedServiceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("2fd475e8-8923-4597-842f-7ce1adfc6c4a"), - // TenantID: to.Ptr("b4a2005c-32c1-434c-bbf0-ff486912fc75"), - // }, - // Properties: &armstorageactions.StorageTaskProperties{ - // Description: to.Ptr("Storage task"), - // Action: &armstorageactions.StorageTaskAction{ - // If: &armstorageactions.IfCondition{ - // Condition: to.Ptr("[[greater(Content-Length, '100')]]"), - // Operations: []*armstorageactions.StorageTaskOperation{ - // { - // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), - // OnFailure: to.Ptr("break"), - // OnSuccess: to.Ptr("continue"), - // }}, - // }, - // }, - // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-05T23:06:50.772Z"); return t}()), - // Enabled: to.Ptr(true), - // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), - // TaskVersion: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("mytask2"), - // Type: to.Ptr("Microsoft.StorageActions/storageTasks"), - // ID: to.Ptr("/subscriptions/c86a9c18-8373-41fa-92d4-1d7bdc16977b/resourceGroups/res6117/providers/Microsoft.StorageActions/storageTasks/mytask2"), - // Location: to.Ptr("westus"), - // Properties: &armstorageactions.StorageTaskProperties{ - // Description: to.Ptr("Storage task"), - // Action: &armstorageactions.StorageTaskAction{ - // Else: &armstorageactions.ElseCondition{ - // Operations: []*armstorageactions.StorageTaskOperation{ - // { - // Name: to.Ptr(armstorageactions.StorageTaskOperationNameDeleteBlob), - // OnFailure: to.Ptr("break"), - // OnSuccess: to.Ptr("continue"), - // }}, - // }, - // If: &armstorageactions.IfCondition{ - // Condition: to.Ptr("[[equals(AccessTier, 'Cool')]]"), - // Operations: []*armstorageactions.StorageTaskOperation{ - // { - // Name: to.Ptr(armstorageactions.StorageTaskOperationNameSetBlobTier), - // OnFailure: to.Ptr("break"), - // OnSuccess: to.Ptr("continue"), - // Parameters: map[string]*string{ - // "tier": to.Ptr("Hot"), - // }, - // }}, - // }, - // }, - // CreationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-06T00:24:59.144Z"); return t}()), - // Enabled: to.Ptr(true), - // ProvisioningState: to.Ptr(armstorageactions.ProvisioningStateSucceeded), - // TaskVersion: to.Ptr[int64](1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/PerformStorageTaskActionsPreview.json -func ExampleStorageTasksClient_PreviewActions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstorageactions.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStorageTasksClient().PreviewActions(ctx, "eastus", armstorageactions.StorageTaskPreviewAction{ - Properties: &armstorageactions.StorageTaskPreviewActionProperties{ - Action: &armstorageactions.StorageTaskPreviewActionCondition{ - ElseBlockExists: to.Ptr(true), - If: &armstorageactions.StorageTaskPreviewActionIfCondition{ - Condition: to.Ptr("[[equals(AccessTier, 'Hot')]]"), - }, - }, - Blobs: []*armstorageactions.StorageTaskPreviewBlobProperties{ - { - Name: to.Ptr("folder1/file1.txt"), - Metadata: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - { - Key: to.Ptr("mKey1"), - Value: to.Ptr("mValue1"), - }}, - Properties: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - { - Key: to.Ptr("Creation-Time"), - Value: to.Ptr("Wed, 07 Jun 2023 05:23:29 GMT"), - }, - { - Key: to.Ptr("Last-Modified"), - Value: to.Ptr("Wed, 07 Jun 2023 05:23:29 GMT"), - }, - { - Key: to.Ptr("Etag"), - Value: to.Ptr("0x8DB67175454D36D"), - }, - { - Key: to.Ptr("Content-Length"), - Value: to.Ptr("38619"), - }, - { - Key: to.Ptr("Content-Type"), - Value: to.Ptr("text/xml"), - }, - { - Key: to.Ptr("Content-Encoding"), - Value: to.Ptr(""), - }, - { - Key: to.Ptr("Content-Language"), - Value: to.Ptr(""), - }, - { - Key: to.Ptr("Content-CRC64"), - Value: to.Ptr(""), - }, - { - Key: to.Ptr("Content-MD5"), - Value: to.Ptr("njr6iDrmU9+FC89WMK22EA=="), - }, - { - Key: to.Ptr("Cache-Control"), - Value: to.Ptr(""), - }, - { - Key: to.Ptr("Content-Disposition"), - Value: to.Ptr(""), - }, - { - Key: to.Ptr("BlobType"), - Value: to.Ptr("BlockBlob"), - }, - { - Key: to.Ptr("AccessTier"), - Value: to.Ptr("Hot"), - }, - { - Key: to.Ptr("AccessTierInferred"), - Value: to.Ptr("true"), - }, - { - Key: to.Ptr("LeaseStatus"), - Value: to.Ptr("unlocked"), - }, - { - Key: to.Ptr("LeaseState"), - Value: to.Ptr("available"), - }, - { - Key: to.Ptr("ServerEncrypted"), - Value: to.Ptr("true"), - }, - { - Key: to.Ptr("TagCount"), - Value: to.Ptr("1"), - }}, - Tags: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - { - Key: to.Ptr("tKey1"), - Value: to.Ptr("tValue1"), - }}, - }, - { - Name: to.Ptr("folder2/file1.txt"), - Metadata: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - { - Key: to.Ptr("mKey2"), - Value: to.Ptr("mValue2"), - }}, - Properties: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - { - Key: to.Ptr("Creation-Time"), - Value: to.Ptr("Wed, 06 Jun 2023 05:23:29 GMT"), - }, - { - Key: to.Ptr("Last-Modified"), - Value: to.Ptr("Wed, 06 Jun 2023 05:23:29 GMT"), - }, - { - Key: to.Ptr("Etag"), - Value: to.Ptr("0x6FB67175454D36D"), - }}, - Tags: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - { - Key: to.Ptr("tKey2"), - Value: to.Ptr("tValue2"), - }}, - }}, - Container: &armstorageactions.StorageTaskPreviewContainerProperties{ - Name: to.Ptr("firstContainer"), - Metadata: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - { - Key: to.Ptr("mContainerKey1"), - Value: to.Ptr("mContainerValue1"), - }}, - }, - }, - }, 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.StorageTaskPreviewAction = armstorageactions.StorageTaskPreviewAction{ - // Properties: &armstorageactions.StorageTaskPreviewActionProperties{ - // Action: &armstorageactions.StorageTaskPreviewActionCondition{ - // ElseBlockExists: to.Ptr(true), - // If: &armstorageactions.StorageTaskPreviewActionIfCondition{ - // Condition: to.Ptr("[[equals(AccessTier, 'Hot')]]"), - // }, - // }, - // Blobs: []*armstorageactions.StorageTaskPreviewBlobProperties{ - // { - // Name: to.Ptr("folder1/file1.txt"), - // MatchedBlock: to.Ptr(armstorageactions.MatchedBlockNameIf), - // Metadata: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - // { - // Key: to.Ptr("mKey1"), - // Value: to.Ptr("mValue1"), - // }}, - // Properties: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - // { - // Key: to.Ptr("Creation-Time"), - // Value: to.Ptr("Wed, 07 Jun 2023 05:23:29 GMT"), - // }, - // { - // Key: to.Ptr("Last-Modified"), - // Value: to.Ptr("Wed, 07 Jun 2023 05:23:29 GMT"), - // }, - // { - // Key: to.Ptr("Etag"), - // Value: to.Ptr("0x8DB67175454D36D"), - // }, - // { - // Key: to.Ptr("Content-Length"), - // Value: to.Ptr("38619"), - // }, - // { - // Key: to.Ptr("Content-Type"), - // Value: to.Ptr("text/xml"), - // }, - // { - // Key: to.Ptr("Content-Encoding"), - // Value: to.Ptr(""), - // }, - // { - // Key: to.Ptr("Content-Language"), - // Value: to.Ptr(""), - // }, - // { - // Key: to.Ptr("Content-CRC64"), - // Value: to.Ptr(""), - // }, - // { - // Key: to.Ptr("Content-MD5"), - // Value: to.Ptr("njr6iDrmU9+FC89WMK22EA=="), - // }, - // { - // Key: to.Ptr("Cache-Control"), - // Value: to.Ptr(""), - // }, - // { - // Key: to.Ptr("Content-Disposition"), - // Value: to.Ptr(""), - // }, - // { - // Key: to.Ptr("BlobType"), - // Value: to.Ptr("BlockBlob"), - // }, - // { - // Key: to.Ptr("AccessTier"), - // Value: to.Ptr("Hot"), - // }, - // { - // Key: to.Ptr("AccessTierInferred"), - // Value: to.Ptr("true"), - // }, - // { - // Key: to.Ptr("LeaseStatus"), - // Value: to.Ptr("unlocked"), - // }, - // { - // Key: to.Ptr("LeaseState"), - // Value: to.Ptr("available"), - // }, - // { - // Key: to.Ptr("ServerEncrypted"), - // Value: to.Ptr("true"), - // }, - // { - // Key: to.Ptr("TagCount"), - // Value: to.Ptr("1"), - // }}, - // Tags: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - // { - // Key: to.Ptr("tKey1"), - // Value: to.Ptr("tValue1"), - // }}, - // }, - // { - // Name: to.Ptr("folder2/file1.txt"), - // MatchedBlock: to.Ptr(armstorageactions.MatchedBlockNameElse), - // Metadata: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - // { - // Key: to.Ptr("mKey2"), - // Value: to.Ptr("mValue2"), - // }}, - // Properties: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - // { - // Key: to.Ptr("Creation-Time"), - // Value: to.Ptr("Wed, 06 Jun 2023 05:23:29 GMT"), - // }, - // { - // Key: to.Ptr("Last-Modified"), - // Value: to.Ptr("Wed, 06 Jun 2023 05:23:29 GMT"), - // }, - // { - // Key: to.Ptr("Etag"), - // Value: to.Ptr("0x6FB67175454D36D"), - // }}, - // Tags: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - // { - // Key: to.Ptr("tKey2"), - // Value: to.Ptr("tValue2"), - // }}, - // }}, - // Container: &armstorageactions.StorageTaskPreviewContainerProperties{ - // Name: to.Ptr("firstContainer"), - // Metadata: []*armstorageactions.StorageTaskPreviewKeyValueProperties{ - // { - // Key: to.Ptr("mContainerKey1"), - // Value: to.Ptr("mContainerValue1"), - // }}, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/storageactions/armstorageactions/storagetasksreport_client_example_test.go b/sdk/resourcemanager/storageactions/armstorageactions/storagetasksreport_client_example_test.go deleted file mode 100644 index 3a7c7fab59fc..000000000000 --- a/sdk/resourcemanager/storageactions/armstorageactions/storagetasksreport_client_example_test.go +++ /dev/null @@ -1,90 +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 armstorageactions_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storageactions/armstorageactions" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43974e07d3204c4b6f8396627f5430994a7f7c9/specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTasksRunReportSummary.json -func ExampleStorageTasksReportClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armstorageactions.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStorageTasksReportClient().NewListPager("rgroup1", "mytask1", &armstorageactions.StorageTasksReportClientListOptions{Maxpagesize: nil, - Filter: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.StorageTaskReportSummary = armstorageactions.StorageTaskReportSummary{ - // Value: []*armstorageactions.StorageTaskReportInstance{ - // { - // Name: to.Ptr("instance1"), - // Type: to.Ptr("Microsoft.StorageActions/storageTasks/reports"), - // ID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.StorageActions/storageTasks/myTaskName/reports/instance1"), - // Properties: &armstorageactions.StorageTaskReportProperties{ - // FinishTime: to.Ptr("2023-06-23T00:40:10.2931264Z"), - // ObjectFailedCount: to.Ptr("0"), - // ObjectsOperatedOnCount: to.Ptr("150"), - // ObjectsSucceededCount: to.Ptr("150"), - // ObjectsTargetedCount: to.Ptr("150"), - // RunResult: to.Ptr(armstorageactions.RunResultSucceeded), - // RunStatusEnum: to.Ptr(armstorageactions.RunStatusEnumFinished), - // RunStatusError: to.Ptr("0"), - // StartTime: to.Ptr("2023-06-23T00:30:43.226744Z"), - // StorageAccountID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.Storage/storageAccounts/acc123"), - // SummaryReportPath: to.Ptr("https://acc123.blob.core.windows.net/result-container/{folderpath}/SummaryReport.json"), - // TaskAssignmentID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.Storage/storageAccounts/acc123/storageTaskAssignments/assign1"), - // TaskID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.StorageActions/storageTasks/mytask1"), - // TaskVersion: to.Ptr("1"), - // }, - // }, - // { - // Name: to.Ptr("instance2"), - // Type: to.Ptr("Microsoft.StorageActions/storageTasks/reports"), - // ID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.StorageActions/storageTasks/myTaskName/reports/instance2"), - // Properties: &armstorageactions.StorageTaskReportProperties{ - // FinishTime: to.Ptr("2023-06-23T00:40:10.2931264Z"), - // ObjectFailedCount: to.Ptr("0"), - // ObjectsOperatedOnCount: to.Ptr("150"), - // ObjectsSucceededCount: to.Ptr("150"), - // ObjectsTargetedCount: to.Ptr("150"), - // RunResult: to.Ptr(armstorageactions.RunResultSucceeded), - // RunStatusEnum: to.Ptr(armstorageactions.RunStatusEnumFinished), - // RunStatusError: to.Ptr("0"), - // StartTime: to.Ptr("2023-06-23T00:30:43.226744Z"), - // StorageAccountID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.Storage/storageAccounts/acc123"), - // SummaryReportPath: to.Ptr("https://acc123.blob.core.windows.net/result-container/{folderpath}/SummaryReport.json"), - // TaskAssignmentID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.Storage/storageAccounts/acc123/storageTaskAssignments/assign1"), - // TaskID: to.Ptr("/subscriptions/9d6baee9-681f-44d8-99f7-d06d180af6bb/resourcegroups/rgroup1/providers/Microsoft.StorageActions/storageTasks/mytask1"), - // TaskVersion: to.Ptr("1"), - // }, - // }}, - // } - } -}