diff --git a/sdk/resourcemanager/apicenter/armapicenter/CHANGELOG.md b/sdk/resourcemanager/apicenter/armapicenter/CHANGELOG.md index d6854c1c213b..5013fa2f1fe6 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/CHANGELOG.md +++ b/sdk/resourcemanager/apicenter/armapicenter/CHANGELOG.md @@ -1,5 +1,22 @@ # Release History +## 1.1.0-beta.1 (2024-08-16) +### Features Added + +- New function `*ClientFactory.NewDeletedServicesClient() *DeletedServicesClient` +- New function `NewDeletedServicesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DeletedServicesClient, error)` +- New function `*DeletedServicesClient.Delete(context.Context, string, string, *DeletedServicesClientDeleteOptions) (DeletedServicesClientDeleteResponse, error)` +- New function `*DeletedServicesClient.Get(context.Context, string, string, *DeletedServicesClientGetOptions) (DeletedServicesClientGetResponse, error)` +- New function `*DeletedServicesClient.NewListBySubscriptionPager(*DeletedServicesClientListBySubscriptionOptions) *runtime.Pager[DeletedServicesClientListBySubscriptionResponse]` +- New function `*DeletedServicesClient.NewListPager(string, *DeletedServicesClientListOptions) *runtime.Pager[DeletedServicesClientListResponse]` +- New struct `DeletedService` +- New struct `DeletedServiceListResult` +- New struct `DeletedServiceProperties` +- New struct `ServiceUpdateProperties` +- New field `Restore` in struct `ServiceProperties` +- New field `Properties` in struct `ServiceUpdate` + + ## 1.0.0 (2024-02-23) ### Breaking Changes diff --git a/sdk/resourcemanager/apicenter/armapicenter/apidefinitions_client.go b/sdk/resourcemanager/apicenter/armapicenter/apidefinitions_client.go index e22f69a745ee..cb7646ef0937 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/apidefinitions_client.go +++ b/sdk/resourcemanager/apicenter/armapicenter/apidefinitions_client.go @@ -46,7 +46,7 @@ func NewAPIDefinitionsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Creates new or updates existing API definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -114,7 +114,7 @@ func (client *APIDefinitionsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -138,7 +138,7 @@ func (client *APIDefinitionsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Deletes specified API definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -203,7 +203,7 @@ func (client *APIDefinitionsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *APIDefinitionsClient) deleteCreateRequest(ctx context.Context, res // BeginExportSpecification - Exports the API specification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -242,7 +242,7 @@ func (client *APIDefinitionsClient) BeginExportSpecification(ctx context.Context // ExportSpecification - Exports the API specification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview func (client *APIDefinitionsClient) exportSpecification(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, options *APIDefinitionsClientBeginExportSpecificationOptions) (*http.Response, error) { var err error const operationName = "APIDefinitionsClient.BeginExportSpecification" @@ -300,7 +300,7 @@ func (client *APIDefinitionsClient) exportSpecificationCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -309,7 +309,7 @@ func (client *APIDefinitionsClient) exportSpecificationCreateRequest(ctx context // Get - Returns details of the API definition. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -375,7 +375,7 @@ func (client *APIDefinitionsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -395,7 +395,7 @@ func (client *APIDefinitionsClient) getHandleResponse(resp *http.Response) (APID // Head - Checks if specified API definition exists. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -460,7 +460,7 @@ func (client *APIDefinitionsClient) headCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -469,7 +469,7 @@ func (client *APIDefinitionsClient) headCreateRequest(ctx context.Context, resou // BeginImportSpecification - Imports the API specification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -500,7 +500,7 @@ func (client *APIDefinitionsClient) BeginImportSpecification(ctx context.Context // ImportSpecification - Imports the API specification. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview func (client *APIDefinitionsClient) importSpecification(ctx context.Context, resourceGroupName string, serviceName string, workspaceName string, apiName string, versionName string, definitionName string, body APISpecImportRequest, options *APIDefinitionsClientBeginImportSpecificationOptions) (*http.Response, error) { var err error const operationName = "APIDefinitionsClient.BeginImportSpecification" @@ -558,7 +558,7 @@ func (client *APIDefinitionsClient) importSpecificationCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -569,7 +569,7 @@ func (client *APIDefinitionsClient) importSpecificationCreateRequest(ctx context // NewListPager - Returns a collection of API definitions. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -634,7 +634,7 @@ func (client *APIDefinitionsClient) listCreateRequest(ctx context.Context, resou if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apicenter/armapicenter/apidefinitions_client_example_test.go b/sdk/resourcemanager/apicenter/armapicenter/apidefinitions_client_example_test.go deleted file mode 100644 index 8f17a0abbaf9..000000000000 --- a/sdk/resourcemanager/apicenter/armapicenter/apidefinitions_client_example_test.go +++ /dev/null @@ -1,220 +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 armapicenter_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_List.json -func ExampleAPIDefinitionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAPIDefinitionsClient().NewListPager("contoso-resources", "contoso", "default", "echo-api", "2023-01-01", &armapicenter.APIDefinitionsClientListOptions{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.APIDefinitionListResult = armapicenter.APIDefinitionListResult{ - // Value: []*armapicenter.APIDefinition{ - // { - // Name: to.Ptr("openapi"), - // Type: to.Ptr("Microsoft.ApiCenter/services/apis/versions/definitions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.APIDefinitionProperties{ - // Description: to.Ptr("Default spec"), - // Specification: &armapicenter.APIDefinitionPropertiesSpecification{ - // Name: to.Ptr("openapi"), - // Version: to.Ptr("3.0.6"), - // }, - // Title: to.Ptr("OpenAPI"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Get.json -func ExampleAPIDefinitionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIDefinitionsClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", 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.APIDefinition = armapicenter.APIDefinition{ - // Name: to.Ptr("openapi"), - // Type: to.Ptr("Microsoft.ApiCenter/services/apis/versions/definitions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.APIDefinitionProperties{ - // Description: to.Ptr("Default spec"), - // Specification: &armapicenter.APIDefinitionPropertiesSpecification{ - // Name: to.Ptr("openapi"), - // Version: to.Ptr("3.0.6"), - // }, - // Title: to.Ptr("OpenAPI"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_CreateOrUpdate.json -func ExampleAPIDefinitionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIDefinitionsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "openapi", "2023-01-01", "openapi", armapicenter.APIDefinition{}, 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.APIDefinition = armapicenter.APIDefinition{ - // Name: to.Ptr("openapi"), - // Type: to.Ptr("Microsoft.ApiCenter/services/apis/versions/definitions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.APIDefinitionProperties{ - // Description: to.Ptr("Default spec"), - // Specification: &armapicenter.APIDefinitionPropertiesSpecification{ - // Name: to.Ptr("openapi"), - // Version: to.Ptr("3.0.6"), - // }, - // Title: to.Ptr("OpenAPI"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Delete.json -func ExampleAPIDefinitionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAPIDefinitionsClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_Head.json -func ExampleAPIDefinitionsClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAPIDefinitionsClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_ExportSpecification.json -func ExampleAPIDefinitionsClient_BeginExportSpecification() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAPIDefinitionsClient().BeginExportSpecification(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", 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.APISpecExportResult = armapicenter.APISpecExportResult{ - // Format: to.Ptr(armapicenter.APISpecExportResultFormatInline), - // Value: to.Ptr("{ ... }"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiDefinitions_ImportSpecification.json -func ExampleAPIDefinitionsClient_BeginImportSpecification() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAPIDefinitionsClient().BeginImportSpecification(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", "openapi", armapicenter.APISpecImportRequest{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/apicenter/armapicenter/apis_client.go b/sdk/resourcemanager/apicenter/armapicenter/apis_client.go index 67d1dba00a12..cdd6a6691713 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/apis_client.go +++ b/sdk/resourcemanager/apicenter/armapicenter/apis_client.go @@ -46,7 +46,7 @@ func NewApisClient(subscriptionID string, credential azcore.TokenCredential, opt // CreateOrUpdate - Creates new or updates existing API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -103,7 +103,7 @@ func (client *ApisClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *ApisClient) createOrUpdateHandleResponse(resp *http.Response) (Api // Delete - Deletes specified API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -182,7 +182,7 @@ func (client *ApisClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *ApisClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Returns details of the API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -247,7 +247,7 @@ func (client *ApisClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +267,7 @@ func (client *ApisClient) getHandleResponse(resp *http.Response) (ApisClientGetR // Head - Checks if specified API exists. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -322,7 +322,7 @@ func (client *ApisClient) headCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *ApisClient) headCreateRequest(ctx context.Context, resourceGroupNa // NewListPager - Returns a collection of APIs. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -385,7 +385,7 @@ func (client *ApisClient) listCreateRequest(ctx context.Context, resourceGroupNa if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apicenter/armapicenter/apis_client_example_test.go b/sdk/resourcemanager/apicenter/armapicenter/apis_client_example_test.go deleted file mode 100644 index 6d977bf578ff..000000000000 --- a/sdk/resourcemanager/apicenter/armapicenter/apis_client_example_test.go +++ /dev/null @@ -1,207 +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 armapicenter_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_List.json -func ExampleApisClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApisClient().NewListPager("contoso-resources", "contoso", "default", &armapicenter.ApisClientListOptions{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.APIListResult = armapicenter.APIListResult{ - // Value: []*armapicenter.API{ - // { - // Name: to.Ptr("echo-api"), - // Type: to.Ptr("Microsoft.ApiCenter/services/environments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.APIProperties{ - // Description: to.Ptr("A simple HTTP request/response service."), - // CustomProperties: map[string]any{ - // "author": "John Doe", - // }, - // ExternalDocumentation: []*armapicenter.ExternalDocumentation{ - // { - // Title: to.Ptr("Onboarding docs"), - // URL: to.Ptr("https://docs.contoso.com"), - // }}, - // Kind: to.Ptr(armapicenter.APIKindRest), - // License: &armapicenter.License{ - // URL: to.Ptr("https://contoso.com/license"), - // }, - // LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign), - // TermsOfService: &armapicenter.TermsOfService{ - // URL: to.Ptr("https://contoso.com/terms-of-service"), - // }, - // Title: to.Ptr("Echo API"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Get.json -func ExampleApisClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApisClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", 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.API = armapicenter.API{ - // Name: to.Ptr("public"), - // Type: to.Ptr("Microsoft.ApiCenter/services/apis"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.APIProperties{ - // Description: to.Ptr("A simple HTTP request/response service."), - // CustomProperties: map[string]any{ - // "author": "John Doe", - // }, - // ExternalDocumentation: []*armapicenter.ExternalDocumentation{ - // { - // Title: to.Ptr("Onboarding docs"), - // URL: to.Ptr("https://docs.contoso.com"), - // }}, - // Kind: to.Ptr(armapicenter.APIKindRest), - // License: &armapicenter.License{ - // URL: to.Ptr("https://contoso.com/license"), - // }, - // LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign), - // TermsOfService: &armapicenter.TermsOfService{ - // URL: to.Ptr("https://contoso.com/terms-of-service"), - // }, - // Title: to.Ptr("Echo API"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_CreateOrUpdate.json -func ExampleApisClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApisClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "echo-api", armapicenter.API{}, 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.API = armapicenter.API{ - // Name: to.Ptr("echo-api"), - // Type: to.Ptr("Microsoft.ApiCenter/services/apis"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.APIProperties{ - // Description: to.Ptr("A simple HTTP request/response service."), - // CustomProperties: map[string]any{ - // "author": "John Doe", - // }, - // ExternalDocumentation: []*armapicenter.ExternalDocumentation{ - // { - // Title: to.Ptr("Onboarding docs"), - // URL: to.Ptr("https://docs.contoso.com"), - // }}, - // Kind: to.Ptr(armapicenter.APIKindRest), - // License: &armapicenter.License{ - // URL: to.Ptr("https://contoso.com/license"), - // }, - // LifecycleStage: to.Ptr(armapicenter.LifecycleStageDesign), - // TermsOfService: &armapicenter.TermsOfService{ - // URL: to.Ptr("https://contoso.com/terms-of-service"), - // }, - // Title: to.Ptr("Echo API"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Delete.json -func ExampleApisClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewApisClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Apis_Head.json -func ExampleApisClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewApisClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apicenter/armapicenter/apiversions_client.go b/sdk/resourcemanager/apicenter/armapicenter/apiversions_client.go index c9cefdb94644..798075cb709a 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/apiversions_client.go +++ b/sdk/resourcemanager/apicenter/armapicenter/apiversions_client.go @@ -46,7 +46,7 @@ func NewAPIVersionsClient(subscriptionID string, credential azcore.TokenCredenti // CreateOrUpdate - Creates new or updates existing API version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -109,7 +109,7 @@ func (client *APIVersionsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -133,7 +133,7 @@ func (client *APIVersionsClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Deletes specified API version // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -193,7 +193,7 @@ func (client *APIVersionsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +202,7 @@ func (client *APIVersionsClient) deleteCreateRequest(ctx context.Context, resour // Get - Returns details of the API version. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -263,7 +263,7 @@ func (client *APIVersionsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *APIVersionsClient) getHandleResponse(resp *http.Response) (APIVers // Head - Checks if specified API version exists. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -343,7 +343,7 @@ func (client *APIVersionsClient) headCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *APIVersionsClient) headCreateRequest(ctx context.Context, resource // NewListPager - Returns a collection of API versions. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -411,7 +411,7 @@ func (client *APIVersionsClient) listCreateRequest(ctx context.Context, resource if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apicenter/armapicenter/apiversions_client_example_test.go b/sdk/resourcemanager/apicenter/armapicenter/apiversions_client_example_test.go deleted file mode 100644 index 785f1ca84c08..000000000000 --- a/sdk/resourcemanager/apicenter/armapicenter/apiversions_client_example_test.go +++ /dev/null @@ -1,159 +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 armapicenter_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_List.json -func ExampleAPIVersionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAPIVersionsClient().NewListPager("contoso-resources", "contoso", "default", "echo-api", &armapicenter.APIVersionsClientListOptions{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.APIVersionListResult = armapicenter.APIVersionListResult{ - // Value: []*armapicenter.APIVersion{ - // { - // Name: to.Ptr("public"), - // Type: to.Ptr("Microsoft.ApiCenter/services/environments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.APIVersionProperties{ - // LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction), - // Title: to.Ptr("2023-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Get.json -func ExampleAPIVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIVersionsClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", 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.APIVersion = armapicenter.APIVersion{ - // Name: to.Ptr("2023-01-01"), - // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces/apis/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.APIVersionProperties{ - // LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction), - // Title: to.Ptr("2023-01-01"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_CreateOrUpdate.json -func ExampleAPIVersionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIVersionsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", armapicenter.APIVersion{}, 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.APIVersion = armapicenter.APIVersion{ - // Name: to.Ptr("2023-01-01"), - // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces/apis/versions"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/apis/echo-api/versions/2023-01-01"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.APIVersionProperties{ - // LifecycleStage: to.Ptr(armapicenter.LifecycleStageProduction), - // Title: to.Ptr("2023-01-01"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Delete.json -func ExampleAPIVersionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAPIVersionsClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/ApiVersions_Head.json -func ExampleAPIVersionsClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAPIVersionsClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", "2023-01-01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apicenter/armapicenter/autorest.md b/sdk/resourcemanager/apicenter/armapicenter/autorest.md index 4ea65431506d..bd1bec64d594 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/autorest.md +++ b/sdk/resourcemanager/apicenter/armapicenter/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/apicenter/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/apicenter/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2024-03 +module-version: 1.1.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/apicenter/armapicenter/client_factory.go b/sdk/resourcemanager/apicenter/armapicenter/client_factory.go index b4caba6c82ac..0d755c360226 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/client_factory.go +++ b/sdk/resourcemanager/apicenter/armapicenter/client_factory.go @@ -60,6 +60,14 @@ func (c *ClientFactory) NewApisClient() *ApisClient { } } +// NewDeletedServicesClient creates a new instance of DeletedServicesClient. +func (c *ClientFactory) NewDeletedServicesClient() *DeletedServicesClient { + return &DeletedServicesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewDeploymentsClient creates a new instance of DeploymentsClient. func (c *ClientFactory) NewDeploymentsClient() *DeploymentsClient { return &DeploymentsClient{ diff --git a/sdk/resourcemanager/apicenter/armapicenter/constants.go b/sdk/resourcemanager/apicenter/armapicenter/constants.go index 89301d7903df..cb1038ccbb6f 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/constants.go +++ b/sdk/resourcemanager/apicenter/armapicenter/constants.go @@ -10,7 +10,7 @@ package armapicenter const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0-beta.1" ) // APIKind - The kind of the API diff --git a/sdk/resourcemanager/apicenter/armapicenter/deletedservices_client.go b/sdk/resourcemanager/apicenter/armapicenter/deletedservices_client.go new file mode 100644 index 000000000000..bcff585d4cc6 --- /dev/null +++ b/sdk/resourcemanager/apicenter/armapicenter/deletedservices_client.go @@ -0,0 +1,283 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armapicenter + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DeletedServicesClient contains the methods for the DeletedServices group. +// Don't use this type directly, use NewDeletedServicesClient() instead. +type DeletedServicesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDeletedServicesClient creates a new instance of DeletedServicesClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDeletedServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeletedServicesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DeletedServicesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Delete - Permanently deletes specified service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-03-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - deletedServiceName - The name of the deleted service. +// - options - DeletedServicesClientDeleteOptions contains the optional parameters for the DeletedServicesClient.Delete method. +func (client *DeletedServicesClient) Delete(ctx context.Context, resourceGroupName string, deletedServiceName string, options *DeletedServicesClientDeleteOptions) (DeletedServicesClientDeleteResponse, error) { + var err error + const operationName = "DeletedServicesClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, deletedServiceName, options) + if err != nil { + return DeletedServicesClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DeletedServicesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DeletedServicesClientDeleteResponse{}, err + } + return DeletedServicesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DeletedServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, deletedServiceName string, options *DeletedServicesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/deletedServices/{deletedServiceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if deletedServiceName == "" { + return nil, errors.New("parameter deletedServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deletedServiceName}", url.PathEscape(deletedServiceName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-03-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Returns details of the soft-deleted service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-03-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - deletedServiceName - The name of the deleted service. +// - options - DeletedServicesClientGetOptions contains the optional parameters for the DeletedServicesClient.Get method. +func (client *DeletedServicesClient) Get(ctx context.Context, resourceGroupName string, deletedServiceName string, options *DeletedServicesClientGetOptions) (DeletedServicesClientGetResponse, error) { + var err error + const operationName = "DeletedServicesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, deletedServiceName, options) + if err != nil { + return DeletedServicesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DeletedServicesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DeletedServicesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DeletedServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, deletedServiceName string, options *DeletedServicesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/deletedServices/{deletedServiceName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if deletedServiceName == "" { + return nil, errors.New("parameter deletedServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deletedServiceName}", url.PathEscape(deletedServiceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-03-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DeletedServicesClient) getHandleResponse(resp *http.Response) (DeletedServicesClientGetResponse, error) { + result := DeletedServicesClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.DeletedService); err != nil { + return DeletedServicesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Lists soft-deleted services. +// +// Generated from API version 2024-03-15-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - DeletedServicesClientListOptions contains the optional parameters for the DeletedServicesClient.NewListPager +// method. +func (client *DeletedServicesClient) NewListPager(resourceGroupName string, options *DeletedServicesClientListOptions) *runtime.Pager[DeletedServicesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DeletedServicesClientListResponse]{ + More: func(page DeletedServicesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DeletedServicesClientListResponse) (DeletedServicesClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeletedServicesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return DeletedServicesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *DeletedServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *DeletedServicesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/deletedServices" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2024-03-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DeletedServicesClient) listHandleResponse(resp *http.Response) (DeletedServicesClientListResponse, error) { + result := DeletedServicesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DeletedServiceListResult); err != nil { + return DeletedServicesClientListResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Lists services within an Azure subscription. +// +// Generated from API version 2024-03-15-preview +// - options - DeletedServicesClientListBySubscriptionOptions contains the optional parameters for the DeletedServicesClient.NewListBySubscriptionPager +// method. +func (client *DeletedServicesClient) NewListBySubscriptionPager(options *DeletedServicesClientListBySubscriptionOptions) *runtime.Pager[DeletedServicesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[DeletedServicesClientListBySubscriptionResponse]{ + More: func(page DeletedServicesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DeletedServicesClientListBySubscriptionResponse) (DeletedServicesClientListBySubscriptionResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DeletedServicesClient.NewListBySubscriptionPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listBySubscriptionCreateRequest(ctx, options) + }, nil) + if err != nil { + return DeletedServicesClientListBySubscriptionResponse{}, err + } + return client.listBySubscriptionHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *DeletedServicesClient) listBySubscriptionCreateRequest(ctx context.Context, options *DeletedServicesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.ApiCenter/deletedServices" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-03-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *DeletedServicesClient) listBySubscriptionHandleResponse(resp *http.Response) (DeletedServicesClientListBySubscriptionResponse, error) { + result := DeletedServicesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DeletedServiceListResult); err != nil { + return DeletedServicesClientListBySubscriptionResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apicenter/armapicenter/deployments_client.go b/sdk/resourcemanager/apicenter/armapicenter/deployments_client.go index 4dc0086b4650..d6dcc85a8445 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/deployments_client.go +++ b/sdk/resourcemanager/apicenter/armapicenter/deployments_client.go @@ -46,7 +46,7 @@ func NewDeploymentsClient(subscriptionID string, credential azcore.TokenCredenti // CreateOrUpdate - Creates new or updates existing API deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -109,7 +109,7 @@ func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -133,7 +133,7 @@ func (client *DeploymentsClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Deletes API deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -193,7 +193,7 @@ func (client *DeploymentsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +202,7 @@ func (client *DeploymentsClient) deleteCreateRequest(ctx context.Context, resour // Get - Returns details of the API deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -263,7 +263,7 @@ func (client *DeploymentsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *DeploymentsClient) getHandleResponse(resp *http.Response) (Deploym // Head - Checks if specified API deployment exists. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -343,7 +343,7 @@ func (client *DeploymentsClient) headCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *DeploymentsClient) headCreateRequest(ctx context.Context, resource // NewListPager - Returns a collection of API deployments. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -411,7 +411,7 @@ func (client *DeploymentsClient) listCreateRequest(ctx context.Context, resource if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apicenter/armapicenter/deployments_client_example_test.go b/sdk/resourcemanager/apicenter/armapicenter/deployments_client_example_test.go deleted file mode 100644 index ce277f415027..000000000000 --- a/sdk/resourcemanager/apicenter/armapicenter/deployments_client_example_test.go +++ /dev/null @@ -1,180 +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 armapicenter_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_List.json -func ExampleDeploymentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeploymentsClient().NewListPager("contoso-resources", "contoso", "default", "echo-api", &armapicenter.DeploymentsClientListOptions{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.DeploymentListResult = armapicenter.DeploymentListResult{ - // Value: []*armapicenter.Deployment{ - // { - // Name: to.Ptr("public"), - // Type: to.Ptr("Microsoft.ApiCenter/services/apis/deployments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/deployments/production"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.DeploymentProperties{ - // Description: to.Ptr("Public cloud production deployment."), - // DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - // EnvironmentID: to.Ptr("/workspaces/default/environments/production"), - // Server: &armapicenter.DeploymentServer{ - // RuntimeURI: []*string{ - // to.Ptr("https://api.contoso.com")}, - // }, - // State: to.Ptr(armapicenter.DeploymentStateActive), - // Title: to.Ptr("Development"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Get.json -func ExampleDeploymentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeploymentsClient().Get(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", 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.Deployment = armapicenter.Deployment{ - // Name: to.Ptr("public"), - // Type: to.Ptr("Microsoft.ApiCenter/services/apis/deployments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/deployments/production"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.DeploymentProperties{ - // Description: to.Ptr("Public cloud production deployment."), - // DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - // EnvironmentID: to.Ptr("/workspaces/default/environments/production"), - // Server: &armapicenter.DeploymentServer{ - // RuntimeURI: []*string{ - // to.Ptr("https://api.contoso.com")}, - // }, - // State: to.Ptr(armapicenter.DeploymentStateActive), - // Title: to.Ptr("Production deployment"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_CreateOrUpdate.json -func ExampleDeploymentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeploymentsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", armapicenter.Deployment{}, 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.Deployment = armapicenter.Deployment{ - // Name: to.Ptr("production"), - // Type: to.Ptr("Microsoft.ApiCenter/services/apis/deployments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/deployments/production"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.DeploymentProperties{ - // Description: to.Ptr("Public cloud production deployment."), - // DefinitionID: to.Ptr("/workspaces/default/apis/echo-api/versions/2023-01-01/definitions/openapi"), - // EnvironmentID: to.Ptr("/workspaces/default/environments/production"), - // Server: &armapicenter.DeploymentServer{ - // RuntimeURI: []*string{ - // to.Ptr("https://api.contoso.com")}, - // }, - // State: to.Ptr(armapicenter.DeploymentStateActive), - // Title: to.Ptr("Production deployment"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Delete.json -func ExampleDeploymentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDeploymentsClient().Delete(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Deployments_Head.json -func ExampleDeploymentsClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDeploymentsClient().Head(ctx, "contoso-resources", "contoso", "default", "echo-api", "production", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apicenter/armapicenter/environments_client.go b/sdk/resourcemanager/apicenter/armapicenter/environments_client.go index 2e2b38fc817a..3529e6ce42fc 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/environments_client.go +++ b/sdk/resourcemanager/apicenter/armapicenter/environments_client.go @@ -46,7 +46,7 @@ func NewEnvironmentsClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Creates new or updates existing environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -104,7 +104,7 @@ func (client *EnvironmentsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -128,7 +128,7 @@ func (client *EnvironmentsClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Deletes the environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -183,7 +183,7 @@ func (client *EnvironmentsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +192,7 @@ func (client *EnvironmentsClient) deleteCreateRequest(ctx context.Context, resou // Get - Returns details of the environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -248,7 +248,7 @@ func (client *EnvironmentsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *EnvironmentsClient) getHandleResponse(resp *http.Response) (Enviro // Head - Checks if specified environment exists. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -323,7 +323,7 @@ func (client *EnvironmentsClient) headCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +331,7 @@ func (client *EnvironmentsClient) headCreateRequest(ctx context.Context, resourc // NewListPager - Returns a collection of environments. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -386,7 +386,7 @@ func (client *EnvironmentsClient) listCreateRequest(ctx context.Context, resourc if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apicenter/armapicenter/environments_client_example_test.go b/sdk/resourcemanager/apicenter/armapicenter/environments_client_example_test.go deleted file mode 100644 index dd397ccf205f..000000000000 --- a/sdk/resourcemanager/apicenter/armapicenter/environments_client_example_test.go +++ /dev/null @@ -1,193 +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 armapicenter_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_List.json -func ExampleEnvironmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEnvironmentsClient().NewListPager("contoso-resources", "contoso", "default", &armapicenter.EnvironmentsClientListOptions{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.EnvironmentListResult = armapicenter.EnvironmentListResult{ - // Value: []*armapicenter.Environment{ - // { - // Name: to.Ptr("public"), - // Type: to.Ptr("Microsoft.ApiCenter/services/environments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/public"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.EnvironmentProperties{ - // Description: to.Ptr("The primary Azure API Management service for the European division of Contoso."), - // CustomProperties: map[string]any{ - // }, - // Kind: to.Ptr(armapicenter.EnvironmentKindProduction), - // Onboarding: &armapicenter.Onboarding{ - // DeveloperPortalURI: []*string{ - // }, - // }, - // Server: &armapicenter.EnvironmentServer{ - // Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement), - // ManagementPortalURI: []*string{ - // }, - // }, - // Title: to.Ptr("Contoso Europe Azure API Management"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Get.json -func ExampleEnvironmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEnvironmentsClient().Get(ctx, "contoso-resources", "contoso", "default", "public", 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.Environment = armapicenter.Environment{ - // Name: to.Ptr("public"), - // Type: to.Ptr("Microsoft.ApiCenter/services/environments"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/public"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.EnvironmentProperties{ - // CustomProperties: map[string]any{ - // }, - // Kind: to.Ptr(armapicenter.EnvironmentKindProduction), - // Onboarding: &armapicenter.Onboarding{ - // DeveloperPortalURI: []*string{ - // }, - // }, - // Server: &armapicenter.EnvironmentServer{ - // Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement), - // ManagementPortalURI: []*string{ - // }, - // }, - // Title: to.Ptr("Public"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_CreateOrUpdate.json -func ExampleEnvironmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEnvironmentsClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", "public", armapicenter.Environment{}, 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.Environment = armapicenter.Environment{ - // Name: to.Ptr("public"), - // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces/environments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/public"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.EnvironmentProperties{ - // Description: to.Ptr("The primary Azure API Management service for the European division of Contoso."), - // Kind: to.Ptr(armapicenter.EnvironmentKindProduction), - // Onboarding: &armapicenter.Onboarding{ - // DeveloperPortalURI: []*string{ - // to.Ptr("https://developer.contoso.com")}, - // Instructions: to.Ptr("Sign in or sign up in the specified developer portal to request API access. You must complete the internal privacy training for your account to be approved."), - // }, - // Server: &armapicenter.EnvironmentServer{ - // Type: to.Ptr(armapicenter.EnvironmentServerTypeAzureAPIManagement), - // ManagementPortalURI: []*string{ - // to.Ptr("https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso")}, - // }, - // Title: to.Ptr("Contoso Europe Azure API Management"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Delete.json -func ExampleEnvironmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewEnvironmentsClient().Delete(ctx, "contoso-resources", "contoso", "default", "public", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Environments_Head.json -func ExampleEnvironmentsClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewEnvironmentsClient().Head(ctx, "contoso-resources", "contoso", "default", "public", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apicenter/armapicenter/fake/deletedservices_server.go b/sdk/resourcemanager/apicenter/armapicenter/fake/deletedservices_server.go new file mode 100644 index 000000000000..5c3499e633f0 --- /dev/null +++ b/sdk/resourcemanager/apicenter/armapicenter/fake/deletedservices_server.go @@ -0,0 +1,243 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" + "net/http" + "net/url" + "regexp" +) + +// DeletedServicesServer is a fake server for instances of the armapicenter.DeletedServicesClient type. +type DeletedServicesServer struct { + // Delete is the fake for method DeletedServicesClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceGroupName string, deletedServiceName string, options *armapicenter.DeletedServicesClientDeleteOptions) (resp azfake.Responder[armapicenter.DeletedServicesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method DeletedServicesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, deletedServiceName string, options *armapicenter.DeletedServicesClientGetOptions) (resp azfake.Responder[armapicenter.DeletedServicesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method DeletedServicesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, options *armapicenter.DeletedServicesClientListOptions) (resp azfake.PagerResponder[armapicenter.DeletedServicesClientListResponse]) + + // NewListBySubscriptionPager is the fake for method DeletedServicesClient.NewListBySubscriptionPager + // HTTP status codes to indicate success: http.StatusOK + NewListBySubscriptionPager func(options *armapicenter.DeletedServicesClientListBySubscriptionOptions) (resp azfake.PagerResponder[armapicenter.DeletedServicesClientListBySubscriptionResponse]) +} + +// NewDeletedServicesServerTransport creates a new instance of DeletedServicesServerTransport with the provided implementation. +// The returned DeletedServicesServerTransport instance is connected to an instance of armapicenter.DeletedServicesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewDeletedServicesServerTransport(srv *DeletedServicesServer) *DeletedServicesServerTransport { + return &DeletedServicesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armapicenter.DeletedServicesClientListResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armapicenter.DeletedServicesClientListBySubscriptionResponse]](), + } +} + +// DeletedServicesServerTransport connects instances of armapicenter.DeletedServicesClient to instances of DeletedServicesServer. +// Don't use this type directly, use NewDeletedServicesServerTransport instead. +type DeletedServicesServerTransport struct { + srv *DeletedServicesServer + newListPager *tracker[azfake.PagerResponder[armapicenter.DeletedServicesClientListResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armapicenter.DeletedServicesClientListBySubscriptionResponse]] +} + +// Do implements the policy.Transporter interface for DeletedServicesServerTransport. +func (d *DeletedServicesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "DeletedServicesClient.Delete": + resp, err = d.dispatchDelete(req) + case "DeletedServicesClient.Get": + resp, err = d.dispatchGet(req) + case "DeletedServicesClient.NewListPager": + resp, err = d.dispatchNewListPager(req) + case "DeletedServicesClient.NewListBySubscriptionPager": + resp, err = d.dispatchNewListBySubscriptionPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (d *DeletedServicesServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if d.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ApiCenter/deletedServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + deletedServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deletedServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Delete(req.Context(), resourceGroupNameParam, deletedServiceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DeletedServicesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if d.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ApiCenter/deletedServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + deletedServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("deletedServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, deletedServiceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DeletedService, req) + if err != nil { + return nil, err + } + if val := server.GetResponse(respr).ETag; val != nil { + resp.Header.Set("ETag", *val) + } + return resp, nil +} + +func (d *DeletedServicesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := d.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ApiCenter/deletedServices` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) + if err != nil { + return nil, err + } + filterParam := getOptional(filterUnescaped) + var options *armapicenter.DeletedServicesClientListOptions + if filterParam != nil { + options = &armapicenter.DeletedServicesClientListOptions{ + Filter: filterParam, + } + } + resp := d.srv.NewListPager(resourceGroupNameParam, options) + newListPager = &resp + d.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armapicenter.DeletedServicesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + d.newListPager.remove(req) + } + return resp, nil +} + +func (d *DeletedServicesServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { + if d.srv.NewListBySubscriptionPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} + } + newListBySubscriptionPager := d.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.ApiCenter/deletedServices` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resp := d.srv.NewListBySubscriptionPager(nil) + newListBySubscriptionPager = &resp + d.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armapicenter.DeletedServicesClientListBySubscriptionResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListBySubscriptionPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListBySubscriptionPager) { + d.newListBySubscriptionPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/apicenter/armapicenter/fake/server_factory.go b/sdk/resourcemanager/apicenter/armapicenter/fake/server_factory.go index b6506db18d8e..2c238177f1e7 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/fake/server_factory.go +++ b/sdk/resourcemanager/apicenter/armapicenter/fake/server_factory.go @@ -22,6 +22,7 @@ type ServerFactory struct { APIDefinitionsServer APIDefinitionsServer APIVersionsServer APIVersionsServer ApisServer ApisServer + DeletedServicesServer DeletedServicesServer DeploymentsServer DeploymentsServer EnvironmentsServer EnvironmentsServer MetadataSchemasServer MetadataSchemasServer @@ -47,6 +48,7 @@ type ServerFactoryTransport struct { trAPIDefinitionsServer *APIDefinitionsServerTransport trAPIVersionsServer *APIVersionsServerTransport trApisServer *ApisServerTransport + trDeletedServicesServer *DeletedServicesServerTransport trDeploymentsServer *DeploymentsServerTransport trEnvironmentsServer *EnvironmentsServerTransport trMetadataSchemasServer *MetadataSchemasServerTransport @@ -79,6 +81,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "ApisClient": initServer(s, &s.trApisServer, func() *ApisServerTransport { return NewApisServerTransport(&s.srv.ApisServer) }) resp, err = s.trApisServer.Do(req) + case "DeletedServicesClient": + initServer(s, &s.trDeletedServicesServer, func() *DeletedServicesServerTransport { + return NewDeletedServicesServerTransport(&s.srv.DeletedServicesServer) + }) + resp, err = s.trDeletedServicesServer.Do(req) case "DeploymentsClient": initServer(s, &s.trDeploymentsServer, func() *DeploymentsServerTransport { return NewDeploymentsServerTransport(&s.srv.DeploymentsServer) }) resp, err = s.trDeploymentsServer.Do(req) diff --git a/sdk/resourcemanager/apicenter/armapicenter/go.mod b/sdk/resourcemanager/apicenter/armapicenter/go.mod index 5f320f2d5ac2..cc4ea4dbca20 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/go.mod +++ b/sdk/resourcemanager/apicenter/armapicenter/go.mod @@ -4,13 +4,13 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/stretchr/testify v1.9.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/sdk/resourcemanager/apicenter/armapicenter/metadataschemas_client.go b/sdk/resourcemanager/apicenter/armapicenter/metadataschemas_client.go index a65c76d753b9..f050f410c940 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/metadataschemas_client.go +++ b/sdk/resourcemanager/apicenter/armapicenter/metadataschemas_client.go @@ -46,7 +46,7 @@ func NewMetadataSchemasClient(subscriptionID string, credential azcore.TokenCred // CreateOrUpdate - Creates new or updates existing metadata schema. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - metadataSchemaName - The name of the metadata schema. @@ -99,7 +99,7 @@ func (client *MetadataSchemasClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -123,7 +123,7 @@ func (client *MetadataSchemasClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Deletes specified metadata schema. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - metadataSchemaName - The name of the metadata schema. @@ -173,7 +173,7 @@ func (client *MetadataSchemasClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +182,7 @@ func (client *MetadataSchemasClient) deleteCreateRequest(ctx context.Context, re // Get - Returns details of the metadata schema. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - metadataSchemaName - The name of the metadata schema. @@ -233,7 +233,7 @@ func (client *MetadataSchemasClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +253,7 @@ func (client *MetadataSchemasClient) getHandleResponse(resp *http.Response) (Met // Head - Checks if specified metadata schema exists. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - metadataSchemaName - The name of the metadata schema. @@ -303,7 +303,7 @@ func (client *MetadataSchemasClient) headCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -311,7 +311,7 @@ func (client *MetadataSchemasClient) headCreateRequest(ctx context.Context, reso // NewListPager - Returns a collection of metadata schemas. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - options - MetadataSchemasClientListOptions contains the optional parameters for the MetadataSchemasClient.NewListPager @@ -362,7 +362,7 @@ func (client *MetadataSchemasClient) listCreateRequest(ctx context.Context, reso if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apicenter/armapicenter/metadataschemas_client_example_test.go b/sdk/resourcemanager/apicenter/armapicenter/metadataschemas_client_example_test.go deleted file mode 100644 index a2719de48396..000000000000 --- a/sdk/resourcemanager/apicenter/armapicenter/metadataschemas_client_example_test.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armapicenter_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_List.json -func ExampleMetadataSchemasClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMetadataSchemasClient().NewListPager("contoso-resources", "contoso", &armapicenter.MetadataSchemasClientListOptions{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.MetadataSchemaListResult = armapicenter.MetadataSchemaListResult{ - // Value: []*armapicenter.MetadataSchema{ - // { - // Name: to.Ptr("author"), - // Type: to.Ptr("Microsoft.ApiCenter/services/metadataSchemas"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/metadataSchemas/author"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.MetadataSchemaProperties{ - // Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"), - // AssignedTo: []*armapicenter.MetadataAssignment{ - // { - // Deprecated: to.Ptr(true), - // Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Get.json -func ExampleMetadataSchemasClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMetadataSchemasClient().Get(ctx, "contoso-resources", "contoso", "lastName", 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.MetadataSchema = armapicenter.MetadataSchema{ - // Name: to.Ptr("author"), - // Type: to.Ptr("Microsoft.ApiCenter/services/metadataSchemas"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/metadataSchemas/author"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.MetadataSchemaProperties{ - // Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"), - // AssignedTo: []*armapicenter.MetadataAssignment{ - // { - // Deprecated: to.Ptr(true), - // Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_CreateOrUpdate.json -func ExampleMetadataSchemasClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMetadataSchemasClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "author", armapicenter.MetadataSchema{}, 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.MetadataSchema = armapicenter.MetadataSchema{ - // Name: to.Ptr("author"), - // Type: to.Ptr("Microsoft.ApiCenter/services/metadataSchemas"), - // ID: to.Ptr("/subscriptions/a200340d-6b82-494d-9dbf-687ba6e33f9e/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/metadataSchemas/author"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.MetadataSchemaProperties{ - // Schema: to.Ptr("{\"type\":\"string\", \"title\":\"Author\", pattern: \"^[a-zA-Z]+$\"}"), - // AssignedTo: []*armapicenter.MetadataAssignment{ - // { - // Deprecated: to.Ptr(true), - // Entity: to.Ptr(armapicenter.MetadataAssignmentEntityAPI), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Delete.json -func ExampleMetadataSchemasClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewMetadataSchemasClient().Delete(ctx, "contoso-resources", "contoso", "author", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/MetadataSchemas_Head.json -func ExampleMetadataSchemasClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewMetadataSchemasClient().Head(ctx, "contoso-resources", "contoso", "author", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apicenter/armapicenter/models.go b/sdk/resourcemanager/apicenter/armapicenter/models.go index c9b0738a5521..9a2a1a3be5a3 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/models.go +++ b/sdk/resourcemanager/apicenter/armapicenter/models.go @@ -196,6 +196,44 @@ type Contact struct { URL *string } +// DeletedService - Soft-deleted service entity. +type DeletedService struct { + // The resource-specific properties for this resource. + Properties *DeletedServiceProperties + + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// DeletedServiceListResult - The response of a DeletedService list operation. +type DeletedServiceListResult struct { + // READ-ONLY; The DeletedService items on this page + Value []*DeletedService + + // READ-ONLY; The link to the next page of items + NextLink *string +} + +// DeletedServiceProperties - Deleted service properties. +type DeletedServiceProperties struct { + // UTC date and time when the service will be automatically purged. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ + // as specified by the ISO 8601 standard. + ScheduledPurgeDate *time.Time + + // UTC date and time when the service was soft-deleted. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as + // specified by the ISO 8601 standard. + SoftDeletionDate *time.Time +} + // Deployment - API deployment entity. type Deployment struct { // The resource-specific properties for this resource. @@ -513,6 +551,9 @@ type ServiceListResult struct { // ServiceProperties - The properties of the service. type ServiceProperties struct { + // Flag used to restore soft-deleted API Center service. If specified and set to 'true' all other properties will be ignored. + Restore *bool + // READ-ONLY; Provisioning state of the service. ProvisioningState *ProvisioningState } @@ -522,10 +563,19 @@ type ServiceUpdate struct { // The managed service identities assigned to this resource. Identity *ManagedServiceIdentity + // The resource-specific properties for this resource. + Properties *ServiceUpdateProperties + // Resource tags. Tags map[string]*string } +// ServiceUpdateProperties - The updatable properties of the Service. +type ServiceUpdateProperties struct { + // Flag used to restore soft-deleted API Center service. If specified and set to 'true' all other properties will be ignored. + Restore *bool +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). diff --git a/sdk/resourcemanager/apicenter/armapicenter/models_serde.go b/sdk/resourcemanager/apicenter/armapicenter/models_serde.go index daf60b417e31..c65a0a1b3a71 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/models_serde.go +++ b/sdk/resourcemanager/apicenter/armapicenter/models_serde.go @@ -529,6 +529,111 @@ func (c *Contact) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DeletedService. +func (d DeletedService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedService. +func (d *DeletedService) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedServiceListResult. +func (d DeletedServiceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServiceListResult. +func (d *DeletedServiceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedServiceProperties. +func (d DeletedServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "scheduledPurgeDate", d.ScheduledPurgeDate) + populateDateTimeRFC3339(objectMap, "softDeletionDate", d.SoftDeletionDate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServiceProperties. +func (d *DeletedServiceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "scheduledPurgeDate": + err = unpopulateDateTimeRFC3339(val, "ScheduledPurgeDate", &d.ScheduledPurgeDate) + delete(rawMsg, key) + case "softDeletionDate": + err = unpopulateDateTimeRFC3339(val, "SoftDeletionDate", &d.SoftDeletionDate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Deployment. func (d Deployment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1374,6 +1479,7 @@ func (s *ServiceListResult) UnmarshalJSON(data []byte) error { func (s ServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "restore", s.Restore) return json.Marshal(objectMap) } @@ -1389,6 +1495,9 @@ func (s *ServiceProperties) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) + case "restore": + err = unpopulate(val, "Restore", &s.Restore) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1401,6 +1510,7 @@ func (s *ServiceProperties) UnmarshalJSON(data []byte) error { func (s ServiceUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "identity", s.Identity) + populate(objectMap, "properties", s.Properties) populate(objectMap, "tags", s.Tags) return json.Marshal(objectMap) } @@ -1417,6 +1527,9 @@ func (s *ServiceUpdate) UnmarshalJSON(data []byte) error { case "identity": err = unpopulate(val, "Identity", &s.Identity) delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) @@ -1428,6 +1541,33 @@ func (s *ServiceUpdate) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ServiceUpdateProperties. +func (s ServiceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "restore", s.Restore) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceUpdateProperties. +func (s *ServiceUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "restore": + err = unpopulate(val, "Restore", &s.Restore) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/apicenter/armapicenter/operations_client.go b/sdk/resourcemanager/apicenter/armapicenter/operations_client.go index ccfa9fd15c18..6e7324bdfcbd 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/operations_client.go +++ b/sdk/resourcemanager/apicenter/armapicenter/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-03-01 +// Generated from API version 2024-03-15-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -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-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apicenter/armapicenter/operations_client_example_test.go b/sdk/resourcemanager/apicenter/armapicenter/operations_client_example_test.go deleted file mode 100644 index 6ddc58d5824d..000000000000 --- a/sdk/resourcemanager/apicenter/armapicenter/operations_client_example_test.go +++ /dev/null @@ -1,56 +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 armapicenter_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Operations_List.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 := armapicenter.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 = armapicenter.OperationListResult{ - // Value: []*armapicenter.Operation{ - // { - // Name: to.Ptr("Microsoft.ApiCenter/services/read"), - // Display: &armapicenter.OperationDisplay{ - // Description: to.Ptr("Lists registered services"), - // Operation: to.Ptr("Lists services"), - // Provider: to.Ptr("Microsoft.ApiCenter"), - // Resource: to.Ptr("services"), - // }, - // IsDataAction: to.Ptr(false), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/apicenter/armapicenter/options.go b/sdk/resourcemanager/apicenter/armapicenter/options.go index 7bd7574e65a2..e554f9ccbb3d 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/options.go +++ b/sdk/resourcemanager/apicenter/armapicenter/options.go @@ -101,6 +101,28 @@ type ApisClientListOptions struct { Filter *string } +// DeletedServicesClientDeleteOptions contains the optional parameters for the DeletedServicesClient.Delete method. +type DeletedServicesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DeletedServicesClientGetOptions contains the optional parameters for the DeletedServicesClient.Get method. +type DeletedServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DeletedServicesClientListBySubscriptionOptions contains the optional parameters for the DeletedServicesClient.NewListBySubscriptionPager +// method. +type DeletedServicesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// DeletedServicesClientListOptions contains the optional parameters for the DeletedServicesClient.NewListPager method. +type DeletedServicesClientListOptions struct { + // OData filter parameter. + Filter *string +} + // DeploymentsClientCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.CreateOrUpdate method. type DeploymentsClientCreateOrUpdateOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/apicenter/armapicenter/responses.go b/sdk/resourcemanager/apicenter/armapicenter/responses.go index dd70dfd5b3f8..76653899e854 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/responses.go +++ b/sdk/resourcemanager/apicenter/armapicenter/responses.go @@ -124,6 +124,32 @@ type ApisClientListResponse struct { APIListResult } +// DeletedServicesClientDeleteResponse contains the response from method DeletedServicesClient.Delete. +type DeletedServicesClientDeleteResponse struct { + // placeholder for future response values +} + +// DeletedServicesClientGetResponse contains the response from method DeletedServicesClient.Get. +type DeletedServicesClientGetResponse struct { + // Soft-deleted service entity. + DeletedService + + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// DeletedServicesClientListBySubscriptionResponse contains the response from method DeletedServicesClient.NewListBySubscriptionPager. +type DeletedServicesClientListBySubscriptionResponse struct { + // The response of a DeletedService list operation. + DeletedServiceListResult +} + +// DeletedServicesClientListResponse contains the response from method DeletedServicesClient.NewListPager. +type DeletedServicesClientListResponse struct { + // The response of a DeletedService list operation. + DeletedServiceListResult +} + // DeploymentsClientCreateOrUpdateResponse contains the response from method DeploymentsClient.CreateOrUpdate. type DeploymentsClientCreateOrUpdateResponse struct { // API deployment entity. diff --git a/sdk/resourcemanager/apicenter/armapicenter/services_client.go b/sdk/resourcemanager/apicenter/armapicenter/services_client.go index cadf0979e3e3..95e6bbef6e4b 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/services_client.go +++ b/sdk/resourcemanager/apicenter/armapicenter/services_client.go @@ -46,7 +46,7 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates new or updates existing API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - resource - Resource create parameters. @@ -93,7 +93,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -114,7 +114,7 @@ func (client *ServicesClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes specified service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - options - ServicesClientDeleteOptions contains the optional parameters for the ServicesClient.Delete method. @@ -159,7 +159,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -168,7 +168,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // BeginExportMetadataSchema - Exports the effective metadata schema. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - body - The content of the action request @@ -195,7 +195,7 @@ func (client *ServicesClient) BeginExportMetadataSchema(ctx context.Context, res // ExportMetadataSchema - Exports the effective metadata schema. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview func (client *ServicesClient) exportMetadataSchema(ctx context.Context, resourceGroupName string, serviceName string, body MetadataSchemaExportRequest, options *ServicesClientBeginExportMetadataSchemaOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginExportMetadataSchema" @@ -237,7 +237,7 @@ func (client *ServicesClient) exportMetadataSchemaCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -249,7 +249,7 @@ func (client *ServicesClient) exportMetadataSchemaCreateRequest(ctx context.Cont // Get - Returns details of the service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. @@ -295,7 +295,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -312,7 +312,7 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // NewListByResourceGroupPager - Returns a collection of services within the resource group. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager // method. @@ -355,7 +355,7 @@ func (client *ServicesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -372,7 +372,7 @@ func (client *ServicesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Lists services within an Azure subscription. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager // method. func (client *ServicesClient) NewListBySubscriptionPager(options *ServicesClientListBySubscriptionOptions) *runtime.Pager[ServicesClientListBySubscriptionResponse] { @@ -410,7 +410,7 @@ func (client *ServicesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -428,7 +428,7 @@ func (client *ServicesClient) listBySubscriptionHandleResponse(resp *http.Respon // Update - Updates existing service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - properties - The resource properties to be updated. @@ -475,7 +475,7 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/apicenter/armapicenter/services_client_example_test.go b/sdk/resourcemanager/apicenter/armapicenter/services_client_example_test.go deleted file mode 100644 index fb461dc0ea47..000000000000 --- a/sdk/resourcemanager/apicenter/armapicenter/services_client_example_test.go +++ /dev/null @@ -1,300 +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 armapicenter_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/apicenter/armapicenter" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_ListBySubscription.json -func ExampleServicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().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.ServiceListResult = armapicenter.ServiceListResult{ - // Value: []*armapicenter.Service{ - // { - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/services"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // }, - // Identity: &armapicenter.ManagedServiceIdentity{ - // Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armapicenter.ServiceProperties{ - // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_ListByResourceGroup.json -func ExampleServicesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListByResourceGroupPager("contoso-resources", 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.ServiceListResult = armapicenter.ServiceListResult{ - // Value: []*armapicenter.Service{ - // { - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/services"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // }, - // Identity: &armapicenter.ManagedServiceIdentity{ - // Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armapicenter.ServiceProperties{ - // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Get.json -func ExampleServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Get(ctx, "contoso-resources", "contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armapicenter.Service{ - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/services"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // }, - // Identity: &armapicenter.ManagedServiceIdentity{ - // Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armapicenter.ServiceProperties{ - // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_CreateOrUpdate.json -func ExampleServicesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", armapicenter.Service{ - Location: to.Ptr("East US"), - Tags: map[string]*string{}, - Identity: &armapicenter.ManagedServiceIdentity{ - Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), - UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {}, - }, - }, - Properties: &armapicenter.ServiceProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armapicenter.Service{ - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/services"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // }, - // Identity: &armapicenter.ManagedServiceIdentity{ - // Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armapicenter.ServiceProperties{ - // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Update.json -func ExampleServicesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Update(ctx, "contoso-resources", "contoso", armapicenter.ServiceUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armapicenter.Service{ - // Name: to.Ptr("contoso"), - // Type: to.Ptr("Microsoft.ApiCenter/services"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // }, - // Identity: &armapicenter.ManagedServiceIdentity{ - // Type: to.Ptr(armapicenter.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armapicenter.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armapicenter.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armapicenter.ServiceProperties{ - // ProvisioningState: to.Ptr(armapicenter.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_Delete.json -func ExampleServicesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewServicesClient().Delete(ctx, "contoso-resources", "contoso", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Services_ExportMetadataSchema.json -func ExampleServicesClient_BeginExportMetadataSchema() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginExportMetadataSchema(ctx, "contoso-resources", "contoso", armapicenter.MetadataSchemaExportRequest{}, 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.MetadataSchemaExportResult = armapicenter.MetadataSchemaExportResult{ - // Format: to.Ptr(armapicenter.MetadataSchemaExportFormat("json-schema")), - // Value: to.Ptr("{\"type\":\"object\",\"properties\":{ ... }}"), - // } -} diff --git a/sdk/resourcemanager/apicenter/armapicenter/workspaces_client.go b/sdk/resourcemanager/apicenter/armapicenter/workspaces_client.go index 2a83f1c40101..cbda77109b8b 100644 --- a/sdk/resourcemanager/apicenter/armapicenter/workspaces_client.go +++ b/sdk/resourcemanager/apicenter/armapicenter/workspaces_client.go @@ -46,7 +46,7 @@ func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates new or updates existing workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -99,7 +99,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -123,7 +123,7 @@ func (client *WorkspacesClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes specified workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -173,7 +173,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +182,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Returns details of the workspace. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -233,7 +233,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +253,7 @@ func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (Workspac // Head - Checks if specified workspace exists. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - workspaceName - The name of the workspace. @@ -303,7 +303,7 @@ func (client *WorkspacesClient) headCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -311,7 +311,7 @@ func (client *WorkspacesClient) headCreateRequest(ctx context.Context, resourceG // NewListPager - Returns a collection of workspaces. // -// Generated from API version 2024-03-01 +// Generated from API version 2024-03-15-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - serviceName - The name of Azure API Center service. // - options - WorkspacesClientListOptions contains the optional parameters for the WorkspacesClient.NewListPager method. @@ -361,7 +361,7 @@ func (client *WorkspacesClient) listCreateRequest(ctx context.Context, resourceG if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-03-01") + reqQP.Set("api-version", "2024-03-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apicenter/armapicenter/workspaces_client_example_test.go b/sdk/resourcemanager/apicenter/armapicenter/workspaces_client_example_test.go deleted file mode 100644 index 10109a9fda0f..000000000000 --- a/sdk/resourcemanager/apicenter/armapicenter/workspaces_client_example_test.go +++ /dev/null @@ -1,156 +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 armapicenter_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apicenter/armapicenter" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_List.json -func ExampleWorkspacesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspacesClient().NewListPager("contoso-resources", "contoso", &armapicenter.WorkspacesClientListOptions{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.WorkspaceListResult = armapicenter.WorkspaceListResult{ - // Value: []*armapicenter.Workspace{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.WorkspaceProperties{ - // Title: to.Ptr("default"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Get.json -func ExampleWorkspacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().Get(ctx, "contoso-resources", "contoso", "default", 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.Workspace = armapicenter.Workspace{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.WorkspaceProperties{ - // Title: to.Ptr("default"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_CreateOrUpdate.json -func ExampleWorkspacesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspacesClient().CreateOrUpdate(ctx, "contoso-resources", "contoso", "default", armapicenter.Workspace{}, 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.Workspace = armapicenter.Workspace{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.ApiCenter/services/workspaces"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default"), - // SystemData: &armapicenter.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-03T18:27:09.128Z"); return t}()), - // }, - // Properties: &armapicenter.WorkspaceProperties{ - // Title: to.Ptr("default"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Delete.json -func ExampleWorkspacesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewWorkspacesClient().Delete(ctx, "contoso-resources", "contoso", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d4205894880b989ede35d62d97c8e901ed14fb5a/specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/examples/Workspaces_Head.json -func ExampleWorkspacesClient_Head() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armapicenter.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewWorkspacesClient().Head(ctx, "contoso-resources", "contoso", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/CHANGELOG.md b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/CHANGELOG.md index bd0c34b7f51f..1a84bf2d079e 100644 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/CHANGELOG.md +++ b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.0.1 (2024-08-16) +### Other Changes + + ## 1.0.0 (2024-06-21) ### Breaking Changes diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/autorest.md b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/autorest.md index 184d755b1053..413c07da9e6f 100644 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/autorest.md +++ b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appcomplianceautomation/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appcomplianceautomation/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2024-06 +module-version: 1.0.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/constants.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/constants.go index 8669e3642a58..0a4e159d5e8c 100644 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/constants.go +++ b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/constants.go @@ -10,7 +10,7 @@ package armappcomplianceautomation const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" - moduleVersion = "v1.0.0" + moduleVersion = "v1.0.1" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/evidence_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/evidence_client_example_test.go deleted file mode 100644 index 253b2cf2fe1e..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/evidence_client_example_test.go +++ /dev/null @@ -1,200 +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 armappcomplianceautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_ListByReport.json -func ExampleEvidenceClient_NewListByReportPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewEvidenceClient().NewListByReportPager("reportName", &armappcomplianceautomation.EvidenceClientListByReportOptions{SkipToken: nil, - Top: nil, - Select: nil, - Filter: nil, - Orderby: nil, - OfferGUID: nil, - ReportCreatorTenantID: 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.EvidenceResourceListResult = armappcomplianceautomation.EvidenceResourceListResult{ - // Value: []*armappcomplianceautomation.EvidenceResource{ - // { - // Name: to.Ptr("evidence1"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/evidences"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/evidences/evidence1"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.EvidenceProperties{ - // ControlID: to.Ptr("Operational_Security_10"), - // EvidenceType: to.Ptr(armappcomplianceautomation.EvidenceTypeFile), - // ExtraData: to.Ptr("sampleData"), - // FilePath: to.Ptr("/acat-container/evidence1.png"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // ResponsibilityID: to.Ptr("authorized_ip_ranges_should_be_defined_on_kubernetes_services"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_Get.json -func ExampleEvidenceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEvidenceClient().Get(ctx, "testReportName", "evidence1", 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.EvidenceResource = armappcomplianceautomation.EvidenceResource{ - // Name: to.Ptr("evidence1"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/evidences"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/evidences/evidence1"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.EvidenceProperties{ - // ControlID: to.Ptr("Operational_Security_10"), - // EvidenceType: to.Ptr(armappcomplianceautomation.EvidenceTypeFile), - // ExtraData: to.Ptr("sampleData"), - // FilePath: to.Ptr("/acat-container/evidence1.png"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // ResponsibilityID: to.Ptr("authorized_ip_ranges_should_be_defined_on_kubernetes_services"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_CreateOrUpdate.json -func ExampleEvidenceClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEvidenceClient().CreateOrUpdate(ctx, "testReportName", "evidence1", armappcomplianceautomation.EvidenceResource{}, &armappcomplianceautomation.EvidenceClientCreateOrUpdateOptions{OfferGUID: nil, - ReportCreatorTenantID: 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.EvidenceResource = armappcomplianceautomation.EvidenceResource{ - // Name: to.Ptr("evidence1"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/evidences"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/evidences/evidence1"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.EvidenceProperties{ - // ControlID: to.Ptr("Operational_Security_10"), - // EvidenceType: to.Ptr(armappcomplianceautomation.EvidenceTypeFile), - // ExtraData: to.Ptr("sampleData"), - // FilePath: to.Ptr("/acat-container/evidence1.png"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // ResponsibilityID: to.Ptr("authorized_ip_ranges_should_be_defined_on_kubernetes_services"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_Delete.json -func ExampleEvidenceClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewEvidenceClient().Delete(ctx, "testReportName", "evidence1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_Download.json -func ExampleEvidenceClient_Download() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewEvidenceClient().Download(ctx, "testReportName", "evidence1", armappcomplianceautomation.EvidenceFileDownloadRequest{}, 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.EvidenceFileDownloadResponse = armappcomplianceautomation.EvidenceFileDownloadResponse{ - // EvidenceFile: &armappcomplianceautomation.EvidenceFileDownloadResponseEvidenceFile{ - // URL: to.Ptr("this is a url"), - // }, - // } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.mod b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.mod index 8b2b0d6e3f47..e4e7d558d758 100644 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.mod +++ b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautoma go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.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.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.sum b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.sum +++ b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -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.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -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.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.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/appcomplianceautomation/armappcomplianceautomation/operations_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/operations_client_example_test.go deleted file mode 100644 index 7b2492f0a03f..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/operations_client_example_test.go +++ /dev/null @@ -1,56 +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 armappcomplianceautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Operations_List.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 := armappcomplianceautomation.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 = armappcomplianceautomation.OperationListResult{ - // Value: []*armappcomplianceautomation.Operation{ - // { - // Name: to.Ptr("Microsoft.AppComplianceAutomation/reports/write"), - // Display: &armappcomplianceautomation.OperationDisplay{ - // Description: to.Ptr("Create new reports."), - // Operation: to.Ptr("Microsoft.AppComplianceAutomation/reports/write"), - // Provider: to.Ptr("Microsoft AppComplianceAutomation"), - // Resource: to.Ptr("Microsoft.AppComplianceAutomation/reports"), - // }, - // IsDataAction: to.Ptr(false), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/provideractions_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/provideractions_client_example_test.go deleted file mode 100644 index a2f22ce4e86d..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/provideractions_client_example_test.go +++ /dev/null @@ -1,251 +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 armappcomplianceautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_CheckNameAvailability.json -func ExampleProviderActionsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderActionsClient().CheckNameAvailability(ctx, armappcomplianceautomation.CheckNameAvailabilityRequest{}, 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.CheckNameAvailabilityResponse = armappcomplianceautomation.CheckNameAvailabilityResponse{ - // Message: to.Ptr("An report named 'reportABC' is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armappcomplianceautomation.CheckNameAvailabilityReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_GetCollectionCount.json -func ExampleProviderActionsClient_GetCollectionCount() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderActionsClient().GetCollectionCount(ctx, armappcomplianceautomation.GetCollectionCountRequest{}, 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.GetCollectionCountResponse = armappcomplianceautomation.GetCollectionCountResponse{ - // Count: to.Ptr[int32](100), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_GetOverviewStatus.json -func ExampleProviderActionsClient_GetOverviewStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderActionsClient().GetOverviewStatus(ctx, armappcomplianceautomation.GetOverviewStatusRequest{}, 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.GetOverviewStatusResponse = armappcomplianceautomation.GetOverviewStatusResponse{ - // StatusList: []*armappcomplianceautomation.StatusItem{ - // { - // StatusName: to.Ptr("Active"), - // StatusValue: to.Ptr("100"), - // }, - // { - // StatusName: to.Ptr("Failed"), - // StatusValue: to.Ptr("0"), - // }, - // { - // StatusName: to.Ptr("Disabled"), - // StatusValue: to.Ptr("0"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ListInUseStorageAccountsWithSubscriptions.json -func ExampleProviderActionsClient_ListInUseStorageAccounts_listInUseStorageAccountsWithSubscriptions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderActionsClient().ListInUseStorageAccounts(ctx, armappcomplianceautomation.ListInUseStorageAccountsRequest{}, 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.ListInUseStorageAccountsResponse = armappcomplianceautomation.ListInUseStorageAccountsResponse{ - // StorageAccountList: []*armappcomplianceautomation.StorageInfo{ - // { - // AccountName: to.Ptr("SA_name1"), - // Location: to.Ptr("WEST US"), - // ResourceGroup: to.Ptr("tetsRG"), - // SubscriptionID: to.Ptr("0000000-0000-0000-0000-000000000001"), - // }, - // { - // AccountName: to.Ptr("SA_name2"), - // Location: to.Ptr("WEST US"), - // ResourceGroup: to.Ptr("tetsRG"), - // SubscriptionID: to.Ptr("0000000-0000-0000-0000-000000000001"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ListInUseStorageAccountsWithoutSubscriptions.json -func ExampleProviderActionsClient_ListInUseStorageAccounts_listInUseStorageAccountsWithoutSubscriptions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProviderActionsClient().ListInUseStorageAccounts(ctx, armappcomplianceautomation.ListInUseStorageAccountsRequest{}, 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.ListInUseStorageAccountsResponse = armappcomplianceautomation.ListInUseStorageAccountsResponse{ - // StorageAccountList: []*armappcomplianceautomation.StorageInfo{ - // { - // AccountName: to.Ptr("SA_name1"), - // Location: to.Ptr("WEST US"), - // ResourceGroup: to.Ptr("tetsRG"), - // SubscriptionID: to.Ptr("0000000-0000-0000-0000-000000000001"), - // }, - // { - // AccountName: to.Ptr("SA_name2"), - // Location: to.Ptr("WEST US"), - // ResourceGroup: to.Ptr("tetsRG"), - // SubscriptionID: to.Ptr("0000000-0000-0000-0000-000000000001"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Onboard.json -func ExampleProviderActionsClient_BeginOnboard() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProviderActionsClient().BeginOnboard(ctx, armappcomplianceautomation.OnboardRequest{}, 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.OnboardResponse = armappcomplianceautomation.OnboardResponse{ - // SubscriptionIDs: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000"), - // to.Ptr("00000000-0000-0000-0000-000000000001")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/TriggerEvaluation.json -func ExampleProviderActionsClient_BeginTriggerEvaluation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProviderActionsClient().BeginTriggerEvaluation(ctx, armappcomplianceautomation.TriggerEvaluationRequest{}, 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.TriggerEvaluationResponse = armappcomplianceautomation.TriggerEvaluationResponse{ - // Properties: &armappcomplianceautomation.TriggerEvaluationProperty{ - // EvaluationEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T05:10:00.000Z"); return t}()), - // QuickAssessments: []*armappcomplianceautomation.QuickAssessment{ - // { - // Description: to.Ptr("Protect your storage accounts from potential threats using virtual network rules as a preferred method instead of IP-based filtering. Disabling IP-based filtering prevents public IPs from accessing your storage accounts."), - // DisplayName: to.Ptr("Storage accounts should restrict network access using virtual network rules"), - // RemediationLink: to.Ptr("Protect your storage accounts from potential threats using virtual network rules as a preferred method instead of IP-based filtering. Disabling IP-based filtering prevents public IPs from accessing your storage accounts."), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storettas3iw2megtcarm"), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusHealthy), - // ResponsibilityID: to.Ptr("/providers/microsoft.authorization/policydefinitions/2a1a9cdf-e04d-429a-8416-3bfb72a1b26f"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T05:00:00.000Z"); return t}()), - // }, - // { - // Description: to.Ptr(""), - // DisplayName: to.Ptr("Secure transfer to storage accounts should be enabled"), - // RemediationLink: to.Ptr(""), - // ResourceID: to.Ptr("/subscriptions/0000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storettas3iw2megtcarm"), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusUnhealthy), - // ResponsibilityID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/404c3081-a854-4457-ae30-26a93ef643f9"), - // Timestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T05:00:00.000Z"); return t}()), - // }}, - // ResourceIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storettas3iw2megtcarm")}, - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T05:00:00.000Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/report_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/report_client_example_test.go deleted file mode 100644 index 87bec1aea3a6..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/report_client_example_test.go +++ /dev/null @@ -1,648 +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 armappcomplianceautomation_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/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_List.json -func ExampleReportClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewReportClient().NewListPager(&armappcomplianceautomation.ReportClientListOptions{SkipToken: to.Ptr("1"), - Top: to.Ptr[int32](100), - Select: nil, - Filter: nil, - Orderby: nil, - OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000000"), - ReportCreatorTenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }) - 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.ReportResourceListResult = armappcomplianceautomation.ReportResourceListResult{ - // Value: []*armappcomplianceautomation.ReportResource{ - // { - // Name: to.Ptr("testReportName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ReportProperties{ - // CertRecords: []*armappcomplianceautomation.CertSyncRecord{ - // { - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // { - // ControlID: to.Ptr("Operational_Security_10"), - // ControlStatus: to.Ptr("Approved"), - // }}, - // IngestionStatus: to.Ptr("EvidenceResubmitted"), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }}, - // ComplianceStatus: &armappcomplianceautomation.ReportComplianceStatus{ - // M365: &armappcomplianceautomation.OverviewStatus{ - // FailedCount: to.Ptr[int32](0), - // ManualCount: to.Ptr[int32](0), - // NotApplicableCount: to.Ptr[int32](0), - // PassedCount: to.Ptr[int32](0), - // PendingCount: to.Ptr[int32](0), - // }, - // }, - // Errors: []*string{ - // }, - // LastTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // NextTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // Resources: []*armappcomplianceautomation.ResourceMetadata{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceType: to.Ptr("iam.user"), - // }}, - // Status: to.Ptr(armappcomplianceautomation.ReportStatusActive), - // StorageInfo: &armappcomplianceautomation.StorageInfo{ - // AccountName: to.Ptr("testStorageAccount"), - // Location: to.Ptr("East US"), - // ResourceGroup: to.Ptr("testResourceGroup"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Subscriptions: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TimeZone: to.Ptr("GMT Standard Time"), - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Get.json -func ExampleReportClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReportClient().Get(ctx, "testReport", 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.ReportResource = armappcomplianceautomation.ReportResource{ - // Name: to.Ptr("testReportName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ReportProperties{ - // CertRecords: []*armappcomplianceautomation.CertSyncRecord{ - // { - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // { - // ControlID: to.Ptr("Operational_Security_10"), - // ControlStatus: to.Ptr("Approved"), - // }}, - // IngestionStatus: to.Ptr("EvidenceResubmitted"), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }}, - // ComplianceStatus: &armappcomplianceautomation.ReportComplianceStatus{ - // M365: &armappcomplianceautomation.OverviewStatus{ - // FailedCount: to.Ptr[int32](0), - // ManualCount: to.Ptr[int32](0), - // PassedCount: to.Ptr[int32](0), - // }, - // }, - // Errors: []*string{ - // to.Ptr("resource-inaccessible")}, - // LastTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // NextTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // Resources: []*armappcomplianceautomation.ResourceMetadata{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceType: to.Ptr("iam.user"), - // }}, - // Status: to.Ptr(armappcomplianceautomation.ReportStatusFailed), - // StorageInfo: &armappcomplianceautomation.StorageInfo{ - // AccountName: to.Ptr("testStorageAccount"), - // Location: to.Ptr("East US"), - // ResourceGroup: to.Ptr("testResourceGroup"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Subscriptions: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TimeZone: to.Ptr("GMT Standard Time"), - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_CreateOrUpdate.json -func ExampleReportClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReportClient().BeginCreateOrUpdate(ctx, "testReportName", armappcomplianceautomation.ReportResource{}, 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.ReportResource = armappcomplianceautomation.ReportResource{ - // Name: to.Ptr("testReportName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ReportProperties{ - // CertRecords: []*armappcomplianceautomation.CertSyncRecord{ - // { - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // { - // ControlID: to.Ptr("Operational_Security_10"), - // ControlStatus: to.Ptr("Approved"), - // }}, - // IngestionStatus: to.Ptr("EvidenceResubmitted"), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }}, - // ComplianceStatus: &armappcomplianceautomation.ReportComplianceStatus{ - // M365: &armappcomplianceautomation.OverviewStatus{ - // FailedCount: to.Ptr[int32](0), - // ManualCount: to.Ptr[int32](0), - // PassedCount: to.Ptr[int32](0), - // }, - // }, - // LastTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // NextTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // Resources: []*armappcomplianceautomation.ResourceMetadata{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceType: to.Ptr("iam.user"), - // }}, - // Status: to.Ptr(armappcomplianceautomation.ReportStatusActive), - // StorageInfo: &armappcomplianceautomation.StorageInfo{ - // AccountName: to.Ptr("testStorageAccount"), - // Location: to.Ptr("East US"), - // ResourceGroup: to.Ptr("testResourceGroup"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Subscriptions: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TimeZone: to.Ptr("GMT Standard Time"), - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Update.json -func ExampleReportClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReportClient().BeginUpdate(ctx, "testReportName", armappcomplianceautomation.ReportResourcePatch{}, 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.ReportResource = armappcomplianceautomation.ReportResource{ - // Name: to.Ptr("testReportName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ReportProperties{ - // CertRecords: []*armappcomplianceautomation.CertSyncRecord{ - // { - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // { - // ControlID: to.Ptr("Operational_Security_10"), - // ControlStatus: to.Ptr("Approved"), - // }}, - // IngestionStatus: to.Ptr("EvidenceResubmitted"), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }}, - // ComplianceStatus: &armappcomplianceautomation.ReportComplianceStatus{ - // M365: &armappcomplianceautomation.OverviewStatus{ - // FailedCount: to.Ptr[int32](0), - // ManualCount: to.Ptr[int32](0), - // PassedCount: to.Ptr[int32](0), - // }, - // }, - // LastTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // NextTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // Resources: []*armappcomplianceautomation.ResourceMetadata{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceType: to.Ptr("iam.user"), - // }}, - // Status: to.Ptr(armappcomplianceautomation.ReportStatusActive), - // StorageInfo: &armappcomplianceautomation.StorageInfo{ - // AccountName: to.Ptr("testStorageAccount"), - // Location: to.Ptr("East US"), - // ResourceGroup: to.Ptr("testResourceGroup"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Subscriptions: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TimeZone: to.Ptr("GMT Standard Time"), - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-02T05:00:00.000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Delete.json -func ExampleReportClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReportClient().BeginDelete(ctx, "testReportName", 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/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_NestedResourceCheckNameAvailability_Report_Evidence_Check_Name_Availability.json -func ExampleReportClient_NestedResourceCheckNameAvailability_reportEvidenceCheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReportClient().NestedResourceCheckNameAvailability(ctx, "reportABC", armappcomplianceautomation.CheckNameAvailabilityRequest{}, 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.CheckNameAvailabilityResponse = armappcomplianceautomation.CheckNameAvailabilityResponse{ - // Message: to.Ptr("An evidence named 'evidenceABC' is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armappcomplianceautomation.CheckNameAvailabilityReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_NestedResourceCheckNameAvailability_Report_Snapshot_Check_Name_Availability.json -func ExampleReportClient_NestedResourceCheckNameAvailability_reportSnapshotCheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReportClient().NestedResourceCheckNameAvailability(ctx, "reportABC", armappcomplianceautomation.CheckNameAvailabilityRequest{}, 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.CheckNameAvailabilityResponse = armappcomplianceautomation.CheckNameAvailabilityResponse{ - // Message: to.Ptr("An snapshot named 'snapshotABC' is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armappcomplianceautomation.CheckNameAvailabilityReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_NestedResourceCheckNameAvailability_Report_Webhook_Check_Name_Availability.json -func ExampleReportClient_NestedResourceCheckNameAvailability_reportWebhookCheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReportClient().NestedResourceCheckNameAvailability(ctx, "reportABC", armappcomplianceautomation.CheckNameAvailabilityRequest{}, 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.CheckNameAvailabilityResponse = armappcomplianceautomation.CheckNameAvailabilityResponse{ - // Message: to.Ptr("An webhook named 'webhookABC' is already in use."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr(armappcomplianceautomation.CheckNameAvailabilityReasonAlreadyExists), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Fix.json -func ExampleReportClient_BeginFix() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReportClient().BeginFix(ctx, "testReport", 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.ReportFixResult = armappcomplianceautomation.ReportFixResult{ - // Reason: to.Ptr(""), - // Result: to.Ptr(armappcomplianceautomation.ResultSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_GetScopingQuestions.json -func ExampleReportClient_GetScopingQuestions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewReportClient().GetScopingQuestions(ctx, "testReportName", 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.ScopingQuestions = armappcomplianceautomation.ScopingQuestions{ - // Questions: []*armappcomplianceautomation.ScopingQuestion{ - // { - // InputType: to.Ptr(armappcomplianceautomation.InputTypeBoolean), - // OptionIDs: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G07_customerDataProcess"), - // Rules: []*armappcomplianceautomation.Rule{ - // to.Ptr(armappcomplianceautomation.RuleRequired)}, - // ShowSubQuestionsValue: to.Ptr("true"), - // }, - // { - // InputType: to.Ptr(armappcomplianceautomation.InputTypeText), - // OptionIDs: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G04_graphPermissionData"), - // Rules: []*armappcomplianceautomation.Rule{ - // to.Ptr(armappcomplianceautomation.RuleRequired), - // to.Ptr(armappcomplianceautomation.RuleCharLength)}, - // SuperiorQuestionID: to.Ptr("DHP_G07_customerDataProcess"), - // }, - // { - // InputType: to.Ptr(armappcomplianceautomation.InputTypeBoolean), - // OptionIDs: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G06_customerDataStorage"), - // Rules: []*armappcomplianceautomation.Rule{ - // to.Ptr(armappcomplianceautomation.RuleRequired)}, - // ShowSubQuestionsValue: to.Ptr("true"), - // }, - // { - // InputType: to.Ptr(armappcomplianceautomation.InputTypeText), - // OptionIDs: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G05_graphPermissionInfo"), - // Rules: []*armappcomplianceautomation.Rule{ - // to.Ptr(armappcomplianceautomation.RuleRequired), - // to.Ptr(armappcomplianceautomation.RuleCharLength), - // to.Ptr(armappcomplianceautomation.RulePreventNonEnglishChar)}, - // SuperiorQuestionID: to.Ptr("DHP_G06_customerDataStorage"), - // }, - // { - // InputType: to.Ptr(armappcomplianceautomation.InputTypeMultiSelectDropdown), - // OptionIDs: []*string{ - // to.Ptr("Croatia"), - // to.Ptr("Cuba"), - // to.Ptr("Curaçao"), - // to.Ptr("Cyprus"), - // to.Ptr("Czechia"), - // to.Ptr("Côte d'Ivoire"), - // to.Ptr("Denmark"), - // to.Ptr("Djibouti"), - // to.Ptr("Dominica"), - // to.Ptr("Dominican Republic (the)"), - // to.Ptr("Ecuador"), - // to.Ptr("Egypt")}, - // QuestionID: to.Ptr("DHP_G08_storageLocation"), - // Rules: []*armappcomplianceautomation.Rule{ - // to.Ptr(armappcomplianceautomation.RuleRequired)}, - // SuperiorQuestionID: to.Ptr("DHP_G06_customerDataStorage"), - // }, - // { - // InputType: to.Ptr(armappcomplianceautomation.InputType("SingleSelectEnum")), - // OptionIDs: []*string{ - // }, - // QuestionID: to.Ptr("LEG03_complianceDataTermination"), - // Rules: []*armappcomplianceautomation.Rule{ - // to.Ptr(armappcomplianceautomation.RuleRequired)}, - // SuperiorQuestionID: to.Ptr("DHP_G06_customerDataStorage"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_SyncCertRecord.json -func ExampleReportClient_BeginSyncCertRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReportClient().BeginSyncCertRecord(ctx, "testReportName", armappcomplianceautomation.SyncCertRecordRequest{}, 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.SyncCertRecordResponse = armappcomplianceautomation.SyncCertRecordResponse{ - // CertRecord: &armappcomplianceautomation.CertSyncRecord{ - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // }, - // IngestionStatus: to.Ptr("InitialDocumentResubmitted"), - // OfferGUID: to.Ptr("addb13fc-64bf-4005-b693-4c2f094e2187"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Verify.json -func ExampleReportClient_BeginVerify() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewReportClient().BeginVerify(ctx, "testReport", 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.ReportVerificationResult = armappcomplianceautomation.ReportVerificationResult{ - // Reason: to.Ptr(""), - // Result: to.Ptr(armappcomplianceautomation.ResultSucceeded), - // } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/scopingconfiguration_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/scopingconfiguration_client_example_test.go deleted file mode 100644 index d1776617c95f..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/scopingconfiguration_client_example_test.go +++ /dev/null @@ -1,196 +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 armappcomplianceautomation_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_List.json -func ExampleScopingConfigurationClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewScopingConfigurationClient().NewListPager("testReportName", 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.ScopingConfigurationResourceListResult = armappcomplianceautomation.ScopingConfigurationResourceListResult{ - // Value: []*armappcomplianceautomation.ScopingConfigurationResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppComplianceAutomation/reports/scopingConfigurations"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/scopingConfigurations/default"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ScopingConfigurationProperties{ - // Answers: []*armappcomplianceautomation.ScopingAnswer{ - // { - // Answers: []*string{ - // to.Ptr("Azure")}, - // QuestionID: to.Ptr("GEN20_hostingEnvironment"), - // }, - // { - // Answers: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G07_customerDataProcess"), - // }, - // { - // Answers: []*string{ - // }, - // QuestionID: to.Ptr("Tier2InitSub_serviceCommunicate"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_Get.json -func ExampleScopingConfigurationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScopingConfigurationClient().Get(ctx, "testReportName", "default", 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.ScopingConfigurationResource = armappcomplianceautomation.ScopingConfigurationResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppComplianceAutomation/reports/scopingConfigurations"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/scopingConfigurations/default"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ScopingConfigurationProperties{ - // Answers: []*armappcomplianceautomation.ScopingAnswer{ - // { - // Answers: []*string{ - // to.Ptr("Azure")}, - // QuestionID: to.Ptr("GEN20_hostingEnvironment"), - // }, - // { - // Answers: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G07_customerDataProcess"), - // }, - // { - // Answers: []*string{ - // }, - // QuestionID: to.Ptr("Tier2InitSub_serviceCommunicate"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_CreateOrUpdate.json -func ExampleScopingConfigurationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewScopingConfigurationClient().CreateOrUpdate(ctx, "testReportName", "default", armappcomplianceautomation.ScopingConfigurationResource{}, 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.ScopingConfigurationResource = armappcomplianceautomation.ScopingConfigurationResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppComplianceAutomation/reports/scopingConfigurations"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/scopingConfigurations/default"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.ScopingConfigurationProperties{ - // Answers: []*armappcomplianceautomation.ScopingAnswer{ - // { - // Answers: []*string{ - // to.Ptr("Azure")}, - // QuestionID: to.Ptr("GEN20_hostingEnvironment"), - // }, - // { - // Answers: []*string{ - // }, - // QuestionID: to.Ptr("DHP_G07_customerDataProcess"), - // }, - // { - // Answers: []*string{ - // }, - // QuestionID: to.Ptr("Tier2InitSub_serviceCommunicate"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_Delete.json -func ExampleScopingConfigurationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewScopingConfigurationClient().Delete(ctx, "testReportName", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/snapshot_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/snapshot_client_example_test.go deleted file mode 100644 index 59f00b07c210..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/snapshot_client_example_test.go +++ /dev/null @@ -1,520 +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 armappcomplianceautomation_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/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_List.json -func ExampleSnapshotClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSnapshotClient().NewListPager("testReportName", &armappcomplianceautomation.SnapshotClientListOptions{SkipToken: to.Ptr("1"), - Top: to.Ptr[int32](100), - Select: nil, - Filter: nil, - Orderby: nil, - OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - ReportCreatorTenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }) - 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.SnapshotResourceListResult = armappcomplianceautomation.SnapshotResourceListResult{ - // Value: []*armappcomplianceautomation.SnapshotResource{ - // { - // Name: to.Ptr("testSnapshot"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/snapshots"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/snapshots/testSnapshot"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.SnapshotProperties{ - // ComplianceResults: []*armappcomplianceautomation.ComplianceResult{ - // { - // Categories: []*armappcomplianceautomation.Category{ - // { - // CategoryName: to.Ptr("Operational Security"), - // CategoryStatus: to.Ptr(armappcomplianceautomation.CategoryStatusPassed), - // ControlFamilies: []*armappcomplianceautomation.ControlFamily{ - // { - // ControlFamilyName: to.Ptr("Incident Response"), - // ControlFamilyStatus: to.Ptr(armappcomplianceautomation.ControlFamilyStatusPassed), - // Controls: []*armappcomplianceautomation.Control{ - // { - // ControlDescription: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlDescriptionHyperLink: to.Ptr("https://aka.ms/acat/m365cert/operational/control73"), - // ControlFullName: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlID: to.Ptr("Operational_Security_75"), - // ControlName: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlStatus: to.Ptr(armappcomplianceautomation.ControlStatusPassed), - // Responsibilities: []*armappcomplianceautomation.Responsibility{ - // { - // EvidenceFiles: []*string{ - // to.Ptr("https://management.azure.com/providers/Microsoft.AppComplianceAutomation/reports/reportABC/fileName?api-version=2024-06-27")}, - // FailedResourceCount: to.Ptr[int32](0), - // Guidance: to.Ptr("Please upload the screen capture file to ACAT service."), - // Justification: to.Ptr("Here is my evidence files"), - // RecommendationList: []*armappcomplianceautomation.Recommendation{ - // { - // RecommendationID: to.Ptr("failed_reason_1"), - // RecommendationShortName: to.Ptr("Invalid TLS Config"), - // RecommendationSolutions: []*armappcomplianceautomation.RecommendationSolution{ - // { - // IsRecommendSolution: to.Ptr(armappcomplianceautomation.IsRecommendSolutionTrue), - // RecommendationSolutionContent: to.Ptr("Setting minimal TLS version to 1.2 improves security by ensuring your SQL Managed Instance can only be accessed from clients using TLS 1.2. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities"), - // RecommendationSolutionIndex: to.Ptr("1"), - // }}, - // }, - // { - // RecommendationID: to.Ptr("failed_reason_2"), - // RecommendationShortName: to.Ptr("Invalid AWS TLS Config"), - // RecommendationSolutions: []*armappcomplianceautomation.RecommendationSolution{ - // { - // IsRecommendSolution: to.Ptr(armappcomplianceautomation.IsRecommendSolutionTrue), - // RecommendationSolutionContent: to.Ptr("Open the AWS related service, and set its TLS version to 1.2 or higher version."), - // RecommendationSolutionIndex: to.Ptr("1"), - // }}, - // }}, - // ResourceList: []*armappcomplianceautomation.ResponsibilityResource{ - // { - // RecommendationIDs: []*string{ - // to.Ptr("failed_reason_1")}, - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusUnhealthy), - // ResourceStatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T16:17:20.150Z"); return t}()), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // RecommendationIDs: []*string{ - // to.Ptr("failed_reason_2")}, - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusUnhealthy), - // ResourceStatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T16:17:20.150Z"); return t}()), - // ResourceType: to.Ptr("iam.user"), - // }}, - // ResponsibilityDescription: to.Ptr("Restrict access to the Kubernetes Service Management API by granting API access only to IP addresses in specific ranges. It is recommended to limit access to authorized IP ranges to ensure that only applications from allowed networks can access the cluster."), - // ResponsibilityEnvironment: to.Ptr(armappcomplianceautomation.ResponsibilityEnvironmentAzure), - // ResponsibilityID: to.Ptr("authorized_ip_ranges_should_be_defined_on_kubernetes_services"), - // ResponsibilitySeverity: to.Ptr(armappcomplianceautomation.ResponsibilitySeverityHigh), - // ResponsibilityStatus: to.Ptr(armappcomplianceautomation.ResponsibilityStatusPassed), - // ResponsibilityTitle: to.Ptr("Authorized IP ranges should be defined on Kubernetes Services"), - // ResponsibilityType: to.Ptr(armappcomplianceautomation.ResponsibilityTypeAutomated), - // TotalResourceCount: to.Ptr[int32](1), - // }}, - // }}, - // }}, - // }}, - // ComplianceName: to.Ptr("M365"), - // }}, - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:33:59.160Z"); return t}()), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // ReportProperties: &armappcomplianceautomation.ReportProperties{ - // CertRecords: []*armappcomplianceautomation.CertSyncRecord{ - // { - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // { - // ControlID: to.Ptr("Operational_Security_10"), - // ControlStatus: to.Ptr("Approved"), - // }}, - // IngestionStatus: to.Ptr("EvidenceResubmitted"), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }}, - // ComplianceStatus: &armappcomplianceautomation.ReportComplianceStatus{ - // M365: &armappcomplianceautomation.OverviewStatus{ - // FailedCount: to.Ptr[int32](0), - // ManualCount: to.Ptr[int32](0), - // NotApplicableCount: to.Ptr[int32](0), - // PassedCount: to.Ptr[int32](0), - // PendingCount: to.Ptr[int32](0), - // }, - // }, - // Errors: []*string{ - // }, - // LastTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:00:00.000Z"); return t}()), - // NextTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:00:00.000Z"); return t}()), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // Resources: []*armappcomplianceautomation.ResourceMetadata{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceType: to.Ptr("iam.user"), - // }}, - // Status: to.Ptr(armappcomplianceautomation.ReportStatusActive), - // StorageInfo: &armappcomplianceautomation.StorageInfo{ - // AccountName: to.Ptr("testStorageAccount"), - // Location: to.Ptr("East US"), - // ResourceGroup: to.Ptr("testResourceGroup"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Subscriptions: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TimeZone: to.Ptr("GMT Standard Time"), - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:00:00.000Z"); return t}()), - // }, - // ReportSystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // SnapshotName: to.Ptr("testSnapshot"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Get.json -func ExampleSnapshotClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSnapshotClient().Get(ctx, "testReportName", "testSnapshot", 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.SnapshotResource = armappcomplianceautomation.SnapshotResource{ - // Name: to.Ptr("testSnapshot"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/snapshots"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/snapshots/testSnapshot"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.SnapshotProperties{ - // ComplianceResults: []*armappcomplianceautomation.ComplianceResult{ - // { - // Categories: []*armappcomplianceautomation.Category{ - // { - // CategoryName: to.Ptr("Operational Security"), - // CategoryStatus: to.Ptr(armappcomplianceautomation.CategoryStatusPassed), - // ControlFamilies: []*armappcomplianceautomation.ControlFamily{ - // { - // ControlFamilyName: to.Ptr("Incident Response"), - // ControlFamilyStatus: to.Ptr(armappcomplianceautomation.ControlFamilyStatusPassed), - // Controls: []*armappcomplianceautomation.Control{ - // { - // ControlDescription: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlDescriptionHyperLink: to.Ptr("https://aka.ms/acat/m365cert/operational/control73"), - // ControlFullName: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlID: to.Ptr("Operational_Security_75"), - // ControlName: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlStatus: to.Ptr(armappcomplianceautomation.ControlStatusPassed), - // Responsibilities: []*armappcomplianceautomation.Responsibility{ - // { - // EvidenceFiles: []*string{ - // to.Ptr("https://management.azure.com/providers/Microsoft.AppComplianceAutomation/reports/reportABC/fileName?api-version=2024-06-27")}, - // FailedResourceCount: to.Ptr[int32](0), - // Guidance: to.Ptr("Please upload the screen capture file to ACAT service."), - // Justification: to.Ptr("Here is my evidence files"), - // RecommendationList: []*armappcomplianceautomation.Recommendation{ - // { - // RecommendationID: to.Ptr("failed_reason_1"), - // RecommendationShortName: to.Ptr("Invalid TLS Config"), - // RecommendationSolutions: []*armappcomplianceautomation.RecommendationSolution{ - // { - // IsRecommendSolution: to.Ptr(armappcomplianceautomation.IsRecommendSolutionTrue), - // RecommendationSolutionContent: to.Ptr("Setting minimal TLS version to 1.2 improves security by ensuring your SQL Managed Instance can only be accessed from clients using TLS 1.2. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities"), - // RecommendationSolutionIndex: to.Ptr("1"), - // }}, - // }, - // { - // RecommendationID: to.Ptr("failed_reason_2"), - // RecommendationShortName: to.Ptr("Invalid AWS TLS Config"), - // RecommendationSolutions: []*armappcomplianceautomation.RecommendationSolution{ - // { - // IsRecommendSolution: to.Ptr(armappcomplianceautomation.IsRecommendSolutionTrue), - // RecommendationSolutionContent: to.Ptr("Open the AWS related service, and set its TLS version to 1.2 or higher version."), - // RecommendationSolutionIndex: to.Ptr("1"), - // }}, - // }}, - // ResourceList: []*armappcomplianceautomation.ResponsibilityResource{ - // { - // RecommendationIDs: []*string{ - // to.Ptr("failed_reason_1")}, - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusUnhealthy), - // ResourceStatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T16:17:20.150Z"); return t}()), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // RecommendationIDs: []*string{ - // to.Ptr("failed_reason_2")}, - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusUnhealthy), - // ResourceStatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T16:17:20.150Z"); return t}()), - // ResourceType: to.Ptr("iam.user"), - // }}, - // ResponsibilityDescription: to.Ptr("Restrict access to the Kubernetes Service Management API by granting API access only to IP addresses in specific ranges. It is recommended to limit access to authorized IP ranges to ensure that only applications from allowed networks can access the cluster."), - // ResponsibilityEnvironment: to.Ptr(armappcomplianceautomation.ResponsibilityEnvironmentAzure), - // ResponsibilityID: to.Ptr("authorized_ip_ranges_should_be_defined_on_kubernetes_services"), - // ResponsibilitySeverity: to.Ptr(armappcomplianceautomation.ResponsibilitySeverityHigh), - // ResponsibilityStatus: to.Ptr(armappcomplianceautomation.ResponsibilityStatusPassed), - // ResponsibilityTitle: to.Ptr("Authorized IP ranges should be defined on Kubernetes Services"), - // ResponsibilityType: to.Ptr(armappcomplianceautomation.ResponsibilityTypeAutomated), - // TotalResourceCount: to.Ptr[int32](1), - // }}, - // }}, - // }}, - // }}, - // ComplianceName: to.Ptr("M365"), - // }}, - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:33:59.160Z"); return t}()), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // ReportProperties: &armappcomplianceautomation.ReportProperties{ - // CertRecords: []*armappcomplianceautomation.CertSyncRecord{ - // { - // CertificationStatus: to.Ptr("CertIngestion"), - // Controls: []*armappcomplianceautomation.ControlSyncRecord{ - // { - // ControlID: to.Ptr("Operational_Security_10"), - // ControlStatus: to.Ptr("Approved"), - // }}, - // IngestionStatus: to.Ptr("EvidenceResubmitted"), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001"), - // }}, - // ComplianceStatus: &armappcomplianceautomation.ReportComplianceStatus{ - // M365: &armappcomplianceautomation.OverviewStatus{ - // FailedCount: to.Ptr[int32](0), - // ManualCount: to.Ptr[int32](0), - // PassedCount: to.Ptr[int32](0), - // }, - // }, - // Errors: []*string{ - // }, - // LastTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:00:00.000Z"); return t}()), - // NextTriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:00:00.000Z"); return t}()), - // OfferGUID: to.Ptr("00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // Resources: []*armappcomplianceautomation.ResourceMetadata{ - // { - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // }, - // { - // AccountID: to.Ptr("000000000000"), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/acat-aws/providers/microsoft.security/securityconnectors/acatawsconnector/securityentitydata/aws-iam-user-testuser"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAWS), - // ResourceType: to.Ptr("iam.user"), - // }}, - // Status: to.Ptr(armappcomplianceautomation.ReportStatusActive), - // StorageInfo: &armappcomplianceautomation.StorageInfo{ - // AccountName: to.Ptr("testStorageAccount"), - // Location: to.Ptr("East US"), - // ResourceGroup: to.Ptr("testResourceGroup"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // Subscriptions: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TimeZone: to.Ptr("GMT Standard Time"), - // TriggerTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-04T15:00:00.000Z"); return t}()), - // }, - // ReportSystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // SnapshotName: to.Ptr("testSnapshot"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Download_Snapshot_Download_Compliance_Detailed_Pdf_Report.json -func ExampleSnapshotClient_BeginDownload_snapshotDownloadComplianceDetailedPdfReport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotClient().BeginDownload(ctx, "testReportName", "testSnapshotName", armappcomplianceautomation.SnapshotDownloadRequest{}, 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.DownloadResponse = armappcomplianceautomation.DownloadResponse{ - // ComplianceDetailedPDFReport: &armappcomplianceautomation.DownloadResponseComplianceDetailedPDFReport{ - // SasURI: to.Ptr("this is a uri"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Download_Snapshot_Download_Compliance_Pdf_Report.json -func ExampleSnapshotClient_BeginDownload_snapshotDownloadCompliancePdfReport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotClient().BeginDownload(ctx, "testReportName", "testSnapshotName", armappcomplianceautomation.SnapshotDownloadRequest{}, 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.DownloadResponse = armappcomplianceautomation.DownloadResponse{ - // CompliancePDFReport: &armappcomplianceautomation.DownloadResponseCompliancePDFReport{ - // SasURI: to.Ptr("this is uri of report"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Download_Snapshot_Download_Compliance_Report.json -func ExampleSnapshotClient_BeginDownload_snapshotDownloadComplianceReport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotClient().BeginDownload(ctx, "testReportName", "testSnapshotName", armappcomplianceautomation.SnapshotDownloadRequest{}, 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.DownloadResponse = armappcomplianceautomation.DownloadResponse{ - // ComplianceReport: []*armappcomplianceautomation.ComplianceReportItem{ - // { - // CategoryName: to.Ptr("Data Security & Privacy"), - // ControlFamilyName: to.Ptr("Incident Response"), - // ControlID: to.Ptr("Operational_Security_75"), - // ControlName: to.Ptr("Provide demonstrable evidence that all member of the incident response team have completed annual training or a table top exercise"), - // ControlStatus: to.Ptr(armappcomplianceautomation.ControlStatusPassed), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/Microsoft.SignalRService/SignalR/mySignalRService"), - // ResourceOrigin: to.Ptr(armappcomplianceautomation.ResourceOriginAzure), - // ResourceStatus: to.Ptr(armappcomplianceautomation.ResourceStatusHealthy), - // ResourceStatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T16:17:20.150Z"); return t}()), - // ResourceType: to.Ptr("Microsoft.SignalRService/SignalR"), - // ResponsibilityDescription: to.Ptr("Restrict access to the Kubernetes Service Management API by granting API access only to IP addresses in specific ranges. It is recommended to limit access to authorized IP ranges to ensure that only applications from allowed networks can access the cluster."), - // ResponsibilityTitle: to.Ptr("Authorized IP ranges should be defined on Kubernetes Services"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Download_Snapshot_Download_Resource_List.json -func ExampleSnapshotClient_BeginDownload_snapshotDownloadResourceList() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotClient().BeginDownload(ctx, "testReportName", "testSnapshotName", armappcomplianceautomation.SnapshotDownloadRequest{}, 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.DownloadResponse = armappcomplianceautomation.DownloadResponse{ - // ResourceList: []*armappcomplianceautomation.ResourceItem{ - // { - // ResourceGroup: to.Ptr("myResourceGroup"), - // ResourceID: to.Ptr("mySignalRService"), - // ResourceType: to.Ptr("SignalR"), - // SubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }}, - // } -} diff --git a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/webhook_client_example_test.go b/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/webhook_client_example_test.go deleted file mode 100644 index 5583577e6dad..000000000000 --- a/sdk/resourcemanager/appcomplianceautomation/armappcomplianceautomation/webhook_client_example_test.go +++ /dev/null @@ -1,239 +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 armappcomplianceautomation_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/appcomplianceautomation/armappcomplianceautomation" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_List.json -func ExampleWebhookClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWebhookClient().NewListPager("testReportName", &armappcomplianceautomation.WebhookClientListOptions{SkipToken: to.Ptr("1"), - Top: to.Ptr[int32](100), - Select: nil, - Filter: nil, - Orderby: nil, - OfferGUID: nil, - ReportCreatorTenantID: 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.WebhookResourceListResult = armappcomplianceautomation.WebhookResourceListResult{ - // Value: []*armappcomplianceautomation.WebhookResource{ - // { - // Name: to.Ptr("testWebhookName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/webhooks"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/snapshots/testWebhookName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.WebhookProperties{ - // ContentType: to.Ptr(armappcomplianceautomation.ContentTypeApplicationJSON), - // DeliveryStatus: to.Ptr(armappcomplianceautomation.DeliveryStatusSucceeded), - // EnableSSLVerification: to.Ptr(armappcomplianceautomation.EnableSSLVerificationTrue), - // Events: []*armappcomplianceautomation.NotificationEvent{ - // to.Ptr(armappcomplianceautomation.NotificationEventGenerateSnapshotFailed)}, - // PayloadURL: to.Ptr("https://example.com"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // SendAllEvents: to.Ptr(armappcomplianceautomation.SendAllEventsFalse), - // Status: to.Ptr(armappcomplianceautomation.WebhookStatusEnabled), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookKeyEnabled: to.Ptr(armappcomplianceautomation.WebhookKeyEnabledFalse), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_Get.json -func ExampleWebhookClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebhookClient().Get(ctx, "testReportName", "testWebhookName", 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.WebhookResource = armappcomplianceautomation.WebhookResource{ - // Name: to.Ptr("testWebhookName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/webhooks"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/webhooks/testWebhookName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.WebhookProperties{ - // ContentType: to.Ptr(armappcomplianceautomation.ContentTypeApplicationJSON), - // DeliveryStatus: to.Ptr(armappcomplianceautomation.DeliveryStatusSucceeded), - // EnableSSLVerification: to.Ptr(armappcomplianceautomation.EnableSSLVerificationTrue), - // Events: []*armappcomplianceautomation.NotificationEvent{ - // to.Ptr(armappcomplianceautomation.NotificationEventGenerateSnapshotFailed)}, - // PayloadURL: to.Ptr("https://example.com"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // SendAllEvents: to.Ptr(armappcomplianceautomation.SendAllEventsFalse), - // Status: to.Ptr(armappcomplianceautomation.WebhookStatusEnabled), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookKeyEnabled: to.Ptr(armappcomplianceautomation.WebhookKeyEnabledTrue), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_CreateOrUpdate.json -func ExampleWebhookClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebhookClient().CreateOrUpdate(ctx, "testReportName", "testWebhookName", armappcomplianceautomation.WebhookResource{}, 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.WebhookResource = armappcomplianceautomation.WebhookResource{ - // Name: to.Ptr("testWebhookName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/webhooks"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/webhooks/testWebhookName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.WebhookProperties{ - // ContentType: to.Ptr(armappcomplianceautomation.ContentTypeApplicationJSON), - // DeliveryStatus: to.Ptr(armappcomplianceautomation.DeliveryStatusSucceeded), - // EnableSSLVerification: to.Ptr(armappcomplianceautomation.EnableSSLVerificationTrue), - // Events: []*armappcomplianceautomation.NotificationEvent{ - // to.Ptr(armappcomplianceautomation.NotificationEventGenerateSnapshotFailed)}, - // PayloadURL: to.Ptr("https://example.com"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // SendAllEvents: to.Ptr(armappcomplianceautomation.SendAllEventsFalse), - // Status: to.Ptr(armappcomplianceautomation.WebhookStatusEnabled), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookKeyEnabled: to.Ptr(armappcomplianceautomation.WebhookKeyEnabledTrue), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_Update.json -func ExampleWebhookClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWebhookClient().Update(ctx, "testReportName", "testWebhookName", armappcomplianceautomation.WebhookResourcePatch{}, 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.WebhookResource = armappcomplianceautomation.WebhookResource{ - // Name: to.Ptr("testWebhookName"), - // Type: to.Ptr("Microsfot.AppComplianceAutomation/reports/webhooks"), - // ID: to.Ptr("/provider/Microsfot.AppComplianceAutomation/reports/testReportName/testWebhookName"), - // SystemData: &armappcomplianceautomation.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // CreatedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // CreatedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-14T22:34:55.449Z"); return t}()), - // LastModifiedBy: to.Ptr("00000000-0000-0000-0000-000000000000"), - // LastModifiedByType: to.Ptr(armappcomplianceautomation.CreatedByTypeUser), - // }, - // Properties: &armappcomplianceautomation.WebhookProperties{ - // ContentType: to.Ptr(armappcomplianceautomation.ContentTypeApplicationJSON), - // DeliveryStatus: to.Ptr(armappcomplianceautomation.DeliveryStatusSucceeded), - // EnableSSLVerification: to.Ptr(armappcomplianceautomation.EnableSSLVerificationTrue), - // Events: []*armappcomplianceautomation.NotificationEvent{ - // to.Ptr(armappcomplianceautomation.NotificationEventGenerateSnapshotFailed)}, - // PayloadURL: to.Ptr("https://example.com"), - // ProvisioningState: to.Ptr(armappcomplianceautomation.ProvisioningStateSucceeded), - // SendAllEvents: to.Ptr(armappcomplianceautomation.SendAllEventsFalse), - // Status: to.Ptr(armappcomplianceautomation.WebhookStatusEnabled), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // WebhookKeyEnabled: to.Ptr(armappcomplianceautomation.WebhookKeyEnabledTrue), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d88c94b22a8efdd47c0cadfe6d8d489107db2b23/specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_Delete.json -func ExampleWebhookClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcomplianceautomation.NewClientFactory(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewWebhookClient().Delete(ctx, "testReportName", "testWebhookName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md b/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md index b61979e0d279..d50874c737cb 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md +++ b/sdk/resourcemanager/computefleet/armcomputefleet/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 0.1.1 (2024-08-16) +### Other Changes + + ## 0.1.0 (2024-07-26) ### Other Changes diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/constants.go b/sdk/resourcemanager/computefleet/armcomputefleet/constants.go index c49940367a6f..823dc40ad57f 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/constants.go +++ b/sdk/resourcemanager/computefleet/armcomputefleet/constants.go @@ -6,7 +6,7 @@ package armcomputefleet const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet" - moduleVersion = "v0.1.0" + moduleVersion = "v0.1.1" ) // ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go b/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go new file mode 100644 index 000000000000..e31a88f00c6a --- /dev/null +++ b/sdk/resourcemanager/computefleet/armcomputefleet/fleets_client_example_test.go @@ -0,0 +1,3114 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armcomputefleet_test + +import ( + "context" + "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/computefleet/armcomputefleet" + "log" +) + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_CreateOrUpdate.json +func ExampleFleetsClient_BeginCreateOrUpdate_fleetsCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewFleetsClient().BeginCreateOrUpdate(ctx, "rgazurefleet", "testFleet", armcomputefleet.Fleet{ + Properties: &armcomputefleet.FleetProperties{ + SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + Capacity: to.Ptr[int32](20), + MinCapacity: to.Ptr[int32](10), + MaxPricePerVM: to.Ptr[float32](0.00865), + EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + Maintain: to.Ptr(true), + }, + RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + Capacity: to.Ptr[int32](20), + MinCapacity: to.Ptr[int32](10), + AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + }, + VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + { + Name: to.Ptr("Standard_d1_v2"), + Rank: to.Ptr[int32](19225), + }, + }, + ComputeProfile: &armcomputefleet.ComputeProfile{ + BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + ComputerNamePrefix: to.Ptr("o"), + AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + AdminPassword: to.Ptr("adfbrdxpv"), + CustomData: to.Ptr("xjjib"), + WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + ProvisionVMAgent: to.Ptr(true), + EnableAutomaticUpdates: to.Ptr(true), + TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + { + PassName: to.Ptr("OobeSystem"), + ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + Content: to.Ptr("bubmqbxjkj"), + }, + }, + PatchSettings: &armcomputefleet.PatchSettings{ + PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + EnableHotpatching: to.Ptr(true), + AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + }, + }, + WinRM: &armcomputefleet.WinRMConfiguration{ + Listeners: []*armcomputefleet.WinRMListener{ + { + Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), + CertificateURL: to.Ptr("phwesineizrl"), + }, + }, + }, + EnableVMAgentPlatformUpdates: to.Ptr(true), + }, + LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + DisablePasswordAuthentication: to.Ptr(true), + SSH: &armcomputefleet.SSHConfiguration{ + PublicKeys: []*armcomputefleet.SSHPublicKey{ + { + Path: to.Ptr("kmqz"), + KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + }, + }, + }, + ProvisionVMAgent: to.Ptr(true), + PatchSettings: &armcomputefleet.LinuxPatchSettings{ + PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + }, + }, + EnableVMAgentPlatformUpdates: to.Ptr(true), + }, + Secrets: []*armcomputefleet.VaultSecretGroup{ + { + SourceVault: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + }, + VaultCertificates: []*armcomputefleet.VaultCertificate{ + { + CertificateURL: to.Ptr("tyldwkzafmnkvpo"), + CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + }, + }, + }, + }, + AllowExtensionOperations: to.Ptr(true), + RequireGuestProvisionSignal: to.Ptr(true), + }, + StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + ImageReference: &armcomputefleet.ImageReference{ + Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + Offer: to.Ptr("isxgumkarlkomp"), + SKU: to.Ptr("eojmppqcrnpmxirtp"), + Version: to.Ptr("wvpcqefgtmqdgltiuz"), + SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + CommunityGalleryImageID: to.Ptr("vlqe"), + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + }, + OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + Name: to.Ptr("wfttw"), + Caching: to.Ptr(armcomputefleet.CachingTypesNone), + WriteAcceleratorEnabled: to.Ptr(true), + CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + }, + DiskSizeGB: to.Ptr[int32](14), + OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + Image: &armcomputefleet.VirtualHardDisk{ + URI: to.Ptr("thqceubivdrjs"), + }, + VhdContainers: []*string{ + to.Ptr("tkzcwddtinkfpnfklatw"), + }, + ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + }, + }, + DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + }, + DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + { + Name: to.Ptr("eogiykmdmeikswxmigjws"), + Lun: to.Ptr[int32](14), + Caching: to.Ptr(armcomputefleet.CachingTypesNone), + WriteAcceleratorEnabled: to.Ptr(true), + CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + DiskSizeGB: to.Ptr[int32](6), + ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + }, + }, + DiskIOPSReadWrite: to.Ptr[int64](27), + DiskMBpsReadWrite: to.Ptr[int64](2), + DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + }, + }, + }, + NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + HealthProbe: &armcomputefleet.APIEntityReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + }, + NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + { + Name: to.Ptr("i"), + Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + Primary: to.Ptr(true), + EnableAcceleratedNetworking: to.Ptr(true), + DisableTCPStateTracking: to.Ptr(true), + EnableFpga: to.Ptr(true), + NetworkSecurityGroup: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + }, + DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + DNSServers: []*string{ + to.Ptr("nxmmfolhclsesu"), + }, + }, + IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + { + Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + Subnet: &armcomputefleet.APIEntityReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + }, + Primary: to.Ptr(true), + PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + Name: to.Ptr("fvpqf"), + Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + IdleTimeoutInMinutes: to.Ptr[int32](9), + DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + }, + IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + { + IPTagType: to.Ptr("sddgsoemnzgqizale"), + Tag: to.Ptr("wufmhrjsakbiaetyara"), + }, + }, + PublicIPPrefix: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + }, + PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + }, + SKU: &armcomputefleet.PublicIPAddressSKU{ + Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + }, + }, + PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + }, + }, + ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + }, + }, + LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + }, + }, + LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + }, + }, + }, + }, + }, + EnableIPForwarding: to.Ptr(true), + DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + }, + }, + }, + NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersion20201101), + }, + SecurityProfile: &armcomputefleet.SecurityProfile{ + UefiSettings: &armcomputefleet.UefiSettings{ + SecureBootEnabled: to.Ptr(true), + VTpmEnabled: to.Ptr(true), + }, + EncryptionAtHost: to.Ptr(true), + SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + }, + ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + Enabled: to.Ptr(true), + Mode: to.Ptr(armcomputefleet.ModeAudit), + KeyIncarnationID: to.Ptr[int32](20), + }, + }, + DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + BootDiagnostics: &armcomputefleet.BootDiagnostics{ + Enabled: to.Ptr(true), + StorageURI: to.Ptr("rzamfwghybpx"), + }, + }, + ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + { + Name: to.Ptr("bndxuxx"), + Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + ForceUpdateTag: to.Ptr("yhgxw"), + Publisher: to.Ptr("kpxtirxjfprhs"), + Type: to.Ptr("pgjilctjjwaa"), + TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + AutoUpgradeMinorVersion: to.Ptr(true), + EnableAutomaticUpgrade: to.Ptr(true), + Settings: map[string]any{}, + ProtectedSettings: map[string]any{}, + ProvisionAfterExtensions: []*string{ + to.Ptr("nftzosroolbcwmpupujzqwqe"), + }, + SuppressFailures: to.Ptr(true), + ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + SecretURL: to.Ptr("vyhzfkqsqanacgzjthpjoe"), + SourceVault: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + }, + }, + }, + }, + }, + ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + }, + LicenseType: to.Ptr("v"), + ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + NotBeforeTimeout: to.Ptr("iljppmmw"), + Enable: to.Ptr(true), + }, + OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + Enable: to.Ptr(true), + }, + }, + UserData: to.Ptr("s"), + CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + CapacityReservationGroup: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + }, + }, + ApplicationProfile: &armcomputefleet.ApplicationProfile{ + GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + { + Tags: to.Ptr("eyrqjbib"), + Order: to.Ptr[int32](5), + PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + ConfigurationReference: to.Ptr("ulztmiavpojpbpbddgnuuiimxcpau"), + TreatFailureAsDeploymentFailure: to.Ptr(true), + EnableAutomaticUpgrade: to.Ptr(true), + }, + }, + }, + HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + VMSizeProperties: &armcomputefleet.VMSizeProperties{ + VCPUsAvailable: to.Ptr[int32](16), + VCPUsPerCore: to.Ptr[int32](23), + }, + }, + ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + }, + SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), + ExcludeExtensions: []*string{ + to.Ptr("{securityPostureVMExtensionName}"), + }, + IsOverridable: to.Ptr(true), + }, + }, + ComputeAPIVersion: to.Ptr("2023-07-01"), + PlatformFaultDomainCount: to.Ptr[int32](1), + }, + }, + Zones: []*string{ + to.Ptr("zone1"), + to.Ptr("zone2"), + }, + Identity: &armcomputefleet.ManagedServiceIdentity{ + Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ + "key9851": {}, + }, + }, + Tags: map[string]*string{ + "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), + }, + Location: to.Ptr("westus"), + Plan: &armcomputefleet.Plan{ + Name: to.Ptr("jwgrcrnrtfoxn"), + Publisher: to.Ptr("iozjbiqqckqm"), + Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), + PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), + Version: to.Ptr("wa"), + }, + }, 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 = armcomputefleet.FleetsClientCreateOrUpdateResponse{ + // Fleet: &armcomputefleet.Fleet{ + // Properties: &armcomputefleet.FleetProperties{ + // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + // Capacity: to.Ptr[int32](10), + // MinCapacity: to.Ptr[int32](20), + // MaxPricePerVM: to.Ptr[float32](0.00865), + // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + // Maintain: to.Ptr(true), + // }, + // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + // Capacity: to.Ptr[int32](10), + // MinCapacity: to.Ptr[int32](10), + // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + // }, + // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + // { + // Name: to.Ptr("Standard_d1_v2"), + // Rank: to.Ptr[int32](19225), + // }, + // }, + // ComputeProfile: &armcomputefleet.ComputeProfile{ + // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + // ComputerNamePrefix: to.Ptr("o"), + // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + // ProvisionVMAgent: to.Ptr(true), + // EnableAutomaticUpdates: to.Ptr(true), + // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + // { + // PassName: to.Ptr("OobeSystem"), + // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + // }, + // }, + // PatchSettings: &armcomputefleet.PatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + // EnableHotpatching: to.Ptr(true), + // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // WinRM: &armcomputefleet.WinRMConfiguration{ + // Listeners: []*armcomputefleet.WinRMListener{ + // { + // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), + // CertificateURL: to.Ptr("phwesineizrl"), + // }, + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + // DisablePasswordAuthentication: to.Ptr(true), + // SSH: &armcomputefleet.SSHConfiguration{ + // PublicKeys: []*armcomputefleet.SSHPublicKey{ + // { + // Path: to.Ptr("kmqz"), + // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + // }, + // }, + // }, + // ProvisionVMAgent: to.Ptr(true), + // PatchSettings: &armcomputefleet.LinuxPatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // Secrets: []*armcomputefleet.VaultSecretGroup{ + // { + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // VaultCertificates: []*armcomputefleet.VaultCertificate{ + // { + // CertificateURL: to.Ptr("tyldwkzafmnkvpo"), + // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + // }, + // }, + // }, + // }, + // AllowExtensionOperations: to.Ptr(true), + // RequireGuestProvisionSignal: to.Ptr(true), + // }, + // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + // ImageReference: &armcomputefleet.ImageReference{ + // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + // Offer: to.Ptr("isxgumkarlkomp"), + // SKU: to.Ptr("eojmppqcrnpmxirtp"), + // Version: to.Ptr("wvpcqefgtmqdgltiuz"), + // ExactVersion: to.Ptr("zjbntmiskjexlr"), + // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + // CommunityGalleryImageID: to.Ptr("vlqe"), + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + // }, + // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + // Name: to.Ptr("wfttw"), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + // }, + // DiskSizeGB: to.Ptr[int32](14), + // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + // Image: &armcomputefleet.VirtualHardDisk{ + // URI: to.Ptr("thqceubivdrjs"), + // }, + // VhdContainers: []*string{ + // to.Ptr("tkzcwddtinkfpnfklatw"), + // }, + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + // { + // Name: to.Ptr("eogiykmdmeikswxmigjws"), + // Lun: to.Ptr[int32](14), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiskSizeGB: to.Ptr[int32](6), + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DiskIOPSReadWrite: to.Ptr[int64](27), + // DiskMBpsReadWrite: to.Ptr[int64](2), + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // }, + // }, + // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + // HealthProbe: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + // }, + // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + // { + // Name: to.Ptr("i"), + // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + // Primary: to.Ptr(true), + // EnableAcceleratedNetworking: to.Ptr(true), + // DisableTCPStateTracking: to.Ptr(true), + // EnableFpga: to.Ptr(true), + // NetworkSecurityGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + // }, + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + // DNSServers: []*string{ + // to.Ptr("nxmmfolhclsesu"), + // }, + // }, + // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + // { + // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + // Subnet: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + // }, + // Primary: to.Ptr(true), + // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + // Name: to.Ptr("fvpqf"), + // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + // IdleTimeoutInMinutes: to.Ptr[int32](9), + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + // }, + // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + // { + // IPTagType: to.Ptr("sddgsoemnzgqizale"), + // Tag: to.Ptr("wufmhrjsakbiaetyara"), + // }, + // }, + // PublicIPPrefix: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + // }, + // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // }, + // SKU: &armcomputefleet.PublicIPAddressSKU{ + // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + // }, + // }, + // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + // }, + // }, + // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + // }, + // }, + // }, + // }, + // }, + // EnableIPForwarding: to.Ptr(true), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + // }, + // }, + // }, + // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersion20201101), + // }, + // SecurityProfile: &armcomputefleet.SecurityProfile{ + // UefiSettings: &armcomputefleet.UefiSettings{ + // SecureBootEnabled: to.Ptr(true), + // VTpmEnabled: to.Ptr(true), + // }, + // EncryptionAtHost: to.Ptr(true), + // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + // }, + // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + // Enabled: to.Ptr(true), + // Mode: to.Ptr(armcomputefleet.ModeAudit), + // KeyIncarnationID: to.Ptr[int32](20), + // }, + // }, + // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + // BootDiagnostics: &armcomputefleet.BootDiagnostics{ + // Enabled: to.Ptr(true), + // StorageURI: to.Ptr("rzamfwghybpx"), + // }, + // }, + // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + // { + // Name: to.Ptr("bndxuxx"), + // Type: to.Ptr("cmeam"), + // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + // ForceUpdateTag: to.Ptr("yhgxw"), + // Publisher: to.Ptr("kpxtirxjfprhs"), + // Type: to.Ptr("pgjilctjjwaa"), + // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // Settings: map[string]any{ + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // ProvisionAfterExtensions: []*string{ + // to.Ptr("nftzosroolbcwmpupujzqwqe"), + // }, + // SuppressFailures: to.Ptr(true), + // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + // SecretURL: to.Ptr("vyhzfkqsqanacgzjthpjoe"), + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // }, + // }, + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), + // }, + // }, + // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + // }, + // LicenseType: to.Ptr("v"), + // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + // NotBeforeTimeout: to.Ptr("iljppmmw"), + // Enable: to.Ptr(true), + // }, + // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + // Enable: to.Ptr(true), + // }, + // }, + // UserData: to.Ptr("s"), + // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + // CapacityReservationGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + // }, + // }, + // ApplicationProfile: &armcomputefleet.ApplicationProfile{ + // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + // { + // Tags: to.Ptr("eyrqjbib"), + // Order: to.Ptr[int32](5), + // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + // TreatFailureAsDeploymentFailure: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // }, + // }, + // }, + // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + // VMSizeProperties: &armcomputefleet.VMSizeProperties{ + // VCPUsAvailable: to.Ptr[int32](16), + // VCPUsPerCore: to.Ptr[int32](23), + // }, + // }, + // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + // }, + // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + // ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), + // ExcludeExtensions: []*string{ + // to.Ptr("{securityPostureVMExtensionName}"), + // }, + // IsOverridable: to.Ptr(true), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // ComputeAPIVersion: to.Ptr("2023-07-01"), + // PlatformFaultDomainCount: to.Ptr[int32](1), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), + // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), + // }, + // Zones: []*string{ + // to.Ptr("zone1"), + // to.Ptr("zone2"), + // }, + // Identity: &armcomputefleet.ManagedServiceIdentity{ + // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ + // "key9851": &armcomputefleet.UserAssignedIdentity{ + // PrincipalID: to.Ptr("6d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // ClientID: to.Ptr("7d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // }, + // }, + // }, + // Plan: &armcomputefleet.Plan{ + // Name: to.Ptr("jwgrcrnrtfoxn"), + // Publisher: to.Ptr("iozjbiqqckqm"), + // Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), + // PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), + // Version: to.Ptr("wa"), + // }, + // Tags: map[string]*string{ + // "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), + // }, + // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), + // Name: to.Ptr("testFleet"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets"), + // SystemData: &armcomputefleet.SystemData{ + // CreatedBy: to.Ptr("rowegentrpoajsv"), + // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), + // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // }, + // } +} + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_CreateOrUpdate_MinimumSet.json +func ExampleFleetsClient_BeginCreateOrUpdate_fleetsCreateOrUpdateMinimumSet() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewFleetsClient().BeginCreateOrUpdate(ctx, "rgazurefleet", "testFleet", armcomputefleet.Fleet{ + Properties: &armcomputefleet.FleetProperties{ + SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + Capacity: to.Ptr[int32](2), + MinCapacity: to.Ptr[int32](1), + EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + Maintain: to.Ptr(true), + }, + RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + Capacity: to.Ptr[int32](2), + MinCapacity: to.Ptr[int32](1), + AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + }, + VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + { + Name: to.Ptr("Standard_D2s_v3"), + }, + { + Name: to.Ptr("Standard_D4s_v3"), + }, + { + Name: to.Ptr("Standard_E2s_v3"), + }, + }, + ComputeProfile: &armcomputefleet.ComputeProfile{ + BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + ImageReference: &armcomputefleet.ImageReference{ + Publisher: to.Ptr("canonical"), + Offer: to.Ptr("0001-com-ubuntu-server-focal"), + SKU: to.Ptr("20_04-lts-gen2"), + Version: to.Ptr("latest"), + }, + OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + Caching: to.Ptr(armcomputefleet.CachingTypesReadWrite), + CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + OSType: to.Ptr(armcomputefleet.OperatingSystemTypesLinux), + ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + }, + }, + }, + OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + ComputerNamePrefix: to.Ptr("prefix"), + AdminUsername: to.Ptr("azureuser"), + AdminPassword: to.Ptr("TestPassword$0"), + LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + DisablePasswordAuthentication: to.Ptr(false), + }, + }, + NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + { + Name: to.Ptr("vmNameTest"), + Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + Primary: to.Ptr(true), + EnableAcceleratedNetworking: to.Ptr(false), + IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + { + Name: to.Ptr("vmNameTest"), + Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + Subnet: &armcomputefleet.APIEntityReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + }, + Primary: to.Ptr(true), + LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + }, + }, + }, + }, + }, + EnableIPForwarding: to.Ptr(true), + }, + }, + }, + }, + }, + ComputeAPIVersion: to.Ptr("2023-09-01"), + PlatformFaultDomainCount: to.Ptr[int32](1), + }, + }, + Tags: map[string]*string{ + "key": to.Ptr("fleets-test"), + }, + Location: to.Ptr("eastus2euap"), + }, 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 = armcomputefleet.FleetsClientCreateOrUpdateResponse{ + // Fleet: &armcomputefleet.Fleet{ + // Properties: &armcomputefleet.FleetProperties{ + // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + // Capacity: to.Ptr[int32](2), + // MinCapacity: to.Ptr[int32](1), + // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + // Maintain: to.Ptr(true), + // }, + // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + // Capacity: to.Ptr[int32](2), + // MinCapacity: to.Ptr[int32](1), + // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + // }, + // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + // { + // Name: to.Ptr("Standard_D2s_v3"), + // }, + // { + // Name: to.Ptr("Standard_D4s_v3"), + // }, + // { + // Name: to.Ptr("Standard_E2s_v3"), + // }, + // }, + // ComputeProfile: &armcomputefleet.ComputeProfile{ + // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + // ImageReference: &armcomputefleet.ImageReference{ + // Publisher: to.Ptr("canonical"), + // Offer: to.Ptr("0001-com-ubuntu-server-focal"), + // SKU: to.Ptr("20_04-lts-gen2"), + // Version: to.Ptr("latest"), + // }, + // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + // Caching: to.Ptr(armcomputefleet.CachingTypesReadWrite), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesLinux), + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // }, + // }, + // }, + // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + // ComputerNamePrefix: to.Ptr("prefix"), + // AdminUsername: to.Ptr("azureuser"), + // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + // DisablePasswordAuthentication: to.Ptr(false), + // }, + // }, + // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + // { + // Name: to.Ptr("vmNameTest"), + // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + // Primary: to.Ptr(true), + // EnableAcceleratedNetworking: to.Ptr(false), + // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + // { + // Name: to.Ptr("vmNameTest"), + // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + // Subnet: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + // }, + // Primary: to.Ptr(true), + // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // }, + // }, + // }, + // EnableIPForwarding: to.Ptr(true), + // }, + // }, + // }, + // }, + // }, + // ComputeAPIVersion: to.Ptr("2023-09-01"), + // PlatformFaultDomainCount: to.Ptr[int32](1), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), + // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), + // }, + // Tags: map[string]*string{ + // "key": to.Ptr("fleets-test"), + // }, + // Location: to.Ptr("eastus2euap"), + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), + // Name: to.Ptr("testFleet"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets"), + // }, + // } +} + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_Delete.json +func ExampleFleetsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewFleetsClient().BeginDelete(ctx, "rgazurefleet", "testFleet", 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: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_Get.json +func ExampleFleetsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewFleetsClient().Get(ctx, "rgazurefleet", "testFleet", 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 = armcomputefleet.FleetsClientGetResponse{ + // Fleet: &armcomputefleet.Fleet{ + // Properties: &armcomputefleet.FleetProperties{ + // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // MaxPricePerVM: to.Ptr[float32](0.00865), + // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + // Maintain: to.Ptr(true), + // }, + // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + // }, + // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + // { + // Name: to.Ptr("Standard_d1_v2"), + // Rank: to.Ptr[int32](19225), + // }, + // }, + // ComputeProfile: &armcomputefleet.ComputeProfile{ + // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + // ComputerNamePrefix: to.Ptr("o"), + // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + // ProvisionVMAgent: to.Ptr(true), + // EnableAutomaticUpdates: to.Ptr(true), + // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + // { + // PassName: to.Ptr("OobeSystem"), + // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + // }, + // }, + // PatchSettings: &armcomputefleet.PatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + // EnableHotpatching: to.Ptr(true), + // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // WinRM: &armcomputefleet.WinRMConfiguration{ + // Listeners: []*armcomputefleet.WinRMListener{ + // { + // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), + // CertificateURL: to.Ptr("phwesineizrl"), + // }, + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + // DisablePasswordAuthentication: to.Ptr(true), + // SSH: &armcomputefleet.SSHConfiguration{ + // PublicKeys: []*armcomputefleet.SSHPublicKey{ + // { + // Path: to.Ptr("kmqz"), + // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + // }, + // }, + // }, + // ProvisionVMAgent: to.Ptr(true), + // PatchSettings: &armcomputefleet.LinuxPatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // Secrets: []*armcomputefleet.VaultSecretGroup{ + // { + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // VaultCertificates: []*armcomputefleet.VaultCertificate{ + // { + // CertificateURL: to.Ptr("tyldwkzafmnkvpo"), + // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + // }, + // }, + // }, + // }, + // AllowExtensionOperations: to.Ptr(true), + // RequireGuestProvisionSignal: to.Ptr(true), + // }, + // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + // ImageReference: &armcomputefleet.ImageReference{ + // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + // Offer: to.Ptr("isxgumkarlkomp"), + // SKU: to.Ptr("eojmppqcrnpmxirtp"), + // Version: to.Ptr("wvpcqefgtmqdgltiuz"), + // ExactVersion: to.Ptr("zjbntmiskjexlr"), + // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + // CommunityGalleryImageID: to.Ptr("vlqe"), + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + // }, + // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + // Name: to.Ptr("wfttw"), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + // }, + // DiskSizeGB: to.Ptr[int32](14), + // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + // Image: &armcomputefleet.VirtualHardDisk{ + // URI: to.Ptr("thqceubivdrjs"), + // }, + // VhdContainers: []*string{ + // to.Ptr("tkzcwddtinkfpnfklatw"), + // }, + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + // { + // Name: to.Ptr("eogiykmdmeikswxmigjws"), + // Lun: to.Ptr[int32](14), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiskSizeGB: to.Ptr[int32](6), + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DiskIOPSReadWrite: to.Ptr[int64](27), + // DiskMBpsReadWrite: to.Ptr[int64](2), + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // }, + // }, + // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + // HealthProbe: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + // }, + // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + // { + // Name: to.Ptr("i"), + // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + // Primary: to.Ptr(true), + // EnableAcceleratedNetworking: to.Ptr(true), + // DisableTCPStateTracking: to.Ptr(true), + // EnableFpga: to.Ptr(true), + // NetworkSecurityGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + // }, + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + // DNSServers: []*string{ + // to.Ptr("nxmmfolhclsesu"), + // }, + // }, + // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + // { + // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + // Subnet: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + // }, + // Primary: to.Ptr(true), + // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + // Name: to.Ptr("fvpqf"), + // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + // IdleTimeoutInMinutes: to.Ptr[int32](9), + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + // }, + // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + // { + // IPTagType: to.Ptr("sddgsoemnzgqizale"), + // Tag: to.Ptr("wufmhrjsakbiaetyara"), + // }, + // }, + // PublicIPPrefix: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + // }, + // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // }, + // SKU: &armcomputefleet.PublicIPAddressSKU{ + // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + // }, + // }, + // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + // }, + // }, + // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + // }, + // }, + // }, + // }, + // }, + // EnableIPForwarding: to.Ptr(true), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + // }, + // }, + // }, + // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersion20201101), + // }, + // SecurityProfile: &armcomputefleet.SecurityProfile{ + // UefiSettings: &armcomputefleet.UefiSettings{ + // SecureBootEnabled: to.Ptr(true), + // VTpmEnabled: to.Ptr(true), + // }, + // EncryptionAtHost: to.Ptr(true), + // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + // }, + // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + // Enabled: to.Ptr(true), + // Mode: to.Ptr(armcomputefleet.ModeAudit), + // KeyIncarnationID: to.Ptr[int32](20), + // }, + // }, + // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + // BootDiagnostics: &armcomputefleet.BootDiagnostics{ + // Enabled: to.Ptr(true), + // StorageURI: to.Ptr("rzamfwghybpx"), + // }, + // }, + // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + // { + // Name: to.Ptr("bndxuxx"), + // Type: to.Ptr("cmeam"), + // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + // ForceUpdateTag: to.Ptr("yhgxw"), + // Publisher: to.Ptr("kpxtirxjfprhs"), + // Type: to.Ptr("pgjilctjjwaa"), + // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // Settings: map[string]any{ + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // ProvisionAfterExtensions: []*string{ + // to.Ptr("nftzosroolbcwmpupujzqwqe"), + // }, + // SuppressFailures: to.Ptr(true), + // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + // SecretURL: to.Ptr("vyhzfkqsqanacgzjthpjoe"), + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // }, + // }, + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), + // }, + // }, + // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + // }, + // LicenseType: to.Ptr("v"), + // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + // NotBeforeTimeout: to.Ptr("iljppmmw"), + // Enable: to.Ptr(true), + // }, + // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + // Enable: to.Ptr(true), + // }, + // }, + // UserData: to.Ptr("s"), + // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + // CapacityReservationGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + // }, + // }, + // ApplicationProfile: &armcomputefleet.ApplicationProfile{ + // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + // { + // Tags: to.Ptr("eyrqjbib"), + // Order: to.Ptr[int32](5), + // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + // TreatFailureAsDeploymentFailure: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // }, + // }, + // }, + // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + // VMSizeProperties: &armcomputefleet.VMSizeProperties{ + // VCPUsAvailable: to.Ptr[int32](16), + // VCPUsPerCore: to.Ptr[int32](23), + // }, + // }, + // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + // }, + // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + // ID: to.Ptr("mubredelfbshboaxrsxiajihahaa"), + // ExcludeExtensions: []*string{ + // to.Ptr("{securityPostureVMExtensionName}"), + // }, + // IsOverridable: to.Ptr(true), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // ComputeAPIVersion: to.Ptr("2023-07-01"), + // PlatformFaultDomainCount: to.Ptr[int32](1), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), + // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), + // }, + // Zones: []*string{ + // to.Ptr("zone1"), + // to.Ptr("zone2"), + // }, + // Identity: &armcomputefleet.ManagedServiceIdentity{ + // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ + // "key9851": &armcomputefleet.UserAssignedIdentity{ + // PrincipalID: to.Ptr("6d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // ClientID: to.Ptr("7d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // }, + // }, + // }, + // Tags: map[string]*string{ + // "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), + // }, + // Plan: &armcomputefleet.Plan{ + // Name: to.Ptr("jwgrcrnrtfoxn"), + // Publisher: to.Ptr("iozjbiqqckqm"), + // Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), + // PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), + // Version: to.Ptr("wa"), + // }, + // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), + // Name: to.Ptr("testFleet"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets"), + // SystemData: &armcomputefleet.SystemData{ + // CreatedBy: to.Ptr("rowegentrpoajsv"), + // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), + // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // }, + // } +} + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_ListByResourceGroup.json +func ExampleFleetsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewFleetsClient().NewListByResourceGroupPager("rgazurefleet", 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 = armcomputefleet.FleetsClientListByResourceGroupResponse{ + // FleetListResult: armcomputefleet.FleetListResult{ + // Value: []*armcomputefleet.Fleet{ + // { + // Properties: &armcomputefleet.FleetProperties{ + // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // MaxPricePerVM: to.Ptr[float32](0.00865), + // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + // Maintain: to.Ptr(true), + // }, + // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + // }, + // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + // { + // Name: to.Ptr("Standard_d1_v2"), + // Rank: to.Ptr[int32](19225), + // }, + // }, + // ComputeProfile: &armcomputefleet.ComputeProfile{ + // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + // ComputerNamePrefix: to.Ptr("o"), + // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + // ProvisionVMAgent: to.Ptr(true), + // EnableAutomaticUpdates: to.Ptr(true), + // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + // { + // PassName: to.Ptr("OobeSystem"), + // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + // }, + // }, + // PatchSettings: &armcomputefleet.PatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + // EnableHotpatching: to.Ptr(true), + // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // WinRM: &armcomputefleet.WinRMConfiguration{ + // Listeners: []*armcomputefleet.WinRMListener{ + // { + // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), + // CertificateURL: to.Ptr("phwesineizrl"), + // }, + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + // DisablePasswordAuthentication: to.Ptr(true), + // SSH: &armcomputefleet.SSHConfiguration{ + // PublicKeys: []*armcomputefleet.SSHPublicKey{ + // { + // Path: to.Ptr("kmqz"), + // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + // }, + // }, + // }, + // ProvisionVMAgent: to.Ptr(true), + // PatchSettings: &armcomputefleet.LinuxPatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // Secrets: []*armcomputefleet.VaultSecretGroup{ + // { + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // VaultCertificates: []*armcomputefleet.VaultCertificate{ + // { + // CertificateURL: to.Ptr("tyldwkzafmnkvpo"), + // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + // }, + // }, + // }, + // }, + // AllowExtensionOperations: to.Ptr(true), + // RequireGuestProvisionSignal: to.Ptr(true), + // }, + // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + // ImageReference: &armcomputefleet.ImageReference{ + // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + // Offer: to.Ptr("isxgumkarlkomp"), + // SKU: to.Ptr("eojmppqcrnpmxirtp"), + // Version: to.Ptr("wvpcqefgtmqdgltiuz"), + // ExactVersion: to.Ptr("zjbntmiskjexlr"), + // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + // CommunityGalleryImageID: to.Ptr("vlqe"), + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + // }, + // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + // Name: to.Ptr("wfttw"), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + // }, + // DiskSizeGB: to.Ptr[int32](14), + // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + // Image: &armcomputefleet.VirtualHardDisk{ + // URI: to.Ptr("thqceubivdrjs"), + // }, + // VhdContainers: []*string{ + // to.Ptr("tkzcwddtinkfpnfklatw"), + // }, + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + // { + // Name: to.Ptr("eogiykmdmeikswxmigjws"), + // Lun: to.Ptr[int32](14), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiskSizeGB: to.Ptr[int32](6), + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DiskIOPSReadWrite: to.Ptr[int64](27), + // DiskMBpsReadWrite: to.Ptr[int64](2), + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // }, + // }, + // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + // HealthProbe: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + // }, + // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + // { + // Name: to.Ptr("i"), + // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + // Primary: to.Ptr(true), + // EnableAcceleratedNetworking: to.Ptr(true), + // DisableTCPStateTracking: to.Ptr(true), + // EnableFpga: to.Ptr(true), + // NetworkSecurityGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + // }, + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + // DNSServers: []*string{ + // to.Ptr("nxmmfolhclsesu"), + // }, + // }, + // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + // { + // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + // Subnet: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + // }, + // Primary: to.Ptr(true), + // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + // Name: to.Ptr("fvpqf"), + // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + // IdleTimeoutInMinutes: to.Ptr[int32](9), + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + // }, + // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + // { + // IPTagType: to.Ptr("sddgsoemnzgqizale"), + // Tag: to.Ptr("wufmhrjsakbiaetyara"), + // }, + // }, + // PublicIPPrefix: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + // }, + // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // }, + // SKU: &armcomputefleet.PublicIPAddressSKU{ + // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + // }, + // }, + // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + // }, + // }, + // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + // }, + // }, + // }, + // }, + // }, + // EnableIPForwarding: to.Ptr(true), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + // }, + // }, + // }, + // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersion20201101), + // }, + // SecurityProfile: &armcomputefleet.SecurityProfile{ + // UefiSettings: &armcomputefleet.UefiSettings{ + // SecureBootEnabled: to.Ptr(true), + // VTpmEnabled: to.Ptr(true), + // }, + // EncryptionAtHost: to.Ptr(true), + // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + // }, + // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + // Enabled: to.Ptr(true), + // Mode: to.Ptr(armcomputefleet.ModeAudit), + // KeyIncarnationID: to.Ptr[int32](20), + // }, + // }, + // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + // BootDiagnostics: &armcomputefleet.BootDiagnostics{ + // Enabled: to.Ptr(true), + // StorageURI: to.Ptr("rzamfwghybpx"), + // }, + // }, + // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + // { + // Name: to.Ptr("bndxuxx"), + // Type: to.Ptr("cmeam"), + // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + // ForceUpdateTag: to.Ptr("yhgxw"), + // Publisher: to.Ptr("kpxtirxjfprhs"), + // Type: to.Ptr("pgjilctjjwaa"), + // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // Settings: map[string]any{ + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // ProvisionAfterExtensions: []*string{ + // to.Ptr("nftzosroolbcwmpupujzqwqe"), + // }, + // SuppressFailures: to.Ptr(true), + // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + // SecretURL: to.Ptr("vyhzfkqsqanacgzjthpjoe"), + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // }, + // }, + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), + // }, + // }, + // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + // }, + // LicenseType: to.Ptr("v"), + // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + // NotBeforeTimeout: to.Ptr("iljppmmw"), + // Enable: to.Ptr(true), + // }, + // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + // Enable: to.Ptr(true), + // }, + // }, + // UserData: to.Ptr("s"), + // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + // CapacityReservationGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + // }, + // }, + // ApplicationProfile: &armcomputefleet.ApplicationProfile{ + // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + // { + // Tags: to.Ptr("eyrqjbib"), + // Order: to.Ptr[int32](5), + // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + // TreatFailureAsDeploymentFailure: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // }, + // }, + // }, + // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + // VMSizeProperties: &armcomputefleet.VMSizeProperties{ + // VCPUsAvailable: to.Ptr[int32](16), + // VCPUsPerCore: to.Ptr[int32](23), + // }, + // }, + // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + // }, + // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + // ID: to.Ptr("mubredelfbshboaxrsxiajihahaa"), + // ExcludeExtensions: []*string{ + // to.Ptr("{securityPostureVMExtensionName}"), + // }, + // IsOverridable: to.Ptr(true), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // ComputeAPIVersion: to.Ptr("2023-07-01"), + // PlatformFaultDomainCount: to.Ptr[int32](1), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), + // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), + // }, + // Zones: []*string{ + // to.Ptr("zone1"), + // to.Ptr("zone2"), + // }, + // Identity: &armcomputefleet.ManagedServiceIdentity{ + // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ + // "key9851": &armcomputefleet.UserAssignedIdentity{ + // PrincipalID: to.Ptr("6d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // ClientID: to.Ptr("7d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // }, + // }, + // }, + // Plan: &armcomputefleet.Plan{ + // Name: to.Ptr("jwgrcrnrtfoxn"), + // Publisher: to.Ptr("iozjbiqqckqm"), + // Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), + // PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), + // Version: to.Ptr("wa"), + // }, + // Tags: map[string]*string{ + // "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), + // }, + // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), + // Name: to.Ptr("testFleet"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets"), + // SystemData: &armcomputefleet.SystemData{ + // CreatedBy: to.Ptr("rowegentrpoajsv"), + // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), + // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // }, + // }, + // NextLink: to.Ptr("https://microsoft.com/a"), + // }, + // } + } +} + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_ListBySubscription.json +func ExampleFleetsClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewFleetsClient().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 = armcomputefleet.FleetsClientListBySubscriptionResponse{ + // FleetListResult: armcomputefleet.FleetListResult{ + // Value: []*armcomputefleet.Fleet{ + // { + // Properties: &armcomputefleet.FleetProperties{ + // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // MaxPricePerVM: to.Ptr[float32](0.00865), + // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + // Maintain: to.Ptr(true), + // }, + // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + // }, + // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + // { + // Name: to.Ptr("Standard_d1_v2"), + // Rank: to.Ptr[int32](19225), + // }, + // }, + // ComputeProfile: &armcomputefleet.ComputeProfile{ + // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + // ComputerNamePrefix: to.Ptr("o"), + // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + // ProvisionVMAgent: to.Ptr(true), + // EnableAutomaticUpdates: to.Ptr(true), + // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + // { + // PassName: to.Ptr("OobeSystem"), + // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + // }, + // }, + // PatchSettings: &armcomputefleet.PatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + // EnableHotpatching: to.Ptr(true), + // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // WinRM: &armcomputefleet.WinRMConfiguration{ + // Listeners: []*armcomputefleet.WinRMListener{ + // { + // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), + // CertificateURL: to.Ptr("phwesineizrl"), + // }, + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + // DisablePasswordAuthentication: to.Ptr(true), + // SSH: &armcomputefleet.SSHConfiguration{ + // PublicKeys: []*armcomputefleet.SSHPublicKey{ + // { + // Path: to.Ptr("kmqz"), + // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + // }, + // }, + // }, + // ProvisionVMAgent: to.Ptr(true), + // PatchSettings: &armcomputefleet.LinuxPatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // Secrets: []*armcomputefleet.VaultSecretGroup{ + // { + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // VaultCertificates: []*armcomputefleet.VaultCertificate{ + // { + // CertificateURL: to.Ptr("tyldwkzafmnkvpo"), + // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + // }, + // }, + // }, + // }, + // AllowExtensionOperations: to.Ptr(true), + // RequireGuestProvisionSignal: to.Ptr(true), + // }, + // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + // ImageReference: &armcomputefleet.ImageReference{ + // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + // Offer: to.Ptr("isxgumkarlkomp"), + // SKU: to.Ptr("eojmppqcrnpmxirtp"), + // Version: to.Ptr("wvpcqefgtmqdgltiuz"), + // ExactVersion: to.Ptr("zjbntmiskjexlr"), + // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + // CommunityGalleryImageID: to.Ptr("vlqe"), + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + // }, + // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + // Name: to.Ptr("wfttw"), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + // }, + // DiskSizeGB: to.Ptr[int32](14), + // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + // Image: &armcomputefleet.VirtualHardDisk{ + // URI: to.Ptr("thqceubivdrjs"), + // }, + // VhdContainers: []*string{ + // to.Ptr("tkzcwddtinkfpnfklatw"), + // }, + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + // { + // Name: to.Ptr("eogiykmdmeikswxmigjws"), + // Lun: to.Ptr[int32](14), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiskSizeGB: to.Ptr[int32](6), + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DiskIOPSReadWrite: to.Ptr[int64](27), + // DiskMBpsReadWrite: to.Ptr[int64](2), + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // }, + // }, + // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + // HealthProbe: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + // }, + // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + // { + // Name: to.Ptr("i"), + // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + // Primary: to.Ptr(true), + // EnableAcceleratedNetworking: to.Ptr(true), + // DisableTCPStateTracking: to.Ptr(true), + // EnableFpga: to.Ptr(true), + // NetworkSecurityGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + // }, + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + // DNSServers: []*string{ + // to.Ptr("nxmmfolhclsesu"), + // }, + // }, + // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + // { + // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + // Subnet: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + // }, + // Primary: to.Ptr(true), + // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + // Name: to.Ptr("fvpqf"), + // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + // IdleTimeoutInMinutes: to.Ptr[int32](9), + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + // }, + // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + // { + // IPTagType: to.Ptr("sddgsoemnzgqizale"), + // Tag: to.Ptr("wufmhrjsakbiaetyara"), + // }, + // }, + // PublicIPPrefix: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + // }, + // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // }, + // SKU: &armcomputefleet.PublicIPAddressSKU{ + // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + // }, + // }, + // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + // }, + // }, + // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + // }, + // }, + // }, + // }, + // }, + // EnableIPForwarding: to.Ptr(true), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + // }, + // }, + // }, + // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersion20201101), + // }, + // SecurityProfile: &armcomputefleet.SecurityProfile{ + // UefiSettings: &armcomputefleet.UefiSettings{ + // SecureBootEnabled: to.Ptr(true), + // VTpmEnabled: to.Ptr(true), + // }, + // EncryptionAtHost: to.Ptr(true), + // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + // }, + // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + // Enabled: to.Ptr(true), + // Mode: to.Ptr(armcomputefleet.ModeAudit), + // KeyIncarnationID: to.Ptr[int32](20), + // }, + // }, + // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + // BootDiagnostics: &armcomputefleet.BootDiagnostics{ + // Enabled: to.Ptr(true), + // StorageURI: to.Ptr("rzamfwghybpx"), + // }, + // }, + // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + // { + // Name: to.Ptr("bndxuxx"), + // Type: to.Ptr("cmeam"), + // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + // ForceUpdateTag: to.Ptr("yhgxw"), + // Publisher: to.Ptr("kpxtirxjfprhs"), + // Type: to.Ptr("pgjilctjjwaa"), + // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // Settings: map[string]any{ + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // ProvisionAfterExtensions: []*string{ + // to.Ptr("nftzosroolbcwmpupujzqwqe"), + // }, + // SuppressFailures: to.Ptr(true), + // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + // SecretURL: to.Ptr("vyhzfkqsqanacgzjthpjoe"), + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // }, + // }, + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), + // }, + // }, + // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + // }, + // LicenseType: to.Ptr("v"), + // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + // NotBeforeTimeout: to.Ptr("iljppmmw"), + // Enable: to.Ptr(true), + // }, + // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + // Enable: to.Ptr(true), + // }, + // }, + // UserData: to.Ptr("s"), + // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + // CapacityReservationGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + // }, + // }, + // ApplicationProfile: &armcomputefleet.ApplicationProfile{ + // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + // { + // Tags: to.Ptr("eyrqjbib"), + // Order: to.Ptr[int32](5), + // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + // TreatFailureAsDeploymentFailure: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // }, + // }, + // }, + // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + // VMSizeProperties: &armcomputefleet.VMSizeProperties{ + // VCPUsAvailable: to.Ptr[int32](16), + // VCPUsPerCore: to.Ptr[int32](23), + // }, + // }, + // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + // }, + // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + // ID: to.Ptr("mubredelfbshboaxrsxiajihahaa"), + // ExcludeExtensions: []*string{ + // to.Ptr("{securityPostureVMExtensionName}"), + // }, + // IsOverridable: to.Ptr(true), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // ComputeAPIVersion: to.Ptr("2023-07-01"), + // PlatformFaultDomainCount: to.Ptr[int32](1), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), + // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), + // }, + // Zones: []*string{ + // to.Ptr("zone1"), + // to.Ptr("zone2"), + // }, + // Identity: &armcomputefleet.ManagedServiceIdentity{ + // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ + // "key9851": &armcomputefleet.UserAssignedIdentity{ + // PrincipalID: to.Ptr("6d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // ClientID: to.Ptr("7d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // }, + // }, + // }, + // Plan: &armcomputefleet.Plan{ + // Name: to.Ptr("jwgrcrnrtfoxn"), + // Publisher: to.Ptr("iozjbiqqckqm"), + // Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), + // PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), + // Version: to.Ptr("wa"), + // }, + // Tags: map[string]*string{ + // "key3518": to.Ptr("luvrnuvsgdpbuofdskkcoqhfh"), + // }, + // Location: to.Ptr("westus"), + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), + // Name: to.Ptr("testFleet"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets"), + // SystemData: &armcomputefleet.SystemData{ + // CreatedBy: to.Ptr("rowegentrpoajsv"), + // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), + // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // }, + // }, + // NextLink: to.Ptr("https://microsoft.com/a"), + // }, + // } + } +} + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_ListVirtualMachineScaleSets.json +func ExampleFleetsClient_NewListVirtualMachineScaleSetsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewFleetsClient().NewListVirtualMachineScaleSetsPager("rgazurefleet", "myFleet", 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 = armcomputefleet.FleetsClientListVirtualMachineScaleSetsResponse{ + // VirtualMachineScaleSetListResult: armcomputefleet.VirtualMachineScaleSetListResult{ + // Value: []*armcomputefleet.VirtualMachineScaleSet{ + // { + // Name: to.Ptr("myVmss"), + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/myFleet/virtualMachineScaleSets/myVmss"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets/virtualMachineScaleSets"), + // OperationStatus: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // Error: &armcomputefleet.APIError{ + // Details: []*armcomputefleet.APIErrorBase{ + // { + // Code: to.Ptr("gzhtOverconstrainedAllocationRequestyosk"), + // Target: to.Ptr("qfthabhrmndhfizfnrwpgxvnokpy"), + // Message: to.Ptr("Allocation Failed"), + // }, + // }, + // Innererror: &armcomputefleet.InnerError{ + // ExceptionType: to.Ptr("sfaomfpoaptnbxchrfskm"), + // ErrorDetail: to.Ptr("ihjwbwykq"), + // }, + // Code: to.Ptr("OverconstrainedAllocationRequest"), + // Target: to.Ptr("nhaj"), + // Message: to.Ptr("Allocation Failed"), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Fleets_Update.json +func ExampleFleetsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armcomputefleet.NewClientFactory("1DC2F28C-A625-4B0E-9748-9885A3C9E9EB", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewFleetsClient().BeginUpdate(ctx, "rgazurefleet", "testFleet", armcomputefleet.FleetUpdate{ + Identity: &armcomputefleet.ManagedServiceIdentityUpdate{ + Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{}, + }, + Tags: map[string]*string{}, + Properties: &armcomputefleet.FleetProperties{ + SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + Capacity: to.Ptr[int32](20), + MinCapacity: to.Ptr[int32](10), + MaxPricePerVM: to.Ptr[float32](0.00865), + EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + Maintain: to.Ptr(true), + }, + RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + Capacity: to.Ptr[int32](20), + MinCapacity: to.Ptr[int32](10), + AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + }, + VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + { + Name: to.Ptr("Standard_d1_v2"), + Rank: to.Ptr[int32](19225), + }, + }, + ComputeProfile: &armcomputefleet.ComputeProfile{ + BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + ComputerNamePrefix: to.Ptr("o"), + AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + AdminPassword: to.Ptr("adfbrdxpv"), + CustomData: to.Ptr("xjjib"), + WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + ProvisionVMAgent: to.Ptr(true), + EnableAutomaticUpdates: to.Ptr(true), + TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + { + PassName: to.Ptr("OobeSystem"), + ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + Content: to.Ptr("bubmqbxjkj"), + }, + }, + PatchSettings: &armcomputefleet.PatchSettings{ + PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + EnableHotpatching: to.Ptr(true), + AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + }, + }, + WinRM: &armcomputefleet.WinRMConfiguration{ + Listeners: []*armcomputefleet.WinRMListener{ + { + Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), + CertificateURL: to.Ptr("phwesineizrl"), + }, + }, + }, + EnableVMAgentPlatformUpdates: to.Ptr(true), + }, + LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + DisablePasswordAuthentication: to.Ptr(true), + SSH: &armcomputefleet.SSHConfiguration{ + PublicKeys: []*armcomputefleet.SSHPublicKey{ + { + Path: to.Ptr("kmqz"), + KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + }, + }, + }, + ProvisionVMAgent: to.Ptr(true), + PatchSettings: &armcomputefleet.LinuxPatchSettings{ + PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + }, + }, + EnableVMAgentPlatformUpdates: to.Ptr(true), + }, + Secrets: []*armcomputefleet.VaultSecretGroup{ + { + SourceVault: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + }, + VaultCertificates: []*armcomputefleet.VaultCertificate{ + { + CertificateURL: to.Ptr("tyldwkzafmnkvpo"), + CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + }, + }, + }, + }, + AllowExtensionOperations: to.Ptr(true), + RequireGuestProvisionSignal: to.Ptr(true), + }, + StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + ImageReference: &armcomputefleet.ImageReference{ + Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + Offer: to.Ptr("isxgumkarlkomp"), + SKU: to.Ptr("eojmppqcrnpmxirtp"), + Version: to.Ptr("wvpcqefgtmqdgltiuz"), + SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + CommunityGalleryImageID: to.Ptr("vlqe"), + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + }, + OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + Name: to.Ptr("wfttw"), + Caching: to.Ptr(armcomputefleet.CachingTypesNone), + WriteAcceleratorEnabled: to.Ptr(true), + CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + }, + DiskSizeGB: to.Ptr[int32](14), + OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + Image: &armcomputefleet.VirtualHardDisk{ + URI: to.Ptr("thqceubivdrjs"), + }, + VhdContainers: []*string{ + to.Ptr("tkzcwddtinkfpnfklatw"), + }, + ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + }, + }, + DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + }, + DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + { + Name: to.Ptr("eogiykmdmeikswxmigjws"), + Lun: to.Ptr[int32](14), + Caching: to.Ptr(armcomputefleet.CachingTypesNone), + WriteAcceleratorEnabled: to.Ptr(true), + CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + DiskSizeGB: to.Ptr[int32](6), + ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + }, + }, + }, + DiskIOPSReadWrite: to.Ptr[int64](27), + DiskMBpsReadWrite: to.Ptr[int64](2), + DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + }, + }, + }, + NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + HealthProbe: &armcomputefleet.APIEntityReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + }, + NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + { + Name: to.Ptr("i"), + Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + Primary: to.Ptr(true), + EnableAcceleratedNetworking: to.Ptr(true), + DisableTCPStateTracking: to.Ptr(true), + EnableFpga: to.Ptr(true), + NetworkSecurityGroup: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + }, + DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + DNSServers: []*string{ + to.Ptr("nxmmfolhclsesu"), + }, + }, + IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + { + Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + Subnet: &armcomputefleet.APIEntityReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + }, + Primary: to.Ptr(true), + PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + Name: to.Ptr("fvpqf"), + Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + IdleTimeoutInMinutes: to.Ptr[int32](9), + DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + }, + IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + { + IPTagType: to.Ptr("sddgsoemnzgqizale"), + Tag: to.Ptr("wufmhrjsakbiaetyara"), + }, + }, + PublicIPPrefix: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + }, + PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + }, + SKU: &armcomputefleet.PublicIPAddressSKU{ + Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + }, + }, + PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + }, + }, + ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + }, + }, + LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + }, + }, + LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + { + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + }, + }, + }, + }, + }, + EnableIPForwarding: to.Ptr(true), + DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + }, + }, + }, + NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersion20201101), + }, + SecurityProfile: &armcomputefleet.SecurityProfile{ + UefiSettings: &armcomputefleet.UefiSettings{ + SecureBootEnabled: to.Ptr(true), + VTpmEnabled: to.Ptr(true), + }, + EncryptionAtHost: to.Ptr(true), + SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + }, + ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + Enabled: to.Ptr(true), + Mode: to.Ptr(armcomputefleet.ModeAudit), + KeyIncarnationID: to.Ptr[int32](20), + }, + }, + DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + BootDiagnostics: &armcomputefleet.BootDiagnostics{ + Enabled: to.Ptr(true), + StorageURI: to.Ptr("rzamfwghybpx"), + }, + }, + ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + { + Name: to.Ptr("bndxuxx"), + Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + ForceUpdateTag: to.Ptr("yhgxw"), + Publisher: to.Ptr("kpxtirxjfprhs"), + Type: to.Ptr("pgjilctjjwaa"), + TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + AutoUpgradeMinorVersion: to.Ptr(true), + EnableAutomaticUpgrade: to.Ptr(true), + Settings: map[string]any{}, + ProtectedSettings: map[string]any{}, + ProvisionAfterExtensions: []*string{ + to.Ptr("nftzosroolbcwmpupujzqwqe"), + }, + SuppressFailures: to.Ptr(true), + ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + SecretURL: to.Ptr("vyhzfkqsqanacgzjthpjoe"), + SourceVault: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + }, + }, + }, + }, + }, + ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + }, + LicenseType: to.Ptr("v"), + ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + NotBeforeTimeout: to.Ptr("iljppmmw"), + Enable: to.Ptr(true), + }, + OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + Enable: to.Ptr(true), + }, + }, + UserData: to.Ptr("s"), + CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + CapacityReservationGroup: &armcomputefleet.SubResource{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + }, + }, + ApplicationProfile: &armcomputefleet.ApplicationProfile{ + GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + { + Tags: to.Ptr("eyrqjbib"), + Order: to.Ptr[int32](5), + PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + ConfigurationReference: to.Ptr("ulztmiavpojpbpbddgnuuiimxcpau"), + TreatFailureAsDeploymentFailure: to.Ptr(true), + EnableAutomaticUpgrade: to.Ptr(true), + }, + }, + }, + HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + VMSizeProperties: &armcomputefleet.VMSizeProperties{ + VCPUsAvailable: to.Ptr[int32](16), + VCPUsPerCore: to.Ptr[int32](23), + }, + }, + ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + }, + SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), + ExcludeExtensions: []*string{ + to.Ptr("{securityPostureVMExtensionName}"), + }, + IsOverridable: to.Ptr(true), + }, + }, + ComputeAPIVersion: to.Ptr("2023-07-01"), + PlatformFaultDomainCount: to.Ptr[int32](1), + }, + }, + Plan: &armcomputefleet.ResourcePlanUpdate{ + Name: to.Ptr("jwgrcrnrtfoxn"), + Publisher: to.Ptr("iozjbiqqckqm"), + Product: to.Ptr("cgopbyvdyqikahwyxfpzwaqk"), + PromotionCode: to.Ptr("naglezezplcaruqogtxnuizslqnnbr"), + Version: to.Ptr("wa"), + }, + }, 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 = armcomputefleet.FleetsClientUpdateResponse{ + // Fleet: &armcomputefleet.Fleet{ + // Properties: &armcomputefleet.FleetProperties{ + // SpotPriorityProfile: &armcomputefleet.SpotPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // MaxPricePerVM: to.Ptr[float32](0.00865), + // EvictionPolicy: to.Ptr(armcomputefleet.EvictionPolicyDelete), + // AllocationStrategy: to.Ptr(armcomputefleet.SpotAllocationStrategyPriceCapacityOptimized), + // Maintain: to.Ptr(true), + // }, + // RegularPriorityProfile: &armcomputefleet.RegularPriorityProfile{ + // Capacity: to.Ptr[int32](20), + // MinCapacity: to.Ptr[int32](10), + // AllocationStrategy: to.Ptr(armcomputefleet.RegularPriorityAllocationStrategyLowestPrice), + // }, + // VMSizesProfile: []*armcomputefleet.VMSizeProfile{ + // { + // Name: to.Ptr("Standard_d1_v2"), + // Rank: to.Ptr[int32](19225), + // }, + // }, + // ComputeProfile: &armcomputefleet.ComputeProfile{ + // BaseVirtualMachineProfile: &armcomputefleet.BaseVirtualMachineProfile{ + // OSProfile: &armcomputefleet.VirtualMachineScaleSetOSProfile{ + // ComputerNamePrefix: to.Ptr("o"), + // AdminUsername: to.Ptr("nrgzqciiaaxjrqldbmjbqkyhntp"), + // WindowsConfiguration: &armcomputefleet.WindowsConfiguration{ + // ProvisionVMAgent: to.Ptr(true), + // EnableAutomaticUpdates: to.Ptr(true), + // TimeZone: to.Ptr("hlyjiqcfksgrpjrct"), + // AdditionalUnattendContent: []*armcomputefleet.AdditionalUnattendContent{ + // { + // PassName: to.Ptr("OobeSystem"), + // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), + // SettingName: to.Ptr(armcomputefleet.SettingNamesAutoLogon), + // }, + // }, + // PatchSettings: &armcomputefleet.PatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.WindowsVMGuestPatchModeManual), + // EnableHotpatching: to.Ptr(true), + // AssessmentMode: to.Ptr(armcomputefleet.WindowsPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.WindowsVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // WinRM: &armcomputefleet.WinRMConfiguration{ + // Listeners: []*armcomputefleet.WinRMListener{ + // { + // Protocol: to.Ptr(armcomputefleet.ProtocolTypesHTTP), + // CertificateURL: to.Ptr("phwesineizrl"), + // }, + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // LinuxConfiguration: &armcomputefleet.LinuxConfiguration{ + // DisablePasswordAuthentication: to.Ptr(true), + // SSH: &armcomputefleet.SSHConfiguration{ + // PublicKeys: []*armcomputefleet.SSHPublicKey{ + // { + // Path: to.Ptr("kmqz"), + // KeyData: to.Ptr("kivgsubusvpprwqaqpjcmhsv"), + // }, + // }, + // }, + // ProvisionVMAgent: to.Ptr(true), + // PatchSettings: &armcomputefleet.LinuxPatchSettings{ + // PatchMode: to.Ptr(armcomputefleet.LinuxVMGuestPatchModeImageDefault), + // AssessmentMode: to.Ptr(armcomputefleet.LinuxPatchAssessmentModeImageDefault), + // AutomaticByPlatformSettings: &armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformSettings{ + // RebootSetting: to.Ptr(armcomputefleet.LinuxVMGuestPatchAutomaticByPlatformRebootSettingUnknown), + // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), + // }, + // }, + // EnableVMAgentPlatformUpdates: to.Ptr(true), + // }, + // Secrets: []*armcomputefleet.VaultSecretGroup{ + // { + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // VaultCertificates: []*armcomputefleet.VaultCertificate{ + // { + // CertificateURL: to.Ptr("tyldwkzafmnkvpo"), + // CertificateStore: to.Ptr("nlxrwavpzhueffxsshlun"), + // }, + // }, + // }, + // }, + // AllowExtensionOperations: to.Ptr(true), + // RequireGuestProvisionSignal: to.Ptr(true), + // }, + // StorageProfile: &armcomputefleet.VirtualMachineScaleSetStorageProfile{ + // ImageReference: &armcomputefleet.ImageReference{ + // Publisher: to.Ptr("mqxgwbiyjzmxavhbkd"), + // Offer: to.Ptr("isxgumkarlkomp"), + // SKU: to.Ptr("eojmppqcrnpmxirtp"), + // Version: to.Ptr("wvpcqefgtmqdgltiuz"), + // SharedGalleryImageID: to.Ptr("kmkgihoxwlawuuhcinfirktdwkmx"), + // CommunityGalleryImageID: to.Ptr("vlqe"), + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageName}/versions/{versionName}"), + // ExactVersion: to.Ptr("zjbntmiskjexlr"), + // }, + // OSDisk: &armcomputefleet.VirtualMachineScaleSetOSDisk{ + // Name: to.Ptr("wfttw"), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiffDiskSettings: &armcomputefleet.DiffDiskSettings{ + // Option: to.Ptr(armcomputefleet.DiffDiskOptionsLocal), + // Placement: to.Ptr(armcomputefleet.DiffDiskPlacementCacheDisk), + // }, + // DiskSizeGB: to.Ptr[int32](14), + // OSType: to.Ptr(armcomputefleet.OperatingSystemTypesWindows), + // Image: &armcomputefleet.VirtualHardDisk{ + // URI: to.Ptr("thqceubivdrjs"), + // }, + // VhdContainers: []*string{ + // to.Ptr("tkzcwddtinkfpnfklatw"), + // }, + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // DataDisks: []*armcomputefleet.VirtualMachineScaleSetDataDisk{ + // { + // Name: to.Ptr("eogiykmdmeikswxmigjws"), + // Lun: to.Ptr[int32](14), + // Caching: to.Ptr(armcomputefleet.CachingTypesNone), + // WriteAcceleratorEnabled: to.Ptr(true), + // CreateOption: to.Ptr(armcomputefleet.DiskCreateOptionTypesFromImage), + // DiskSizeGB: to.Ptr[int32](6), + // ManagedDisk: &armcomputefleet.VirtualMachineScaleSetManagedDiskParameters{ + // StorageAccountType: to.Ptr(armcomputefleet.StorageAccountTypesStandardLRS), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // SecurityProfile: &armcomputefleet.VMDiskSecurityProfile{ + // SecurityEncryptionType: to.Ptr(armcomputefleet.SecurityEncryptionTypesVMGuestStateOnly), + // DiskEncryptionSet: &armcomputefleet.DiskEncryptionSetParameters{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), + // }, + // }, + // }, + // DiskIOPSReadWrite: to.Ptr[int64](27), + // DiskMBpsReadWrite: to.Ptr[int64](2), + // DeleteOption: to.Ptr(armcomputefleet.DiskDeleteOptionTypesDelete), + // }, + // }, + // }, + // NetworkProfile: &armcomputefleet.VirtualMachineScaleSetNetworkProfile{ + // HealthProbe: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}"), + // }, + // NetworkInterfaceConfigurations: []*armcomputefleet.VirtualMachineScaleSetNetworkConfiguration{ + // { + // Name: to.Ptr("i"), + // Properties: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationProperties{ + // Primary: to.Ptr(true), + // EnableAcceleratedNetworking: to.Ptr(true), + // DisableTCPStateTracking: to.Ptr(true), + // EnableFpga: to.Ptr(true), + // NetworkSecurityGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"), + // }, + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ + // DNSServers: []*string{ + // to.Ptr("nxmmfolhclsesu"), + // }, + // }, + // IPConfigurations: []*armcomputefleet.VirtualMachineScaleSetIPConfiguration{ + // { + // Name: to.Ptr("oezqhkidfhyywlfzwuotilrpbqnjg"), + // Properties: &armcomputefleet.VirtualMachineScaleSetIPConfigurationProperties{ + // Subnet: &armcomputefleet.APIEntityReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}"), + // }, + // Primary: to.Ptr(true), + // PublicIPAddressConfiguration: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfiguration{ + // Name: to.Ptr("fvpqf"), + // Properties: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ + // IdleTimeoutInMinutes: to.Ptr[int32](9), + // DNSSettings: &armcomputefleet.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ + // DomainNameLabel: to.Ptr("ukrddzvmorpmfsczjwtbvp"), + // DomainNameLabelScope: to.Ptr(armcomputefleet.DomainNameLabelScopeTypesTenantReuse), + // }, + // IPTags: []*armcomputefleet.VirtualMachineScaleSetIPTag{ + // { + // IPTagType: to.Ptr("sddgsoemnzgqizale"), + // Tag: to.Ptr("wufmhrjsakbiaetyara"), + // }, + // }, + // PublicIPPrefix: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}"), + // }, + // PublicIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // }, + // SKU: &armcomputefleet.PublicIPAddressSKU{ + // Name: to.Ptr(armcomputefleet.PublicIPAddressSKUNameBasic), + // Tier: to.Ptr(armcomputefleet.PublicIPAddressSKUTierRegional), + // }, + // }, + // PrivateIPAddressVersion: to.Ptr(armcomputefleet.IPVersionIPv4), + // ApplicationGatewayBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // ApplicationSecurityGroups: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}"), + // }, + // }, + // LoadBalancerBackendAddressPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}"), + // }, + // }, + // LoadBalancerInboundNatPools: []*armcomputefleet.SubResource{ + // { + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}"), + // }, + // }, + // }, + // }, + // }, + // EnableIPForwarding: to.Ptr(true), + // DeleteOption: to.Ptr(armcomputefleet.DeleteOptionsDelete), + // AuxiliaryMode: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliaryModeNone), + // AuxiliarySKU: to.Ptr(armcomputefleet.NetworkInterfaceAuxiliarySKUNone), + // }, + // }, + // }, + // NetworkAPIVersion: to.Ptr(armcomputefleet.NetworkAPIVersion20201101), + // }, + // SecurityProfile: &armcomputefleet.SecurityProfile{ + // UefiSettings: &armcomputefleet.UefiSettings{ + // SecureBootEnabled: to.Ptr(true), + // VTpmEnabled: to.Ptr(true), + // }, + // EncryptionAtHost: to.Ptr(true), + // SecurityType: to.Ptr(armcomputefleet.SecurityTypesTrustedLaunch), + // EncryptionIdentity: &armcomputefleet.EncryptionIdentity{ + // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{userAssignedIdentityName}"), + // }, + // ProxyAgentSettings: &armcomputefleet.ProxyAgentSettings{ + // Enabled: to.Ptr(true), + // Mode: to.Ptr(armcomputefleet.ModeAudit), + // KeyIncarnationID: to.Ptr[int32](20), + // }, + // }, + // DiagnosticsProfile: &armcomputefleet.DiagnosticsProfile{ + // BootDiagnostics: &armcomputefleet.BootDiagnostics{ + // Enabled: to.Ptr(true), + // StorageURI: to.Ptr("rzamfwghybpx"), + // }, + // }, + // ExtensionProfile: &armcomputefleet.VirtualMachineScaleSetExtensionProfile{ + // Extensions: []*armcomputefleet.VirtualMachineScaleSetExtension{ + // { + // Name: to.Ptr("bndxuxx"), + // Properties: &armcomputefleet.VirtualMachineScaleSetExtensionProperties{ + // ForceUpdateTag: to.Ptr("yhgxw"), + // Publisher: to.Ptr("kpxtirxjfprhs"), + // Type: to.Ptr("pgjilctjjwaa"), + // TypeHandlerVersion: to.Ptr("zevivcoilxmbwlrihhhibq"), + // AutoUpgradeMinorVersion: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // ProvisionAfterExtensions: []*string{ + // to.Ptr("nftzosroolbcwmpupujzqwqe"), + // }, + // SuppressFailures: to.Ptr(true), + // ProtectedSettingsFromKeyVault: &armcomputefleet.KeyVaultSecretReference{ + // SecretURL: to.Ptr("vyhzfkqsqanacgzjthpjoe"), + // SourceVault: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}"), + // }, + // }, + // Settings: map[string]any{ + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // }, + // Type: to.Ptr("cmeam"), + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{extensionName}"), + // }, + // }, + // ExtensionsTimeBudget: to.Ptr("mbhjahtdygwgyszdwjtvlvtgchdwil"), + // }, + // LicenseType: to.Ptr("v"), + // ScheduledEventsProfile: &armcomputefleet.ScheduledEventsProfile{ + // TerminateNotificationProfile: &armcomputefleet.TerminateNotificationProfile{ + // NotBeforeTimeout: to.Ptr("iljppmmw"), + // Enable: to.Ptr(true), + // }, + // OSImageNotificationProfile: &armcomputefleet.OSImageNotificationProfile{ + // NotBeforeTimeout: to.Ptr("olbpadmevekyczfokodtfprxti"), + // Enable: to.Ptr(true), + // }, + // }, + // UserData: to.Ptr("s"), + // CapacityReservation: &armcomputefleet.CapacityReservationProfile{ + // CapacityReservationGroup: &armcomputefleet.SubResource{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), + // }, + // }, + // ApplicationProfile: &armcomputefleet.ApplicationProfile{ + // GalleryApplications: []*armcomputefleet.VMGalleryApplication{ + // { + // Tags: to.Ptr("eyrqjbib"), + // Order: to.Ptr[int32](5), + // PackageReferenceID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{applicationName}/versions/{versionName}"), + // TreatFailureAsDeploymentFailure: to.Ptr(true), + // EnableAutomaticUpgrade: to.Ptr(true), + // }, + // }, + // }, + // HardwareProfile: &armcomputefleet.VirtualMachineScaleSetHardwareProfile{ + // VMSizeProperties: &armcomputefleet.VMSizeProperties{ + // VCPUsAvailable: to.Ptr[int32](16), + // VCPUsPerCore: to.Ptr[int32](23), + // }, + // }, + // ServiceArtifactReference: &armcomputefleet.ServiceArtifactReference{ + // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/serviceArtifacts/{serviceArtifactsName}/vmArtifactsProfiles/{vmArtifactsProfileName}"), + // }, + // SecurityPostureReference: &armcomputefleet.SecurityPostureReference{ + // ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), + // ExcludeExtensions: []*string{ + // to.Ptr("{securityPostureVMExtensionName}"), + // }, + // IsOverridable: to.Ptr(true), + // }, + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // ComputeAPIVersion: to.Ptr("2023-07-01"), + // PlatformFaultDomainCount: to.Ptr[int32](1), + // }, + // ProvisioningState: to.Ptr(armcomputefleet.ProvisioningStateCreating), + // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-10T00:16:34.8590555+00:00"); return t}()), + // UniqueID: to.Ptr("a2f7fabd-bbc2-4a20-afe1-49fdb3885a28"), + // }, + // Zones: []*string{ + // to.Ptr("zone1"), + // to.Ptr("zone2"), + // }, + // Identity: &armcomputefleet.ManagedServiceIdentity{ + // Type: to.Ptr(armcomputefleet.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armcomputefleet.UserAssignedIdentity{ + // }, + // PrincipalID: to.Ptr("4d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // TenantID: to.Ptr("5d508e5b-374b-4382-9a1c-01fb8b6cb37c"), + // }, + // Tags: map[string]*string{ + // }, + // Location: to.Ptr("westus"), + // Plan: &armcomputefleet.Plan{ + // Name: to.Ptr("uapfngmdekvpgjhomthtpxjfdmmll"), + // Publisher: to.Ptr("aqhles"), + // Product: to.Ptr("bfzbkdnbexmedxdc"), + // PromotionCode: to.Ptr("gspehogwfjxirz"), + // Version: to.Ptr("yza"), + // }, + // ID: to.Ptr("/subscriptions/7B0CD4DB-3381-4013-9B31-FB6E6FD0FF1C/resourceGroups/rgazurefleet/providers/Microsoft.AzureFleet/fleets/testFleet"), + // Name: to.Ptr("testFleet"), + // Type: to.Ptr("Microsoft.AzureFleet/fleets"), + // SystemData: &armcomputefleet.SystemData{ + // CreatedBy: to.Ptr("rowegentrpoajsv"), + // CreatedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // LastModifiedBy: to.Ptr("edwuayhhaoepxzisfaqjhmrxjq"), + // LastModifiedByType: to.Ptr(armcomputefleet.CreatedByTypeUser), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-04-29T21:51:44.043Z"); return t}()), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/go.mod b/sdk/resourcemanager/computefleet/armcomputefleet/go.mod index 25682f2d2194..43724ff7ef95 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/go.mod +++ b/sdk/resourcemanager/computefleet/armcomputefleet/go.mod @@ -2,10 +2,20 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcom go 1.18 -require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 +require ( + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 +) require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.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.25.0 // indirect golang.org/x/net v0.27.0 // indirect + golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/go.sum b/sdk/resourcemanager/computefleet/armcomputefleet/go.sum index 917448a001b7..09d275cb9a37 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/go.sum +++ b/sdk/resourcemanager/computefleet/armcomputefleet/go.sum @@ -1,12 +1,29 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= +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.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= +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.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.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/computefleet/armcomputefleet/operations_client_example_test.go b/sdk/resourcemanager/computefleet/armcomputefleet/operations_client_example_test.go new file mode 100644 index 000000000000..419439f85dd3 --- /dev/null +++ b/sdk/resourcemanager/computefleet/armcomputefleet/operations_client_example_test.go @@ -0,0 +1,98 @@ +// 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) Go Code Generator. DO NOT EDIT. + +package armcomputefleet_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet" + "log" +) + +// Generated from example definition: /mnt/vss/_work/1/s/azure-sdk-for-go/src/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/computefleet/armcomputefleet/TempTypeSpecFiles/AzureFleet.Management/examples/2024-05-01-preview/Operations_List.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 := armcomputefleet.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 = armcomputefleet.OperationsClientListResponse{ + // OperationListResult: armcomputefleet.OperationListResult{ + // Value: []*armcomputefleet.Operation{ + // { + // Origin: to.Ptr(armcomputefleet.OriginUserSystem), + // Name: to.Ptr("Microsoft.AzureFleet/fleets/read"), + // IsDataAction: to.Ptr(false), + // Display: &armcomputefleet.OperationDisplay{ + // Provider: to.Ptr("Microsoft Azure Fleet"), + // Resource: to.Ptr("Fleets"), + // Operation: to.Ptr("Get Azure Fleet"), + // Description: to.Ptr("Get properties of Azure Fleet resource"), + // }, + // }, + // { + // Origin: to.Ptr(armcomputefleet.OriginUserSystem), + // Name: to.Ptr("Microsoft.AzureFleet/fleets/write"), + // IsDataAction: to.Ptr(false), + // Display: &armcomputefleet.OperationDisplay{ + // Provider: to.Ptr("Microsoft Azure Fleet"), + // Resource: to.Ptr("Fleets"), + // Operation: to.Ptr("Create or Update Azure Fleet"), + // Description: to.Ptr("Creates a new Azure Fleet resource or updates an existing one"), + // }, + // }, + // { + // Origin: to.Ptr(armcomputefleet.OriginUserSystem), + // Name: to.Ptr("Microsoft.AzureFleet/fleets/delete"), + // IsDataAction: to.Ptr(false), + // Display: &armcomputefleet.OperationDisplay{ + // Provider: to.Ptr("Microsoft Azure Fleet"), + // Resource: to.Ptr("Fleets"), + // Operation: to.Ptr("Delete Virtual Machine and Virtual Machine scale sets in a Azure Fleet resource"), + // Description: to.Ptr("Deletes all compute resources of Azure Fleet resource"), + // }, + // }, + // { + // Origin: to.Ptr(armcomputefleet.OriginUserSystem), + // Name: to.Ptr("Microsoft.AzureFleet/register/action"), + // IsDataAction: to.Ptr(false), + // Display: &armcomputefleet.OperationDisplay{ + // Provider: to.Ptr("Microsoft Azure Fleet"), + // Resource: to.Ptr("Subscription"), + // Operation: to.Ptr("Register subscription for Microsoft.AzureFleet"), + // Description: to.Ptr("Registers Subscription with Microsoft.AzureFleet resource provider"), + // }, + // }, + // { + // Origin: to.Ptr(armcomputefleet.OriginUserSystem), + // Name: to.Ptr("Microsoft.AzureFleet/unregister/action"), + // IsDataAction: to.Ptr(false), + // Display: &armcomputefleet.OperationDisplay{ + // Provider: to.Ptr("Microsoft Azure Fleet"), + // Resource: to.Ptr("Subscription"), + // Operation: to.Ptr("Unregister Subscription for Microsoft.AzureFleet"), + // Description: to.Ptr("Unregisters Subscription with Microsoft.AzureFleet resource provider"), + // }, + // }, + // }, + // }, + // } + } +} diff --git a/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml b/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml index f26478624109..e384d10c0456 100644 --- a/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml +++ b/sdk/resourcemanager/computefleet/armcomputefleet/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/azurefleet/AzureFleet.Management -commit: aa23ddc02b2b1c5a34c56a49d83b77c0a1aaa614 -repo: Azure/azure-rest-api-specs -additionalDirectories: +commit: dbd4ab30fd9f49e48ba6d2f50e5448d33742edb7 +repo: test-repo-billy/azure-rest-api-specs +additionalDirectories: \ No newline at end of file