diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md b/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md index 20f5fda43cff..a93e2384340d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md +++ b/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md @@ -1,5 +1,84 @@ # Release History +## 3.0.0-beta.2 (2024-03-25) +### Breaking Changes + +- Type of `JavaComponent.Properties` has been changed from `*JavaComponentProperties` to `JavaComponentPropertiesClassification` +- `DotNetComponentTypeAspireResourceServerAPI` from enum `DotNetComponentType` has been removed + +### Features Added + +- New value `JavaComponentTypeNacos` added to enum type `JavaComponentType` +- New enum type `DetectionStatus` with values `DetectionStatusFailed`, `DetectionStatusRegistryLoginFailed`, `DetectionStatusSucceeded` +- New enum type `ImageType` with values `ImageTypeCloudBuild`, `ImageTypeContainerImage` +- New enum type `PatchApplyStatus` with values `PatchApplyStatusCanceled`, `PatchApplyStatusCreatingRevision`, `PatchApplyStatusImagePushPullFailed`, `PatchApplyStatusManuallySkipped`, `PatchApplyStatusNotStarted`, `PatchApplyStatusRebaseFailed`, `PatchApplyStatusRebaseInProgress`, `PatchApplyStatusRevisionCreationFailed`, `PatchApplyStatusSucceeded` +- New enum type `PatchType` with values `PatchTypeFrameworkAndOSSecurity`, `PatchTypeFrameworkSecurity`, `PatchTypeOSSecurity`, `PatchTypeOther` +- New enum type `PatchingMode` with values `PatchingModeAutomatic`, `PatchingModeDisabled`, `PatchingModeManual` +- New function `*ClientFactory.NewContainerAppsBuildsByContainerAppClient() *ContainerAppsBuildsByContainerAppClient` +- New function `*ClientFactory.NewContainerAppsBuildsClient() *ContainerAppsBuildsClient` +- New function `*ClientFactory.NewContainerAppsPatchesClient() *ContainerAppsPatchesClient` +- New function `*ClientFactory.NewFunctionsExtensionClient() *FunctionsExtensionClient` +- New function `NewContainerAppsBuildsByContainerAppClient(string, string, azcore.TokenCredential, *arm.ClientOptions) (*ContainerAppsBuildsByContainerAppClient, error)` +- New function `*ContainerAppsBuildsByContainerAppClient.NewListPager(string, *ContainerAppsBuildsByContainerAppClientListOptions) *runtime.Pager[ContainerAppsBuildsByContainerAppClientListResponse]` +- New function `NewContainerAppsBuildsClient(string, string, azcore.TokenCredential, *arm.ClientOptions) (*ContainerAppsBuildsClient, error)` +- New function `*ContainerAppsBuildsClient.BeginDelete(context.Context, string, string, *ContainerAppsBuildsClientBeginDeleteOptions) (*runtime.Poller[ContainerAppsBuildsClientDeleteResponse], error)` +- New function `*ContainerAppsBuildsClient.Get(context.Context, string, string, *ContainerAppsBuildsClientGetOptions) (ContainerAppsBuildsClientGetResponse, error)` +- New function `NewContainerAppsPatchesClient(string, string, azcore.TokenCredential, *arm.ClientOptions) (*ContainerAppsPatchesClient, error)` +- New function `*ContainerAppsPatchesClient.BeginApply(context.Context, string, string, *ContainerAppsPatchesClientBeginApplyOptions) (*runtime.Poller[ContainerAppsPatchesClientApplyResponse], error)` +- New function `*ContainerAppsPatchesClient.BeginDelete(context.Context, string, string, *ContainerAppsPatchesClientBeginDeleteOptions) (*runtime.Poller[ContainerAppsPatchesClientDeleteResponse], error)` +- New function `*ContainerAppsPatchesClient.Get(context.Context, string, string, *ContainerAppsPatchesClientGetOptions) (ContainerAppsPatchesClientGetResponse, error)` +- New function `*ContainerAppsPatchesClient.NewListByContainerAppPager(string, *ContainerAppsPatchesClientListByContainerAppOptions) *runtime.Pager[ContainerAppsPatchesClientListByContainerAppResponse]` +- New function `*ContainerAppsPatchesClient.BeginSkipConfigure(context.Context, string, string, PatchSkipConfig, *ContainerAppsPatchesClientBeginSkipConfigureOptions) (*runtime.Poller[ContainerAppsPatchesClientSkipConfigureResponse], error)` +- New function `NewFunctionsExtensionClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FunctionsExtensionClient, error)` +- New function `*FunctionsExtensionClient.InvokeFunctionsHost(context.Context, string, string, string, string, *FunctionsExtensionClientInvokeFunctionsHostOptions) (FunctionsExtensionClientInvokeFunctionsHostResponse, error)` +- New function `*JavaComponentProperties.GetJavaComponentProperties() *JavaComponentProperties` +- New function `*SpringBootAdminComponent.GetJavaComponentProperties() *JavaComponentProperties` +- New function `*SpringCloudConfigComponent.GetJavaComponentProperties() *JavaComponentProperties` +- New function `*SpringCloudEurekaComponent.GetJavaComponentProperties() *JavaComponentProperties` +- New function `*NacosComponent.GetJavaComponentProperties() *JavaComponentProperties` +- New struct `ContainerAppPropertiesPatchingConfiguration` +- New struct `ContainerAppsBuildCollection` +- New struct `ContainerAppsBuildConfiguration` +- New struct `ContainerAppsBuildProperties` +- New struct `ContainerAppsBuildResource` +- New struct `ContainerAppsPatchResource` +- New struct `ContainerRegistryWithCustomImageAutoGenerated` +- New struct `ErrorDetailAutoGenerated` +- New struct `ErrorResponseAutoGenerated` +- New struct `ExecutionContainerStatus` +- New struct `ExecutionJobStatus` +- New struct `ExecutionPodStatus` +- New struct `HTTPGetAutoGenerated` +- New struct `JavaComponentIngress` +- New struct `LogLevelSetting` +- New struct `ManagedEnvironmentPropertiesPeerTrafficConfiguration` +- New struct `ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption` +- New struct `NacosComponent` +- New struct `PatchCollection` +- New struct `PatchDetails` +- New struct `PatchDetailsNewLayer` +- New struct `PatchDetailsOldLayer` +- New struct `PatchProperties` +- New struct `PatchSkipConfig` +- New struct `PreBuildStepAutoGenerated` +- New struct `ProxyResourceAutoGenerated` +- New struct `ResourceAutoGenerated` +- New struct `Runtime` +- New struct `RuntimeDotnet` +- New struct `RuntimeJava` +- New struct `RuntimeJavaAgent` +- New struct `SpringBootAdminComponent` +- New struct `SpringCloudConfigComponent` +- New struct `SpringCloudEurekaComponent` +- New field `ImageType` in struct `BaseContainer` +- New field `Runtime` in struct `Configuration` +- New field `ImageType` in struct `Container` +- New field `PatchingConfiguration` in struct `ContainerAppProperties` +- New field `ImageType` in struct `InitContainer` +- New field `DetailedStatus` in struct `JobExecutionProperties` +- New field `PeerTrafficConfiguration` in struct `ManagedEnvironmentProperties` + + ## 3.0.0-beta.1 (2024-03-22) ### Breaking Changes diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/appresiliency_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/appresiliency_client.go index 93601eb22559..90347051f507 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/appresiliency_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/appresiliency_client.go @@ -46,7 +46,7 @@ func NewAppResiliencyClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Create or update container app resiliency policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - appName - Name of the Container App. // - name - Name of the resiliency policy. @@ -99,7 +99,7 @@ func (client *AppResiliencyClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resiliencyEnvelope); err != nil { @@ -120,7 +120,7 @@ func (client *AppResiliencyClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Delete container app resiliency policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - appName - Name of the Container App. // - name - Name of the resiliency policy. @@ -170,7 +170,7 @@ func (client *AppResiliencyClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -179,7 +179,7 @@ func (client *AppResiliencyClient) deleteCreateRequest(ctx context.Context, reso // Get - Get container app resiliency policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - appName - Name of the Container App. // - name - Name of the resiliency policy. @@ -230,7 +230,7 @@ func (client *AppResiliencyClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,7 +247,7 @@ func (client *AppResiliencyClient) getHandleResponse(resp *http.Response) (AppRe // NewListPager - List container app resiliency policies. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - appName - Name of the Container App. // - options - AppResiliencyClientListOptions contains the optional parameters for the AppResiliencyClient.NewListPager method. @@ -294,7 +294,7 @@ func (client *AppResiliencyClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -312,7 +312,7 @@ func (client *AppResiliencyClient) listHandleResponse(resp *http.Response) (AppR // Update - Update container app resiliency policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - appName - Name of the Container App. // - name - Name of the resiliency policy. @@ -364,7 +364,7 @@ func (client *AppResiliencyClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resiliencyEnvelope); err != nil { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/appresiliency_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/appresiliency_client_example_test.go deleted file mode 100644 index b88a241d9973..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/appresiliency_client_example_test.go +++ /dev/null @@ -1,382 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_CreateOrUpdate.json -func ExampleAppResiliencyClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAppResiliencyClient().CreateOrUpdate(ctx, "rg", "testcontainerApp0", "resiliency-policy-1", armappcontainers.AppResiliency{ - Properties: &armappcontainers.AppResiliencyProperties{ - CircuitBreakerPolicy: &armappcontainers.CircuitBreakerPolicy{ - ConsecutiveErrors: to.Ptr[int32](5), - IntervalInSeconds: to.Ptr[int32](10), - MaxEjectionPercent: to.Ptr[int32](50), - }, - HTTPConnectionPool: &armappcontainers.HTTPConnectionPool{ - HTTP1MaxPendingRequests: to.Ptr[int32](1024), - HTTP2MaxRequests: to.Ptr[int32](1024), - }, - HTTPRetryPolicy: &armappcontainers.HTTPRetryPolicy{ - Matches: &armappcontainers.HTTPRetryPolicyMatches{ - Errors: []*string{ - to.Ptr("5xx"), - to.Ptr("connect-failure"), - to.Ptr("reset"), - to.Ptr("retriable-headers"), - to.Ptr("retriable-status-codes")}, - Headers: []*armappcontainers.HeaderMatch{ - { - Header: to.Ptr("X-Content-Type"), - Match: &armappcontainers.HeaderMatchMatch{ - PrefixMatch: to.Ptr("GOATS"), - }, - }}, - HTTPStatusCodes: []*int32{ - to.Ptr[int32](502), - to.Ptr[int32](503)}, - }, - MaxRetries: to.Ptr[int32](5), - RetryBackOff: &armappcontainers.HTTPRetryPolicyRetryBackOff{ - InitialDelayInMilliseconds: to.Ptr[int64](1000), - MaxIntervalInMilliseconds: to.Ptr[int64](10000), - }, - }, - TCPConnectionPool: &armappcontainers.TCPConnectionPool{ - MaxConnections: to.Ptr[int32](100), - }, - TCPRetryPolicy: &armappcontainers.TCPRetryPolicy{ - MaxConnectAttempts: to.Ptr[int32](3), - }, - TimeoutPolicy: &armappcontainers.TimeoutPolicy{ - ConnectionTimeoutInSeconds: to.Ptr[int32](5), - ResponseTimeoutInSeconds: to.Ptr[int32](15), - }, - }, - }, 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.AppResiliency = armappcontainers.AppResiliency{ - // Name: to.Ptr("resiliency-policy-1"), - // Type: to.Ptr("Microsoft.App/containerApps/resiliencyPolicies"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0/resiliencyPolicies/resiliency-policy-1"), - // Properties: &armappcontainers.AppResiliencyProperties{ - // CircuitBreakerPolicy: &armappcontainers.CircuitBreakerPolicy{ - // ConsecutiveErrors: to.Ptr[int32](5), - // IntervalInSeconds: to.Ptr[int32](10), - // MaxEjectionPercent: to.Ptr[int32](50), - // }, - // HTTPConnectionPool: &armappcontainers.HTTPConnectionPool{ - // HTTP1MaxPendingRequests: to.Ptr[int32](1024), - // HTTP2MaxRequests: to.Ptr[int32](1024), - // }, - // HTTPRetryPolicy: &armappcontainers.HTTPRetryPolicy{ - // Matches: &armappcontainers.HTTPRetryPolicyMatches{ - // Errors: []*string{ - // to.Ptr("5xx"), - // to.Ptr("connect-failure"), - // to.Ptr("reset"), - // to.Ptr("retriable-headers"), - // to.Ptr("retriable-status-codes")}, - // Headers: []*armappcontainers.HeaderMatch{ - // { - // Header: to.Ptr("X-Content-Type"), - // Match: &armappcontainers.HeaderMatchMatch{ - // PrefixMatch: to.Ptr("GOATS"), - // }, - // }}, - // HTTPStatusCodes: []*int32{ - // to.Ptr[int32](502), - // to.Ptr[int32](503)}, - // }, - // MaxRetries: to.Ptr[int32](5), - // RetryBackOff: &armappcontainers.HTTPRetryPolicyRetryBackOff{ - // InitialDelayInMilliseconds: to.Ptr[int64](1000), - // MaxIntervalInMilliseconds: to.Ptr[int64](10000), - // }, - // }, - // TCPConnectionPool: &armappcontainers.TCPConnectionPool{ - // MaxConnections: to.Ptr[int32](100), - // }, - // TCPRetryPolicy: &armappcontainers.TCPRetryPolicy{ - // MaxConnectAttempts: to.Ptr[int32](3), - // }, - // TimeoutPolicy: &armappcontainers.TimeoutPolicy{ - // ConnectionTimeoutInSeconds: to.Ptr[int32](5), - // ResponseTimeoutInSeconds: to.Ptr[int32](15), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_Patch.json -func ExampleAppResiliencyClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAppResiliencyClient().Update(ctx, "rg", "testcontainerApp0", "resiliency-policy-1", armappcontainers.AppResiliency{ - Properties: &armappcontainers.AppResiliencyProperties{ - TimeoutPolicy: &armappcontainers.TimeoutPolicy{ - ConnectionTimeoutInSeconds: to.Ptr[int32](40), - ResponseTimeoutInSeconds: to.Ptr[int32](30), - }, - }, - }, 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.AppResiliency = armappcontainers.AppResiliency{ - // Name: to.Ptr("resiliency-policy-1"), - // Type: to.Ptr("Microsoft.App/containerApps/resiliencyPolicies"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0/resiliencyPolicies/resiliency-policy-1"), - // Properties: &armappcontainers.AppResiliencyProperties{ - // CircuitBreakerPolicy: &armappcontainers.CircuitBreakerPolicy{ - // ConsecutiveErrors: to.Ptr[int32](5), - // IntervalInSeconds: to.Ptr[int32](10), - // MaxEjectionPercent: to.Ptr[int32](50), - // }, - // HTTPConnectionPool: &armappcontainers.HTTPConnectionPool{ - // HTTP1MaxPendingRequests: to.Ptr[int32](1024), - // HTTP2MaxRequests: to.Ptr[int32](1024), - // }, - // HTTPRetryPolicy: &armappcontainers.HTTPRetryPolicy{ - // Matches: &armappcontainers.HTTPRetryPolicyMatches{ - // Errors: []*string{ - // to.Ptr("5xx"), - // to.Ptr("connect-failure"), - // to.Ptr("reset"), - // to.Ptr("retriable-headers"), - // to.Ptr("retriable-status-codes")}, - // Headers: []*armappcontainers.HeaderMatch{ - // { - // Header: to.Ptr("X-Content-Type"), - // Match: &armappcontainers.HeaderMatchMatch{ - // PrefixMatch: to.Ptr("GOATS"), - // }, - // }}, - // HTTPStatusCodes: []*int32{ - // to.Ptr[int32](502), - // to.Ptr[int32](503)}, - // }, - // MaxRetries: to.Ptr[int32](5), - // RetryBackOff: &armappcontainers.HTTPRetryPolicyRetryBackOff{ - // InitialDelayInMilliseconds: to.Ptr[int64](1000), - // MaxIntervalInMilliseconds: to.Ptr[int64](10000), - // }, - // }, - // TCPConnectionPool: &armappcontainers.TCPConnectionPool{ - // MaxConnections: to.Ptr[int32](100), - // }, - // TCPRetryPolicy: &armappcontainers.TCPRetryPolicy{ - // MaxConnectAttempts: to.Ptr[int32](3), - // }, - // TimeoutPolicy: &armappcontainers.TimeoutPolicy{ - // ConnectionTimeoutInSeconds: to.Ptr[int32](40), - // ResponseTimeoutInSeconds: to.Ptr[int32](30), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_Delete.json -func ExampleAppResiliencyClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAppResiliencyClient().Delete(ctx, "rg", "testcontainerApp0", "resiliency-policy-1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_Get.json -func ExampleAppResiliencyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAppResiliencyClient().Get(ctx, "rg", "testcontainerApp0", "resiliency-policy-1", 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.AppResiliency = armappcontainers.AppResiliency{ - // Name: to.Ptr("resiliency-policy-1"), - // Type: to.Ptr("Microsoft.App/containerApps/resiliencyPolicies"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0/resiliencyPolicies/resiliency-policy-1"), - // Properties: &armappcontainers.AppResiliencyProperties{ - // CircuitBreakerPolicy: &armappcontainers.CircuitBreakerPolicy{ - // ConsecutiveErrors: to.Ptr[int32](5), - // IntervalInSeconds: to.Ptr[int32](10), - // MaxEjectionPercent: to.Ptr[int32](50), - // }, - // HTTPConnectionPool: &armappcontainers.HTTPConnectionPool{ - // HTTP1MaxPendingRequests: to.Ptr[int32](1024), - // HTTP2MaxRequests: to.Ptr[int32](1024), - // }, - // HTTPRetryPolicy: &armappcontainers.HTTPRetryPolicy{ - // Matches: &armappcontainers.HTTPRetryPolicyMatches{ - // Errors: []*string{ - // to.Ptr("5xx"), - // to.Ptr("connect-failure"), - // to.Ptr("reset"), - // to.Ptr("retriable-headers"), - // to.Ptr("retriable-status-codes")}, - // Headers: []*armappcontainers.HeaderMatch{ - // { - // Header: to.Ptr("X-Content-Type"), - // Match: &armappcontainers.HeaderMatchMatch{ - // PrefixMatch: to.Ptr("GOATS"), - // }, - // }}, - // HTTPStatusCodes: []*int32{ - // to.Ptr[int32](502), - // to.Ptr[int32](503)}, - // }, - // MaxRetries: to.Ptr[int32](5), - // RetryBackOff: &armappcontainers.HTTPRetryPolicyRetryBackOff{ - // InitialDelayInMilliseconds: to.Ptr[int64](1000), - // MaxIntervalInMilliseconds: to.Ptr[int64](10000), - // }, - // }, - // TCPConnectionPool: &armappcontainers.TCPConnectionPool{ - // MaxConnections: to.Ptr[int32](100), - // }, - // TCPRetryPolicy: &armappcontainers.TCPRetryPolicy{ - // MaxConnectAttempts: to.Ptr[int32](3), - // }, - // TimeoutPolicy: &armappcontainers.TimeoutPolicy{ - // ConnectionTimeoutInSeconds: to.Ptr[int32](5), - // ResponseTimeoutInSeconds: to.Ptr[int32](15), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AppResiliency_List.json -func ExampleAppResiliencyClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAppResiliencyClient().NewListPager("rg", "testcontainerApp0", 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.AppResiliencyCollection = armappcontainers.AppResiliencyCollection{ - // Value: []*armappcontainers.AppResiliency{ - // { - // Name: to.Ptr("resiliency-policy-1"), - // Type: to.Ptr("Microsoft.App/containerApps/resiliencyPolicies"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0/resiliencyPolicies/resiliency-policy-1"), - // Properties: &armappcontainers.AppResiliencyProperties{ - // CircuitBreakerPolicy: &armappcontainers.CircuitBreakerPolicy{ - // ConsecutiveErrors: to.Ptr[int32](5), - // IntervalInSeconds: to.Ptr[int32](10), - // MaxEjectionPercent: to.Ptr[int32](50), - // }, - // HTTPConnectionPool: &armappcontainers.HTTPConnectionPool{ - // HTTP1MaxPendingRequests: to.Ptr[int32](1024), - // HTTP2MaxRequests: to.Ptr[int32](1024), - // }, - // HTTPRetryPolicy: &armappcontainers.HTTPRetryPolicy{ - // Matches: &armappcontainers.HTTPRetryPolicyMatches{ - // Errors: []*string{ - // to.Ptr("5xx"), - // to.Ptr("connect-failure"), - // to.Ptr("reset"), - // to.Ptr("retriable-headers"), - // to.Ptr("retriable-status-codes")}, - // Headers: []*armappcontainers.HeaderMatch{ - // { - // Header: to.Ptr("X-Content-Type"), - // Match: &armappcontainers.HeaderMatchMatch{ - // PrefixMatch: to.Ptr("GOATS"), - // }, - // }}, - // HTTPStatusCodes: []*int32{ - // to.Ptr[int32](502), - // to.Ptr[int32](503)}, - // }, - // MaxRetries: to.Ptr[int32](5), - // RetryBackOff: &armappcontainers.HTTPRetryPolicyRetryBackOff{ - // InitialDelayInMilliseconds: to.Ptr[int64](1000), - // MaxIntervalInMilliseconds: to.Ptr[int64](10000), - // }, - // }, - // TCPConnectionPool: &armappcontainers.TCPConnectionPool{ - // MaxConnections: to.Ptr[int32](100), - // }, - // TCPRetryPolicy: &armappcontainers.TCPRetryPolicy{ - // MaxConnectAttempts: to.Ptr[int32](3), - // }, - // TimeoutPolicy: &armappcontainers.TimeoutPolicy{ - // ConnectionTimeoutInSeconds: to.Ptr[int32](5), - // ResponseTimeoutInSeconds: to.Ptr[int32](15), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/autorest.md b/sdk/resourcemanager/appcontainers/armappcontainers/autorest.md index bccbeaf94f7c..f6ee329d2f03 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/autorest.md +++ b/sdk/resourcemanager/appcontainers/armappcontainers/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/app/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/app/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 3.0.0-beta.1 -tag: package-preview-2023-11 +module-version: 3.0.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client.go index 821ae2a7e982..96c66d9dc4f6 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client.go @@ -45,7 +45,7 @@ func NewAvailableWorkloadProfilesClient(subscriptionID string, credential azcore // NewGetPager - Get all available workload profiles for a location. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - location - The name of Azure region. // - options - AvailableWorkloadProfilesClientGetOptions contains the optional parameters for the AvailableWorkloadProfilesClient.NewGetPager // method. @@ -88,7 +88,7 @@ func (client *AvailableWorkloadProfilesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client_example_test.go deleted file mode 100644 index fb248e493751..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client_example_test.go +++ /dev/null @@ -1,190 +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 armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AvailableWorkloadProfiles_Get.json -func ExampleAvailableWorkloadProfilesClient_NewGetPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailableWorkloadProfilesClient().NewGetPager("East US", 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.AvailableWorkloadProfilesCollection = armappcontainers.AvailableWorkloadProfilesCollection{ - // Value: []*armappcontainers.AvailableWorkloadProfile{ - // { - // Name: to.Ptr("Dedicated-D4"), - // Type: to.Ptr("Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes/Dedicated-D4"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.AvailableWorkloadProfileProperties{ - // Applicability: to.Ptr(armappcontainers.ApplicabilityLocationDefault), - // Category: to.Ptr("General purpose D-series"), - // Cores: to.Ptr[int32](4), - // DisplayName: to.Ptr("Dedicated-D4"), - // MemoryGiB: to.Ptr[int32](16), - // }, - // }, - // { - // Name: to.Ptr("Dedicated-D4"), - // Type: to.Ptr("Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes/Dedicated-D8"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.AvailableWorkloadProfileProperties{ - // Applicability: to.Ptr(armappcontainers.ApplicabilityCustom), - // Category: to.Ptr("General purpose D-series"), - // Cores: to.Ptr[int32](8), - // DisplayName: to.Ptr("Dedicated-D8"), - // MemoryGiB: to.Ptr[int32](32), - // }, - // }, - // { - // Name: to.Ptr("Dedicated-D16"), - // Type: to.Ptr("Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes/Dedicated-D16"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.AvailableWorkloadProfileProperties{ - // Applicability: to.Ptr(armappcontainers.ApplicabilityCustom), - // Category: to.Ptr("General purpose D-series"), - // Cores: to.Ptr[int32](16), - // DisplayName: to.Ptr("Dedicated-D16"), - // MemoryGiB: to.Ptr[int32](64), - // }, - // }, - // { - // Name: to.Ptr("Dedicated-E4"), - // Type: to.Ptr("Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes/Dedicated-E4"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.AvailableWorkloadProfileProperties{ - // Applicability: to.Ptr(armappcontainers.ApplicabilityCustom), - // Category: to.Ptr("Memory optimized E-series"), - // Cores: to.Ptr[int32](4), - // DisplayName: to.Ptr("Dedicated-E4"), - // MemoryGiB: to.Ptr[int32](32), - // }, - // }, - // { - // Name: to.Ptr("Dedicated-E8"), - // Type: to.Ptr("Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes/Dedicated-E8"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.AvailableWorkloadProfileProperties{ - // Applicability: to.Ptr(armappcontainers.ApplicabilityCustom), - // Category: to.Ptr("Memory optimized E-series"), - // Cores: to.Ptr[int32](8), - // DisplayName: to.Ptr("Dedicated-E8"), - // MemoryGiB: to.Ptr[int32](64), - // }, - // }, - // { - // Name: to.Ptr("Dedicated-E16"), - // Type: to.Ptr("Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes/Dedicated-E16"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.AvailableWorkloadProfileProperties{ - // Applicability: to.Ptr(armappcontainers.ApplicabilityCustom), - // Category: to.Ptr("Memory optimized E-series"), - // Cores: to.Ptr[int32](16), - // DisplayName: to.Ptr("Dedicated-E16"), - // MemoryGiB: to.Ptr[int32](128), - // }, - // }, - // { - // Name: to.Ptr("Dedicated-F4"), - // Type: to.Ptr("Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes/Dedicated-F4"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.AvailableWorkloadProfileProperties{ - // Applicability: to.Ptr(armappcontainers.ApplicabilityCustom), - // Category: to.Ptr("Compute optimized F-series"), - // Cores: to.Ptr[int32](4), - // DisplayName: to.Ptr("Dedicated-F4"), - // MemoryGiB: to.Ptr[int32](8), - // }, - // }, - // { - // Name: to.Ptr("Dedicated-F8"), - // Type: to.Ptr("Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes/Dedicated-F8"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.AvailableWorkloadProfileProperties{ - // Applicability: to.Ptr(armappcontainers.ApplicabilityCustom), - // Category: to.Ptr("Compute optimized F-series"), - // Cores: to.Ptr[int32](8), - // DisplayName: to.Ptr("Dedicated-F8"), - // MemoryGiB: to.Ptr[int32](16), - // }, - // }, - // { - // Name: to.Ptr("Dedicated-F16"), - // Type: to.Ptr("Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes/Dedicated-F16"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.AvailableWorkloadProfileProperties{ - // Applicability: to.Ptr(armappcontainers.ApplicabilityCustom), - // Category: to.Ptr("Compute optimized F-series"), - // Cores: to.Ptr[int32](16), - // DisplayName: to.Ptr("Dedicated-F16"), - // MemoryGiB: to.Ptr[int32](32), - // }, - // }, - // { - // Name: to.Ptr("NC48-A100"), - // Type: to.Ptr("Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes/NC48-A100"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.AvailableWorkloadProfileProperties{ - // Applicability: to.Ptr(armappcontainers.ApplicabilityCustom), - // Category: to.Ptr("GPU-NC-A100"), - // Cores: to.Ptr[int32](48), - // DisplayName: to.Ptr("Dedicated-NC48-A100"), - // Gpus: to.Ptr[int32](2), - // MemoryGiB: to.Ptr[int32](440), - // }, - // }, - // { - // Name: to.Ptr("Consumption"), - // Type: to.Ptr("Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.App/availableManagedEnvironmentsWorkloadProfileTypes/Consumption"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.AvailableWorkloadProfileProperties{ - // Applicability: to.Ptr(armappcontainers.ApplicabilityCustom), - // Category: to.Ptr("Consumption"), - // Cores: to.Ptr[int32](3), - // DisplayName: to.Ptr("Consumption"), - // MemoryGiB: to.Ptr[int32](3), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client.go index 732cea8386b3..d3c9b40db31f 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client.go @@ -46,7 +46,7 @@ func NewBillingMetersClient(subscriptionID string, credential azcore.TokenCreden // Get - Get all billingMeters for a location. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - location - The name of Azure region. // - options - BillingMetersClientGetOptions contains the optional parameters for the BillingMetersClient.Get method. func (client *BillingMetersClient) Get(ctx context.Context, location string, options *BillingMetersClientGetOptions) (BillingMetersClientGetResponse, error) { @@ -87,7 +87,7 @@ func (client *BillingMetersClient) getCreateRequest(ctx context.Context, locatio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client_example_test.go deleted file mode 100644 index 49553291d2ac..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client_example_test.go +++ /dev/null @@ -1,107 +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 armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/BillingMeters_Get.json -func ExampleBillingMetersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBillingMetersClient().Get(ctx, "East US", 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.BillingMeterCollection = armappcontainers.BillingMeterCollection{ - // Value: []*armappcontainers.BillingMeter{ - // { - // Name: to.Ptr("GeneralPurposeDseriesCPU"), - // Type: to.Ptr("Microsoft.App/billingMeters"), - // ID: to.Ptr("/subscriptions/55f240e3-3d66-44f6-8358-4e4f3d7a2e51/providers/Microsoft.App/GeneralPurposeDseriesCPU"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.BillingMeterProperties{ - // Category: to.Ptr("General purpose D-series"), - // DisplayName: to.Ptr("General Purpose Cores per Second"), - // MeterType: to.Ptr("CPU"), - // }, - // }, - // { - // Name: to.Ptr("GeneralPurposeDseriesMemory"), - // Type: to.Ptr("Microsoft.App/billingMeters"), - // ID: to.Ptr("/subscriptions/55f240e3-3d66-44f6-8358-4e4f3d7a2e51/providers/Microsoft.App/GeneralPurposeDseriesMemory"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.BillingMeterProperties{ - // Category: to.Ptr("General purpose D-series"), - // DisplayName: to.Ptr("General Purpose Memory GiB per Second"), - // MeterType: to.Ptr("Memory"), - // }, - // }, - // { - // Name: to.Ptr("MemoryOptimizedEseriesCPU"), - // Type: to.Ptr("Microsoft.App/billingMeters"), - // ID: to.Ptr("/subscriptions/55f240e3-3d66-44f6-8358-4e4f3d7a2e51/providers/Microsoft.App/MemoryOptimizedEseriesCPU"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.BillingMeterProperties{ - // Category: to.Ptr("Memory optimized E-series"), - // DisplayName: to.Ptr("Memory Optimized Cores per Second"), - // MeterType: to.Ptr("CPU"), - // }, - // }, - // { - // Name: to.Ptr("MemoryOptimizedEseriesMemory"), - // Type: to.Ptr("Microsoft.App/billingMeters"), - // ID: to.Ptr("/subscriptions/55f240e3-3d66-44f6-8358-4e4f3d7a2e51/providers/Microsoft.App/MemoryOptimizedEseriesMemory"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.BillingMeterProperties{ - // Category: to.Ptr("Memory optimized E-series"), - // DisplayName: to.Ptr("Memory Optimized Memory GiB per Second"), - // MeterType: to.Ptr("Memory"), - // }, - // }, - // { - // Name: to.Ptr("ComputeOptimizedFseriesCPU"), - // Type: to.Ptr("Microsoft.App/billingMeters"), - // ID: to.Ptr("/subscriptions/55f240e3-3d66-44f6-8358-4e4f3d7a2e51/providers/Microsoft.App/ComputeOptimizedFseriesCPU"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.BillingMeterProperties{ - // Category: to.Ptr("Compute optimized F-series"), - // DisplayName: to.Ptr("Compute Optimized Cores per Second"), - // MeterType: to.Ptr("CPU"), - // }, - // }, - // { - // Name: to.Ptr("GeneralComputeMemory"), - // Type: to.Ptr("Microsoft.App/billingMeters"), - // ID: to.Ptr("/subscriptions/55f240e3-3d66-44f6-8358-4e4f3d7a2e51/providers/Microsoft.App/GeneralComputeMemory"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.BillingMeterProperties{ - // Category: to.Ptr("Compute optimized F-series"), - // DisplayName: to.Ptr("Compute Optimized Memory GiB per Second"), - // MeterType: to.Ptr("Memory"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/buildauthtoken_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/buildauthtoken_client.go index 4a6b71527158..3761a1449200 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/buildauthtoken_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/buildauthtoken_client.go @@ -46,7 +46,7 @@ func NewBuildAuthTokenClient(subscriptionID string, credential azcore.TokenCrede // List - Gets the token used to connect to the endpoint where source code can be uploaded for a build. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - builderName - The name of the builder. // - buildName - The name of a build. @@ -97,7 +97,7 @@ func (client *BuildAuthTokenClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/buildauthtoken_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/buildauthtoken_client_example_test.go deleted file mode 100644 index b2ae4f656dc3..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/buildauthtoken_client_example_test.go +++ /dev/null @@ -1,42 +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 armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_ListAuthToken.json -func ExampleBuildAuthTokenClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildAuthTokenClient().List(ctx, "rg", "testBuilder", "testBuild", 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.BuildToken = armappcontainers.BuildToken{ - // Expires: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-14T19:22:50.308Z"); return t}()), - // Token: to.Ptr("foobartoken"), - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/builders_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/builders_client.go index 0f374fa5235e..0d51ca6f94a9 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/builders_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/builders_client.go @@ -46,7 +46,7 @@ func NewBuildersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update a BuilderResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - builderName - The name of the builder. // - builderEnvelope - Resource create parameters. @@ -73,7 +73,7 @@ func (client *BuildersClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update a BuilderResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *BuildersClient) createOrUpdate(ctx context.Context, resourceGroupName string, builderName string, builderEnvelope BuilderResource, options *BuildersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "BuildersClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *BuildersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, builderEnvelope); err != nil { @@ -127,7 +127,7 @@ func (client *BuildersClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete a BuilderResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - builderName - The name of the builder. // - options - BuildersClientBeginDeleteOptions contains the optional parameters for the BuildersClient.BeginDelete method. @@ -152,7 +152,7 @@ func (client *BuildersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a BuilderResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *BuildersClient) deleteOperation(ctx context.Context, resourceGroupName string, builderName string, options *BuildersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "BuildersClient.BeginDelete" @@ -194,7 +194,7 @@ func (client *BuildersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +203,7 @@ func (client *BuildersClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a BuilderResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - builderName - The name of the builder. // - options - BuildersClientGetOptions contains the optional parameters for the BuildersClient.Get method. @@ -249,7 +249,7 @@ func (client *BuildersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +266,7 @@ func (client *BuildersClient) getHandleResponse(resp *http.Response) (BuildersCl // NewListByResourceGroupPager - List BuilderResource resources by resource group // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - BuildersClientListByResourceGroupOptions contains the optional parameters for the BuildersClient.NewListByResourceGroupPager // method. @@ -309,7 +309,7 @@ func (client *BuildersClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,7 +326,7 @@ func (client *BuildersClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - List BuilderResource resources by subscription ID // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - options - BuildersClientListBySubscriptionOptions contains the optional parameters for the BuildersClient.NewListBySubscriptionPager // method. func (client *BuildersClient) NewListBySubscriptionPager(options *BuildersClientListBySubscriptionOptions) *runtime.Pager[BuildersClientListBySubscriptionResponse] { @@ -364,7 +364,7 @@ func (client *BuildersClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -382,7 +382,7 @@ func (client *BuildersClient) listBySubscriptionHandleResponse(resp *http.Respon // BeginUpdate - Update a BuilderResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - builderName - The name of the builder. // - builderEnvelope - The resource properties to be updated. @@ -408,7 +408,7 @@ func (client *BuildersClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Update a BuilderResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *BuildersClient) update(ctx context.Context, resourceGroupName string, builderName string, builderEnvelope BuilderResourceUpdate, options *BuildersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "BuildersClient.BeginUpdate" @@ -450,7 +450,7 @@ func (client *BuildersClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, builderEnvelope); err != nil { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/builders_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/builders_client_example_test.go deleted file mode 100644 index 8061d9852306..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/builders_client_example_test.go +++ /dev/null @@ -1,478 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_ListBySubscription.json -func ExampleBuildersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBuildersClient().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.BuilderCollection = armappcontainers.BuilderCollection{ - // Value: []*armappcontainers.BuilderResource{ - // { - // Name: to.Ptr("testBuilder1"), - // Type: to.Ptr("Microsoft.App/builders"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.App/builders/testBuilder1"), - // SystemData: &armappcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // CreatedBy: to.Ptr("sample@microsoft.com"), - // CreatedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // LastModifiedBy: to.Ptr("sample@microsoft.com"), - // LastModifiedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armappcontainers.BuilderProperties{ - // ContainerRegistries: []*armappcontainers.ContainerRegistry{ - // { - // ContainerRegistryServer: to.Ptr("test.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }, - // { - // ContainerRegistryServer: to.Ptr("test2.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }}, - // EnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv"), - // ProvisioningState: to.Ptr(armappcontainers.BuilderProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("testBuilder2"), - // Type: to.Ptr("Microsoft.App/builders"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg2/providers/Microsoft.App/builders/testBuilder2"), - // SystemData: &armappcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // CreatedBy: to.Ptr("sample@microsoft.com"), - // CreatedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // LastModifiedBy: to.Ptr("sample@microsoft.com"), - // LastModifiedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armappcontainers.BuilderProperties{ - // ContainerRegistries: []*armappcontainers.ContainerRegistry{ - // { - // ContainerRegistryServer: to.Ptr("test.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }, - // { - // ContainerRegistryServer: to.Ptr("test2.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }}, - // EnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv"), - // ProvisioningState: to.Ptr(armappcontainers.BuilderProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_ListByResourceGroup.json -func ExampleBuildersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBuildersClient().NewListByResourceGroupPager("rg", 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.BuilderCollection = armappcontainers.BuilderCollection{ - // Value: []*armappcontainers.BuilderResource{ - // { - // Name: to.Ptr("testBuilder1"), - // Type: to.Ptr("Microsoft.App/builders"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/builders/testBuilder1"), - // SystemData: &armappcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // CreatedBy: to.Ptr("sample@microsoft.com"), - // CreatedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // LastModifiedBy: to.Ptr("sample@microsoft.com"), - // LastModifiedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armappcontainers.BuilderProperties{ - // ContainerRegistries: []*armappcontainers.ContainerRegistry{ - // { - // ContainerRegistryServer: to.Ptr("test.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }, - // { - // ContainerRegistryServer: to.Ptr("test2.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }}, - // EnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv"), - // ProvisioningState: to.Ptr(armappcontainers.BuilderProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("testBuilder2"), - // Type: to.Ptr("Microsoft.App/builders"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/builders/testBuilder2"), - // SystemData: &armappcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // CreatedBy: to.Ptr("sample@microsoft.com"), - // CreatedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // LastModifiedBy: to.Ptr("sample@microsoft.com"), - // LastModifiedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armappcontainers.BuilderProperties{ - // ContainerRegistries: []*armappcontainers.ContainerRegistry{ - // { - // ContainerRegistryServer: to.Ptr("test.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }, - // { - // ContainerRegistryServer: to.Ptr("test2.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }}, - // EnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv"), - // ProvisioningState: to.Ptr(armappcontainers.BuilderProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_Get.json -func ExampleBuildersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildersClient().Get(ctx, "rg", "testBuilder", 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.BuilderResource = armappcontainers.BuilderResource{ - // Name: to.Ptr("testBuilder"), - // Type: to.Ptr("Microsoft.App/builders"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/builders/testBuilder"), - // SystemData: &armappcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // CreatedBy: to.Ptr("sample@microsoft.com"), - // CreatedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // LastModifiedBy: to.Ptr("sample@microsoft.com"), - // LastModifiedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armappcontainers.BuilderProperties{ - // ContainerRegistries: []*armappcontainers.ContainerRegistry{ - // { - // ContainerRegistryServer: to.Ptr("test.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }, - // { - // ContainerRegistryServer: to.Ptr("test2.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }}, - // EnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv"), - // ProvisioningState: to.Ptr(armappcontainers.BuilderProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_CreateOrUpdate.json -func ExampleBuildersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBuildersClient().BeginCreateOrUpdate(ctx, "rg", "testBuilder", armappcontainers.BuilderResource{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "company": to.Ptr("Microsoft"), - }, - Identity: &armappcontainers.ManagedServiceIdentity{ - Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {}, - }, - }, - Properties: &armappcontainers.BuilderProperties{ - ContainerRegistries: []*armappcontainers.ContainerRegistry{ - { - ContainerRegistryServer: to.Ptr("test.azurecr.io"), - IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - }, - { - ContainerRegistryServer: to.Ptr("test2.azurecr.io"), - IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - }}, - EnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv"), - }, - }, 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.BuilderResource = armappcontainers.BuilderResource{ - // Name: to.Ptr("testBuilder"), - // Type: to.Ptr("Microsoft.App/builders"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/builders/testBuilder"), - // SystemData: &armappcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // CreatedBy: to.Ptr("sample@microsoft.com"), - // CreatedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // LastModifiedBy: to.Ptr("sample@microsoft.com"), - // LastModifiedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "company": to.Ptr("Microsoft"), - // }, - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armappcontainers.BuilderProperties{ - // ContainerRegistries: []*armappcontainers.ContainerRegistry{ - // { - // ContainerRegistryServer: to.Ptr("test.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }, - // { - // ContainerRegistryServer: to.Ptr("test2.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }}, - // EnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv"), - // ProvisioningState: to.Ptr(armappcontainers.BuilderProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_Update.json -func ExampleBuildersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBuildersClient().BeginUpdate(ctx, "rg", "testBuilder", armappcontainers.BuilderResourceUpdate{ - Tags: map[string]*string{ - "mytag1": to.Ptr("myvalue1"), - }, - }, 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.BuilderResource = armappcontainers.BuilderResource{ - // Name: to.Ptr("testBuilder"), - // Type: to.Ptr("Microsoft.App/builders"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/builders/testBuilder"), - // SystemData: &armappcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // CreatedBy: to.Ptr("sample@microsoft.com"), - // CreatedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // LastModifiedBy: to.Ptr("sample@microsoft.com"), - // LastModifiedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "mytag1": to.Ptr("myvalue1"), - // }, - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armappcontainers.BuilderProperties{ - // ContainerRegistries: []*armappcontainers.ContainerRegistry{ - // { - // ContainerRegistryServer: to.Ptr("test.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }, - // { - // ContainerRegistryServer: to.Ptr("test2.azurecr.io"), - // IdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1"), - // }}, - // EnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv"), - // ProvisioningState: to.Ptr(armappcontainers.BuilderProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builders_Delete.json -func ExampleBuildersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBuildersClient().BeginDelete(ctx, "rg", "testBuilder", 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/appcontainers/armappcontainers/builds_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/builds_client.go index 12131257d0fb..f811b4947c1a 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/builds_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/builds_client.go @@ -46,7 +46,7 @@ func NewBuildsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Create a BuildResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - builderName - The name of the builder. // - buildName - The name of a build. @@ -74,7 +74,7 @@ func (client *BuildsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Create a BuildResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *BuildsClient) createOrUpdate(ctx context.Context, resourceGroupName string, builderName string, buildName string, buildEnvelope BuildResource, options *BuildsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "BuildsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *BuildsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, buildEnvelope); err != nil { @@ -132,7 +132,7 @@ func (client *BuildsClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Delete a BuildResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - builderName - The name of the builder. // - buildName - The name of a build. @@ -158,7 +158,7 @@ func (client *BuildsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Delete a BuildResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *BuildsClient) deleteOperation(ctx context.Context, resourceGroupName string, builderName string, buildName string, options *BuildsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "BuildsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *BuildsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ func (client *BuildsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Get a BuildResource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - builderName - The name of the builder. // - buildName - The name of a build. @@ -264,7 +264,7 @@ func (client *BuildsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/builds_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/builds_client_example_test.go deleted file mode 100644 index 87f081d4562b..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/builds_client_example_test.go +++ /dev/null @@ -1,303 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_Get.json -func ExampleBuildsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildsClient().Get(ctx, "rg", "testBuilder", "testBuild", 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.BuildResource = armappcontainers.BuildResource{ - // Name: to.Ptr("testBuild"), - // Type: to.Ptr("Microsoft.App/builders/builds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/builders/testBuilder/builds/testBuild"), - // SystemData: &armappcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // CreatedBy: to.Ptr("sample@microsoft.com"), - // CreatedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // LastModifiedBy: to.Ptr("sample@microsoft.com"), - // LastModifiedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // }, - // Properties: &armappcontainers.BuildProperties{ - // BuildStatus: to.Ptr(armappcontainers.BuildStatusInProgress), - // Configuration: &armappcontainers.BuildConfiguration{ - // BaseOs: to.Ptr("DebianBullseye"), - // EnvironmentVariables: []*armappcontainers.EnvironmentVariable{ - // { - // Name: to.Ptr("foo1"), - // Value: to.Ptr("bar1"), - // }, - // { - // Name: to.Ptr("foo2"), - // Value: to.Ptr("bar2"), - // }}, - // Platform: to.Ptr("dotnetcore"), - // PlatformVersion: to.Ptr("7.0"), - // PreBuildSteps: []*armappcontainers.PreBuildStep{ - // { - // Description: to.Ptr("First pre build step."), - // HTTPGet: &armappcontainers.HTTPGet{ - // FileName: to.Ptr("output.txt"), - // Headers: []*string{ - // to.Ptr("foo"), - // to.Ptr("bar")}, - // URL: to.Ptr("https://microsoft.com"), - // }, - // Scripts: []*string{ - // to.Ptr("echo 'hello'"), - // to.Ptr("echo 'world'")}, - // }, - // { - // Description: to.Ptr("Second pre build step."), - // HTTPGet: &armappcontainers.HTTPGet{ - // FileName: to.Ptr("output.txt"), - // Headers: []*string{ - // to.Ptr("foo")}, - // URL: to.Ptr("https://microsoft.com"), - // }, - // Scripts: []*string{ - // to.Ptr("echo 'hello'"), - // to.Ptr("echo 'again'")}, - // }}, - // }, - // DestinationContainerRegistry: &armappcontainers.ContainerRegistryWithCustomImage{ - // Image: to.Ptr("test.azurecr.io/repo:tag"), - // Server: to.Ptr("test.azurecr.io"), - // }, - // LogStreamEndpoint: to.Ptr("https://foo.azurecontainerapps.dev/logstream"), - // ProvisioningState: to.Ptr(armappcontainers.BuildProvisioningStateSucceeded), - // TokenEndpoint: to.Ptr("https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{rg-id}/Microsoft.App/builders/testBuilder/builds/testBuild/listAuthToken"), - // UploadEndpoint: to.Ptr("https://foo.azurecontainerapps.dev/upload"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_CreateOrUpdate_NoConfig.json -func ExampleBuildsClient_BeginCreateOrUpdate_buildsCreateOrUpdateNoConfig() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBuildsClient().BeginCreateOrUpdate(ctx, "rg", "testBuilder", "testBuild", armappcontainers.BuildResource{}, 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.BuildResource = armappcontainers.BuildResource{ - // Name: to.Ptr("testBuild"), - // Type: to.Ptr("Microsoft.App/builders/builds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/builders/testBuilder/builds/testBuild"), - // SystemData: &armappcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // CreatedBy: to.Ptr("sample@microsoft.com"), - // CreatedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // LastModifiedBy: to.Ptr("sample@microsoft.com"), - // LastModifiedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // }, - // Properties: &armappcontainers.BuildProperties{ - // BuildStatus: to.Ptr(armappcontainers.BuildStatusInProgress), - // LogStreamEndpoint: to.Ptr("https://foo.azurecontainerapps.dev/logstream"), - // ProvisioningState: to.Ptr(armappcontainers.BuildProvisioningStateSucceeded), - // TokenEndpoint: to.Ptr("https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{rg-id}/Microsoft.App/builders/testBuilder/builds/testBuild/listAuthToken"), - // UploadEndpoint: to.Ptr("https://foo.azurecontainerapps.dev/upload"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_CreateOrUpdate.json -func ExampleBuildsClient_BeginCreateOrUpdate_buildsCreateOrUpdateWithConfig() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBuildsClient().BeginCreateOrUpdate(ctx, "rg", "testBuilder", "testBuild-123456789az", armappcontainers.BuildResource{ - Properties: &armappcontainers.BuildProperties{ - Configuration: &armappcontainers.BuildConfiguration{ - BaseOs: to.Ptr("DebianBullseye"), - EnvironmentVariables: []*armappcontainers.EnvironmentVariable{ - { - Name: to.Ptr("foo1"), - Value: to.Ptr("bar1"), - }, - { - Name: to.Ptr("foo2"), - Value: to.Ptr("bar2"), - }}, - Platform: to.Ptr("dotnetcore"), - PlatformVersion: to.Ptr("7.0"), - PreBuildSteps: []*armappcontainers.PreBuildStep{ - { - Description: to.Ptr("First pre build step."), - HTTPGet: &armappcontainers.HTTPGet{ - FileName: to.Ptr("output.txt"), - Headers: []*string{ - to.Ptr("foo"), - to.Ptr("bar")}, - URL: to.Ptr("https://microsoft.com"), - }, - Scripts: []*string{ - to.Ptr("echo 'hello'"), - to.Ptr("echo 'world'")}, - }, - { - Description: to.Ptr("Second pre build step."), - HTTPGet: &armappcontainers.HTTPGet{ - FileName: to.Ptr("output.txt"), - Headers: []*string{ - to.Ptr("foo")}, - URL: to.Ptr("https://microsoft.com"), - }, - Scripts: []*string{ - to.Ptr("echo 'hello'"), - to.Ptr("echo 'again'")}, - }}, - }, - DestinationContainerRegistry: &armappcontainers.ContainerRegistryWithCustomImage{ - Image: to.Ptr("test.azurecr.io/repo:tag"), - Server: to.Ptr("test.azurecr.io"), - }, - }, - }, 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.BuildResource = armappcontainers.BuildResource{ - // Name: to.Ptr("testBuild-123456789az"), - // Type: to.Ptr("Microsoft.App/builders/builds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/builders/testBuilder/builds/testBuild-123456789az"), - // SystemData: &armappcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // CreatedBy: to.Ptr("sample@microsoft.com"), - // CreatedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // LastModifiedBy: to.Ptr("sample@microsoft.com"), - // LastModifiedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // }, - // Properties: &armappcontainers.BuildProperties{ - // BuildStatus: to.Ptr(armappcontainers.BuildStatusInProgress), - // Configuration: &armappcontainers.BuildConfiguration{ - // BaseOs: to.Ptr("DebianBullseye"), - // EnvironmentVariables: []*armappcontainers.EnvironmentVariable{ - // { - // Name: to.Ptr("foo1"), - // Value: to.Ptr("bar1"), - // }, - // { - // Name: to.Ptr("foo2"), - // Value: to.Ptr("bar2"), - // }}, - // Platform: to.Ptr("dotnetcore"), - // PlatformVersion: to.Ptr("7.0"), - // PreBuildSteps: []*armappcontainers.PreBuildStep{ - // { - // Description: to.Ptr("First pre build step."), - // HTTPGet: &armappcontainers.HTTPGet{ - // FileName: to.Ptr("output.txt"), - // Headers: []*string{ - // to.Ptr("foo"), - // to.Ptr("bar")}, - // URL: to.Ptr("https://microsoft.com"), - // }, - // Scripts: []*string{ - // to.Ptr("echo 'hello'"), - // to.Ptr("echo 'world'")}, - // }, - // { - // Description: to.Ptr("Second pre build step."), - // HTTPGet: &armappcontainers.HTTPGet{ - // FileName: to.Ptr("output.txt"), - // Headers: []*string{ - // to.Ptr("foo")}, - // URL: to.Ptr("https://microsoft.com"), - // }, - // Scripts: []*string{ - // to.Ptr("echo 'hello'"), - // to.Ptr("echo 'again'")}, - // }}, - // }, - // DestinationContainerRegistry: &armappcontainers.ContainerRegistryWithCustomImage{ - // Image: to.Ptr("test.azurecr.io/repo:tag"), - // Server: to.Ptr("test.azurecr.io"), - // }, - // LogStreamEndpoint: to.Ptr("https://foo.azurecontainerapps.dev/logstream"), - // ProvisioningState: to.Ptr(armappcontainers.BuildProvisioningStateSucceeded), - // TokenEndpoint: to.Ptr("https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{rg-id}/Microsoft.App/builders/testBuilder/builds/testBuild/listAuthToken"), - // UploadEndpoint: to.Ptr("https://foo.azurecontainerapps.dev/upload"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_Delete.json -func ExampleBuildsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBuildsClient().BeginDelete(ctx, "rg", "testBuilder", "testBuild", 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/appcontainers/armappcontainers/buildsbybuilderresource_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/buildsbybuilderresource_client.go index 447c0825270e..2e577976c2db 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/buildsbybuilderresource_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/buildsbybuilderresource_client.go @@ -45,7 +45,7 @@ func NewBuildsByBuilderResourceClient(subscriptionID string, credential azcore.T // NewListPager - List BuildResource resources by BuilderResource // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - builderName - The name of the builder. // - options - BuildsByBuilderResourceClientListOptions contains the optional parameters for the BuildsByBuilderResourceClient.NewListPager @@ -93,7 +93,7 @@ func (client *BuildsByBuilderResourceClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/buildsbybuilderresource_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/buildsbybuilderresource_client_example_test.go deleted file mode 100644 index d6d5e1ab3204..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/buildsbybuilderresource_client_example_test.go +++ /dev/null @@ -1,174 +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 armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Builds_ListByBuilderResource.json -func ExampleBuildsByBuilderResourceClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBuildsByBuilderResourceClient().NewListPager("rg", "testBuilder", 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.BuildCollection = armappcontainers.BuildCollection{ - // Value: []*armappcontainers.BuildResource{ - // { - // Name: to.Ptr("testBuild1"), - // Type: to.Ptr("Microsoft.App/builders/builds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/builders/testBuilder/builds/testBuild1"), - // SystemData: &armappcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // CreatedBy: to.Ptr("sample@microsoft.com"), - // CreatedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // LastModifiedBy: to.Ptr("sample@microsoft.com"), - // LastModifiedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // }, - // Properties: &armappcontainers.BuildProperties{ - // BuildStatus: to.Ptr(armappcontainers.BuildStatusInProgress), - // Configuration: &armappcontainers.BuildConfiguration{ - // BaseOs: to.Ptr("DebianBullseye"), - // EnvironmentVariables: []*armappcontainers.EnvironmentVariable{ - // { - // Name: to.Ptr("foo1"), - // Value: to.Ptr("bar1"), - // }, - // { - // Name: to.Ptr("foo2"), - // Value: to.Ptr("bar2"), - // }}, - // Platform: to.Ptr("dotnetcore"), - // PlatformVersion: to.Ptr("7.0"), - // PreBuildSteps: []*armappcontainers.PreBuildStep{ - // { - // Description: to.Ptr("First pre build step."), - // HTTPGet: &armappcontainers.HTTPGet{ - // FileName: to.Ptr("output.txt"), - // Headers: []*string{ - // to.Ptr("foo"), - // to.Ptr("bar")}, - // URL: to.Ptr("https://microsoft.com"), - // }, - // Scripts: []*string{ - // to.Ptr("echo 'hello'"), - // to.Ptr("echo 'world'")}, - // }, - // { - // Description: to.Ptr("Second pre build step."), - // HTTPGet: &armappcontainers.HTTPGet{ - // FileName: to.Ptr("output.txt"), - // Headers: []*string{ - // to.Ptr("foo")}, - // URL: to.Ptr("https://microsoft.com"), - // }, - // Scripts: []*string{ - // to.Ptr("echo 'hello'"), - // to.Ptr("echo 'again'")}, - // }}, - // }, - // DestinationContainerRegistry: &armappcontainers.ContainerRegistryWithCustomImage{ - // Image: to.Ptr("test.azurecr.io/repo:tag"), - // Server: to.Ptr("test.azurecr.io"), - // }, - // LogStreamEndpoint: to.Ptr("https://foo.azurecontainerapps.dev/logstream"), - // ProvisioningState: to.Ptr(armappcontainers.BuildProvisioningStateSucceeded), - // TokenEndpoint: to.Ptr("https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{rg-id}/Microsoft.App/builders/testBuilder/builds/testBuild/listAuthToken"), - // UploadEndpoint: to.Ptr("https://foo.azurecontainerapps.dev/upload"), - // }, - // }, - // { - // Name: to.Ptr("testBuild2"), - // Type: to.Ptr("Microsoft.App/builders/builds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/builders/testBuilder/builds/testBuild2"), - // SystemData: &armappcontainers.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // CreatedBy: to.Ptr("sample@microsoft.com"), - // CreatedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-11T11:05:51.494Z"); return t}()), - // LastModifiedBy: to.Ptr("sample@microsoft.com"), - // LastModifiedByType: to.Ptr(armappcontainers.CreatedByTypeUser), - // }, - // Properties: &armappcontainers.BuildProperties{ - // BuildStatus: to.Ptr(armappcontainers.BuildStatusInProgress), - // Configuration: &armappcontainers.BuildConfiguration{ - // BaseOs: to.Ptr("DebianBullseye"), - // EnvironmentVariables: []*armappcontainers.EnvironmentVariable{ - // { - // Name: to.Ptr("foo1"), - // Value: to.Ptr("bar1"), - // }, - // { - // Name: to.Ptr("foo2"), - // Value: to.Ptr("bar2"), - // }}, - // Platform: to.Ptr("dotnetcore"), - // PlatformVersion: to.Ptr("7.0"), - // PreBuildSteps: []*armappcontainers.PreBuildStep{ - // { - // Description: to.Ptr("First pre build step."), - // HTTPGet: &armappcontainers.HTTPGet{ - // FileName: to.Ptr("output.txt"), - // Headers: []*string{ - // to.Ptr("foo"), - // to.Ptr("bar")}, - // URL: to.Ptr("https://microsoft.com"), - // }, - // Scripts: []*string{ - // to.Ptr("echo 'hello'"), - // to.Ptr("echo 'world'")}, - // }, - // { - // Description: to.Ptr("Second pre build step."), - // HTTPGet: &armappcontainers.HTTPGet{ - // FileName: to.Ptr("output.txt"), - // Headers: []*string{ - // to.Ptr("foo")}, - // URL: to.Ptr("https://microsoft.com"), - // }, - // Scripts: []*string{ - // to.Ptr("echo 'hello'"), - // to.Ptr("echo 'again'")}, - // }}, - // }, - // DestinationContainerRegistry: &armappcontainers.ContainerRegistryWithCustomImage{ - // Image: to.Ptr("test.azurecr.io/repo:tag"), - // Server: to.Ptr("test.azurecr.io"), - // }, - // LogStreamEndpoint: to.Ptr("https://foo.azurecontainerapps.dev/logstream"), - // ProvisioningState: to.Ptr(armappcontainers.BuildProvisioningStateSucceeded), - // TokenEndpoint: to.Ptr("https://management.azure.com/subscriptions/{subscription-id}/resourcegroups/{rg-id}/Microsoft.App/builders/testBuilder/builds/testBuild/listAuthToken"), - // UploadEndpoint: to.Ptr("https://foo.azurecontainerapps.dev/upload"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client.go index daf30ea080a8..87b64b32c85f 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client.go @@ -46,7 +46,7 @@ func NewCertificatesClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Create or Update a Certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - certificateName - Name of the Certificate. @@ -98,7 +98,7 @@ func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.CertificateEnvelope != nil { @@ -122,7 +122,7 @@ func (client *CertificatesClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Deletes the specified Certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - certificateName - Name of the Certificate. @@ -172,7 +172,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou // Get - Get the specified Certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - certificateName - Name of the Certificate. @@ -232,7 +232,7 @@ func (client *CertificatesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *CertificatesClient) getHandleResponse(resp *http.Response) (Certif // NewListPager - Get the Certificates in a given managed environment. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - options - CertificatesClientListOptions contains the optional parameters for the CertificatesClient.NewListPager method. @@ -296,7 +296,7 @@ func (client *CertificatesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -314,7 +314,7 @@ func (client *CertificatesClient) listHandleResponse(resp *http.Response) (Certi // Update - Patches a certificate. Currently only patching of tags is supported // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - certificateName - Name of the Certificate. @@ -366,7 +366,7 @@ func (client *CertificatesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, certificateEnvelope); err != nil { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client_example_test.go deleted file mode 100644 index 8afe9b609ae8..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client_example_test.go +++ /dev/null @@ -1,280 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificates_ListByManagedEnvironment.json -func ExampleCertificatesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCertificatesClient().NewListPager("examplerg", "testcontainerenv", 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.CertificateCollection = armappcontainers.CertificateCollection{ - // Value: []*armappcontainers.Certificate{ - // { - // Name: to.Ptr("certificate-firendly-name"), - // Type: to.Ptr("Microsoft.App/ManagedEnvironments/Certificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.CertificateProperties{ - // CertificateType: to.Ptr(armappcontainers.CertificateTypeImagePullTrustedCA), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // IssueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-06T04:00:00.000Z"); return t}()), - // Issuer: to.Ptr("Issuer Name"), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectAlternativeNames: []*string{ - // to.Ptr("CN=my-subject-name.com")}, - // SubjectName: to.Ptr("my-subject-name.company.country.net"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // Valid: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("certificate-firendly-name"), - // Type: to.Ptr("Microsoft.App/ManagedEnvironments/Certificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.CertificateProperties{ - // CertificateType: to.Ptr(armappcontainers.CertificateTypeServerSSLCertificate), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // IssueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-06T04:00:00.000Z"); return t}()), - // Issuer: to.Ptr("Issuer Name"), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectAlternativeNames: []*string{ - // to.Ptr("CN=my-subject-name.com")}, - // SubjectName: to.Ptr("my-subject-name.company.country.net"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // Valid: to.Ptr(true), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_Get.json -func ExampleCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().Get(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", 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.Certificate = armappcontainers.Certificate{ - // Name: to.Ptr("certificate-firendly-name"), - // Type: to.Ptr("Microsoft.App/ManagedEnvironments/Certificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.CertificateProperties{ - // CertificateType: to.Ptr(armappcontainers.CertificateTypeServerSSLCertificate), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // IssueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-06T04:00:00.000Z"); return t}()), - // Issuer: to.Ptr("Issuer Name"), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectAlternativeNames: []*string{ - // to.Ptr("CN=my-subject-name.com")}, - // SubjectName: to.Ptr("my-subject-name.company.country.net"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // Valid: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_CreateOrUpdate.json -func ExampleCertificatesClient_CreateOrUpdate_createOrUpdateCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().CreateOrUpdate(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", &armappcontainers.CertificatesClientCreateOrUpdateOptions{CertificateEnvelope: &armappcontainers.Certificate{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.CertificateProperties{ - CertificateType: to.Ptr(armappcontainers.CertificateTypeImagePullTrustedCA), - Password: to.Ptr("private key password"), - Value: []byte("Y2VydA=="), - }, - }, - }) - 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.Certificate = armappcontainers.Certificate{ - // Type: to.Ptr("Microsoft.App/ManagedEnvironments/Certificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.CertificateProperties{ - // CertificateType: to.Ptr(armappcontainers.CertificateTypeImagePullTrustedCA), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // IssueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-06T04:00:00.000Z"); return t}()), - // Issuer: to.Ptr("Issuer Name"), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectAlternativeNames: []*string{ - // to.Ptr("CN=my-subject-name.com")}, - // SubjectName: to.Ptr("my-subject-name.company.country.net"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // Valid: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_CreateOrUpdate_FromKeyVault.json -func ExampleCertificatesClient_CreateOrUpdate_createOrUpdateCertificateUsingManagedIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().CreateOrUpdate(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", &armappcontainers.CertificatesClientCreateOrUpdateOptions{CertificateEnvelope: &armappcontainers.Certificate{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.CertificateProperties{ - CertificateKeyVaultProperties: &armappcontainers.CertificateKeyVaultProperties{ - Identity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/microsoft.managedidentity/userassignedidentities/test-user-mi"), - KeyVaultURL: to.Ptr("https://xxxxxxxx.vault.azure.net/certificates/certName"), - }, - CertificateType: to.Ptr(armappcontainers.CertificateTypeServerSSLCertificate), - }, - }, - }) - 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.Certificate = armappcontainers.Certificate{ - // Type: to.Ptr("Microsoft.App/ManagedEnvironments/Certificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.CertificateProperties{ - // CertificateKeyVaultProperties: &armappcontainers.CertificateKeyVaultProperties{ - // Identity: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/test-rg/providers/microsoft.managedidentity/userassignedidentities/test-user-mi"), - // KeyVaultURL: to.Ptr("https://xxxxxxxx.vault.azure.net/certificates/certName"), - // }, - // CertificateType: to.Ptr(armappcontainers.CertificateTypeServerSSLCertificate), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // IssueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-06T04:00:00.000Z"); return t}()), - // Issuer: to.Ptr("Issuer Name"), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectAlternativeNames: []*string{ - // to.Ptr("CN=my-subject-name.com")}, - // SubjectName: to.Ptr("my-subject-name.company.country.net"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // Valid: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificate_Delete.json -func ExampleCertificatesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCertificatesClient().Delete(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", 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/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificates_Patch.json -func ExampleCertificatesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().Update(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", armappcontainers.CertificatePatch{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.Certificate = armappcontainers.Certificate{ - // Type: to.Ptr("Microsoft.App/ManagedEnvironments/Certificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armappcontainers.CertificateProperties{ - // CertificateType: to.Ptr(armappcontainers.CertificateTypeServerSSLCertificate), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // IssueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-06T04:00:00.000Z"); return t}()), - // Issuer: to.Ptr("Issuer Name"), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectAlternativeNames: []*string{ - // to.Ptr("CN=my-subject-name.com")}, - // SubjectName: to.Ptr("my-subject-name.company.country.net"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // Valid: to.Ptr(true), - // }, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/client_factory.go b/sdk/resourcemanager/appcontainers/armappcontainers/client_factory.go index 2588a2e586c9..2e56bfb9bf2b 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/client_factory.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/client_factory.go @@ -16,287 +16,359 @@ import ( // ClientFactory is a client factory used to create any client in this module. // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { - subscriptionID string - internal *arm.Client + subscriptionID string + containerAppName string + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. // - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - containerAppName - Name of the Container App the Build is associated. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. -func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { +func NewClientFactory(subscriptionID string, containerAppName string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, - internal: internal, + subscriptionID: subscriptionID, + containerAppName: containerAppName, + internal: internal, }, nil } // NewAppResiliencyClient creates a new instance of AppResiliencyClient. func (c *ClientFactory) NewAppResiliencyClient() *AppResiliencyClient { return &AppResiliencyClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewAvailableWorkloadProfilesClient creates a new instance of AvailableWorkloadProfilesClient. func (c *ClientFactory) NewAvailableWorkloadProfilesClient() *AvailableWorkloadProfilesClient { return &AvailableWorkloadProfilesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewBillingMetersClient creates a new instance of BillingMetersClient. func (c *ClientFactory) NewBillingMetersClient() *BillingMetersClient { return &BillingMetersClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewBuildAuthTokenClient creates a new instance of BuildAuthTokenClient. func (c *ClientFactory) NewBuildAuthTokenClient() *BuildAuthTokenClient { return &BuildAuthTokenClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewBuildersClient creates a new instance of BuildersClient. func (c *ClientFactory) NewBuildersClient() *BuildersClient { return &BuildersClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewBuildsByBuilderResourceClient creates a new instance of BuildsByBuilderResourceClient. func (c *ClientFactory) NewBuildsByBuilderResourceClient() *BuildsByBuilderResourceClient { return &BuildsByBuilderResourceClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewBuildsClient creates a new instance of BuildsClient. func (c *ClientFactory) NewBuildsClient() *BuildsClient { return &BuildsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewCertificatesClient creates a new instance of CertificatesClient. func (c *ClientFactory) NewCertificatesClient() *CertificatesClient { return &CertificatesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewConnectedEnvironmentsCertificatesClient creates a new instance of ConnectedEnvironmentsCertificatesClient. func (c *ClientFactory) NewConnectedEnvironmentsCertificatesClient() *ConnectedEnvironmentsCertificatesClient { return &ConnectedEnvironmentsCertificatesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewConnectedEnvironmentsClient creates a new instance of ConnectedEnvironmentsClient. func (c *ClientFactory) NewConnectedEnvironmentsClient() *ConnectedEnvironmentsClient { return &ConnectedEnvironmentsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewConnectedEnvironmentsDaprComponentsClient creates a new instance of ConnectedEnvironmentsDaprComponentsClient. func (c *ClientFactory) NewConnectedEnvironmentsDaprComponentsClient() *ConnectedEnvironmentsDaprComponentsClient { return &ConnectedEnvironmentsDaprComponentsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewConnectedEnvironmentsStoragesClient creates a new instance of ConnectedEnvironmentsStoragesClient. func (c *ClientFactory) NewConnectedEnvironmentsStoragesClient() *ConnectedEnvironmentsStoragesClient { return &ConnectedEnvironmentsStoragesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewContainerAppsAPIClient creates a new instance of ContainerAppsAPIClient. func (c *ClientFactory) NewContainerAppsAPIClient() *ContainerAppsAPIClient { return &ContainerAppsAPIClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewContainerAppsAuthConfigsClient creates a new instance of ContainerAppsAuthConfigsClient. func (c *ClientFactory) NewContainerAppsAuthConfigsClient() *ContainerAppsAuthConfigsClient { return &ContainerAppsAuthConfigsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, + } +} + +// NewContainerAppsBuildsByContainerAppClient creates a new instance of ContainerAppsBuildsByContainerAppClient. +func (c *ClientFactory) NewContainerAppsBuildsByContainerAppClient() *ContainerAppsBuildsByContainerAppClient { + return &ContainerAppsBuildsByContainerAppClient{ + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, + } +} + +// NewContainerAppsBuildsClient creates a new instance of ContainerAppsBuildsClient. +func (c *ClientFactory) NewContainerAppsBuildsClient() *ContainerAppsBuildsClient { + return &ContainerAppsBuildsClient{ + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewContainerAppsClient creates a new instance of ContainerAppsClient. func (c *ClientFactory) NewContainerAppsClient() *ContainerAppsClient { return &ContainerAppsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewContainerAppsDiagnosticsClient creates a new instance of ContainerAppsDiagnosticsClient. func (c *ClientFactory) NewContainerAppsDiagnosticsClient() *ContainerAppsDiagnosticsClient { return &ContainerAppsDiagnosticsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, + } +} + +// NewContainerAppsPatchesClient creates a new instance of ContainerAppsPatchesClient. +func (c *ClientFactory) NewContainerAppsPatchesClient() *ContainerAppsPatchesClient { + return &ContainerAppsPatchesClient{ + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewContainerAppsRevisionReplicasClient creates a new instance of ContainerAppsRevisionReplicasClient. func (c *ClientFactory) NewContainerAppsRevisionReplicasClient() *ContainerAppsRevisionReplicasClient { return &ContainerAppsRevisionReplicasClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewContainerAppsRevisionsClient creates a new instance of ContainerAppsRevisionsClient. func (c *ClientFactory) NewContainerAppsRevisionsClient() *ContainerAppsRevisionsClient { return &ContainerAppsRevisionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewContainerAppsSourceControlsClient creates a new instance of ContainerAppsSourceControlsClient. func (c *ClientFactory) NewContainerAppsSourceControlsClient() *ContainerAppsSourceControlsClient { return &ContainerAppsSourceControlsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewDaprComponentResiliencyPoliciesClient creates a new instance of DaprComponentResiliencyPoliciesClient. func (c *ClientFactory) NewDaprComponentResiliencyPoliciesClient() *DaprComponentResiliencyPoliciesClient { return &DaprComponentResiliencyPoliciesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewDaprComponentsClient creates a new instance of DaprComponentsClient. func (c *ClientFactory) NewDaprComponentsClient() *DaprComponentsClient { return &DaprComponentsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewDaprSubscriptionsClient creates a new instance of DaprSubscriptionsClient. func (c *ClientFactory) NewDaprSubscriptionsClient() *DaprSubscriptionsClient { return &DaprSubscriptionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewDotNetComponentsClient creates a new instance of DotNetComponentsClient. func (c *ClientFactory) NewDotNetComponentsClient() *DotNetComponentsClient { return &DotNetComponentsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, + } +} + +// NewFunctionsExtensionClient creates a new instance of FunctionsExtensionClient. +func (c *ClientFactory) NewFunctionsExtensionClient() *FunctionsExtensionClient { + return &FunctionsExtensionClient{ + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewJavaComponentsClient creates a new instance of JavaComponentsClient. func (c *ClientFactory) NewJavaComponentsClient() *JavaComponentsClient { return &JavaComponentsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewJobsClient creates a new instance of JobsClient. func (c *ClientFactory) NewJobsClient() *JobsClient { return &JobsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewJobsExecutionsClient creates a new instance of JobsExecutionsClient. func (c *ClientFactory) NewJobsExecutionsClient() *JobsExecutionsClient { return &JobsExecutionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewManagedCertificatesClient creates a new instance of ManagedCertificatesClient. func (c *ClientFactory) NewManagedCertificatesClient() *ManagedCertificatesClient { return &ManagedCertificatesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewManagedEnvironmentDiagnosticsClient creates a new instance of ManagedEnvironmentDiagnosticsClient. func (c *ClientFactory) NewManagedEnvironmentDiagnosticsClient() *ManagedEnvironmentDiagnosticsClient { return &ManagedEnvironmentDiagnosticsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewManagedEnvironmentUsagesClient creates a new instance of ManagedEnvironmentUsagesClient. func (c *ClientFactory) NewManagedEnvironmentUsagesClient() *ManagedEnvironmentUsagesClient { return &ManagedEnvironmentUsagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewManagedEnvironmentsClient creates a new instance of ManagedEnvironmentsClient. func (c *ClientFactory) NewManagedEnvironmentsClient() *ManagedEnvironmentsClient { return &ManagedEnvironmentsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewManagedEnvironmentsDiagnosticsClient creates a new instance of ManagedEnvironmentsDiagnosticsClient. func (c *ClientFactory) NewManagedEnvironmentsDiagnosticsClient() *ManagedEnvironmentsDiagnosticsClient { return &ManagedEnvironmentsDiagnosticsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewManagedEnvironmentsStoragesClient creates a new instance of ManagedEnvironmentsStoragesClient. func (c *ClientFactory) NewManagedEnvironmentsStoragesClient() *ManagedEnvironmentsStoragesClient { return &ManagedEnvironmentsStoragesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } // NewNamespacesClient creates a new instance of NamespacesClient. func (c *ClientFactory) NewNamespacesClient() *NamespacesClient { return &NamespacesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } @@ -310,7 +382,8 @@ func (c *ClientFactory) NewOperationsClient() *OperationsClient { // NewUsagesClient creates a new instance of UsagesClient. func (c *ClientFactory) NewUsagesClient() *UsagesClient { return &UsagesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, + subscriptionID: c.subscriptionID, + containerAppName: c.containerAppName, + internal: c.internal, } } diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go index b4308fc6e2ba..678200c98bc5 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go @@ -46,7 +46,7 @@ func NewConnectedEnvironmentsClient(subscriptionID string, credential azcore.Tok // CheckNameAvailability - Checks if resource connectedEnvironmentName is available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Managed Environment. // - checkNameAvailabilityRequest - The check connectedEnvironmentName availability request. @@ -94,7 +94,7 @@ func (client *ConnectedEnvironmentsClient) checkNameAvailabilityCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkNameAvailabilityRequest); err != nil { @@ -115,7 +115,7 @@ func (client *ConnectedEnvironmentsClient) checkNameAvailabilityHandleResponse(r // BeginCreateOrUpdate - Creates or updates an connectedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connectedEnvironment. // - environmentEnvelope - Configuration details of the connectedEnvironment. @@ -142,7 +142,7 @@ func (client *ConnectedEnvironmentsClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Creates or updates an connectedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ConnectedEnvironmentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, environmentEnvelope ConnectedEnvironment, options *ConnectedEnvironmentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ConnectedEnvironmentsClient.BeginCreateOrUpdate" @@ -184,7 +184,7 @@ func (client *ConnectedEnvironmentsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, environmentEnvelope); err != nil { @@ -196,7 +196,7 @@ func (client *ConnectedEnvironmentsClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Delete an connectedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connectedEnvironment. // - options - ConnectedEnvironmentsClientBeginDeleteOptions contains the optional parameters for the ConnectedEnvironmentsClient.BeginDelete @@ -222,7 +222,7 @@ func (client *ConnectedEnvironmentsClient) BeginDelete(ctx context.Context, reso // Delete - Delete an connectedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ConnectedEnvironmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ConnectedEnvironmentsClient.BeginDelete" @@ -264,7 +264,7 @@ func (client *ConnectedEnvironmentsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -273,7 +273,7 @@ func (client *ConnectedEnvironmentsClient) deleteCreateRequest(ctx context.Conte // Get - Get the properties of an connectedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connectedEnvironment. // - options - ConnectedEnvironmentsClientGetOptions contains the optional parameters for the ConnectedEnvironmentsClient.Get @@ -320,7 +320,7 @@ func (client *ConnectedEnvironmentsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -337,7 +337,7 @@ func (client *ConnectedEnvironmentsClient) getHandleResponse(resp *http.Response // NewListByResourceGroupPager - Get all connectedEnvironments in a resource group. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ConnectedEnvironmentsClientListByResourceGroupOptions contains the optional parameters for the ConnectedEnvironmentsClient.NewListByResourceGroupPager // method. @@ -380,7 +380,7 @@ func (client *ConnectedEnvironmentsClient) listByResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -397,7 +397,7 @@ func (client *ConnectedEnvironmentsClient) listByResourceGroupHandleResponse(res // NewListBySubscriptionPager - Get all connectedEnvironments for a subscription. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - options - ConnectedEnvironmentsClientListBySubscriptionOptions contains the optional parameters for the ConnectedEnvironmentsClient.NewListBySubscriptionPager // method. func (client *ConnectedEnvironmentsClient) NewListBySubscriptionPager(options *ConnectedEnvironmentsClientListBySubscriptionOptions) *runtime.Pager[ConnectedEnvironmentsClientListBySubscriptionResponse] { @@ -435,7 +435,7 @@ func (client *ConnectedEnvironmentsClient) listBySubscriptionCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -453,7 +453,7 @@ func (client *ConnectedEnvironmentsClient) listBySubscriptionHandleResponse(resp // Update - Patches a Managed Environment. Only patching of tags is supported currently // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connectedEnvironment. // - options - ConnectedEnvironmentsClientUpdateOptions contains the optional parameters for the ConnectedEnvironmentsClient.Update @@ -500,7 +500,7 @@ func (client *ConnectedEnvironmentsClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client_example_test.go deleted file mode 100644 index 0a5d264a2254..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client_example_test.go +++ /dev/null @@ -1,357 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_ListBySubscription.json -func ExampleConnectedEnvironmentsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectedEnvironmentsClient().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.ConnectedEnvironmentCollection = armappcontainers.ConnectedEnvironmentCollection{ - // Value: []*armappcontainers.ConnectedEnvironment{ - // { - // Name: to.Ptr("sample1"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/sample1"), - // Location: to.Ptr("North Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armappcontainers.ConnectedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("sample1.k4apps.io"), - // ProvisioningState: to.Ptr(armappcontainers.ConnectedEnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("20.42.33.145"), - // }, - // }, - // { - // Name: to.Ptr("sample2"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/DemoRG/providers/Microsoft.App/connectedEnvironments/sample2"), - // Location: to.Ptr("North Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armappcontainers.ConnectedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name2.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name2.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("sample2.k4apps.io"), - // ProvisioningState: to.Ptr(armappcontainers.ConnectedEnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("52.142.21.61"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_ListByResourceGroup.json -func ExampleConnectedEnvironmentsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectedEnvironmentsClient().NewListByResourceGroupPager("examplerg", 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.ConnectedEnvironmentCollection = armappcontainers.ConnectedEnvironmentCollection{ - // Value: []*armappcontainers.ConnectedEnvironment{ - // { - // Name: to.Ptr("sample1"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/sample1"), - // Location: to.Ptr("North Central US"), - // Tags: map[string]*string{ - // }, - // ExtendedLocation: &armappcontainers.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"), - // Type: to.Ptr(armappcontainers.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armappcontainers.ConnectedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("sample1.k4apps.io"), - // ProvisioningState: to.Ptr(armappcontainers.ConnectedEnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("20.42.33.145"), - // }, - // }, - // { - // Name: to.Ptr("sample2"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/sample2"), - // Location: to.Ptr("North Central US"), - // Tags: map[string]*string{ - // }, - // ExtendedLocation: &armappcontainers.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"), - // Type: to.Ptr(armappcontainers.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armappcontainers.ConnectedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name2.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name2.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("sample2.k4apps.io"), - // ProvisioningState: to.Ptr(armappcontainers.ConnectedEnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("52.142.21.61"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_Get.json -func ExampleConnectedEnvironmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedEnvironmentsClient().Get(ctx, "examplerg", "examplekenv", 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.ConnectedEnvironment = armappcontainers.ConnectedEnvironment{ - // Name: to.Ptr("examplekenv"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/examplekenv"), - // Location: to.Ptr("North Central US"), - // Tags: map[string]*string{ - // }, - // ExtendedLocation: &armappcontainers.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"), - // Type: to.Ptr(armappcontainers.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armappcontainers.ConnectedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("examplekenv.k4apps.io"), - // ProvisioningState: to.Ptr(armappcontainers.ConnectedEnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("20.42.33.145"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_CreateOrUpdate.json -func ExampleConnectedEnvironmentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectedEnvironmentsClient().BeginCreateOrUpdate(ctx, "examplerg", "testenv", armappcontainers.ConnectedEnvironment{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.ConnectedEnvironmentProperties{ - CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - CertificatePassword: to.Ptr("private key password"), - CertificateValue: []byte("Y2VydA=="), - DNSSuffix: to.Ptr("www.my-name.com"), - }, - DaprAIConnectionString: to.Ptr("InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/"), - StaticIP: to.Ptr("1.2.3.4"), - }, - }, 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.ConnectedEnvironment = armappcontainers.ConnectedEnvironment{ - // Name: to.Ptr("testenv"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/testenv"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // }, - // ExtendedLocation: &armappcontainers.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"), - // Type: to.Ptr(armappcontainers.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armappcontainers.ConnectedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("testenv.k4apps.io"), - // ProvisioningState: to.Ptr(armappcontainers.ConnectedEnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("1.2.3.4"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_Delete.json -func ExampleConnectedEnvironmentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectedEnvironmentsClient().BeginDelete(ctx, "examplerg", "examplekenv", 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/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironments_Patch.json -func ExampleConnectedEnvironmentsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedEnvironmentsClient().Update(ctx, "examplerg", "testenv", 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.ConnectedEnvironment = armappcontainers.ConnectedEnvironment{ - // Name: to.Ptr("testenv"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/testenv"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armappcontainers.ConnectedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("testenv.k4apps.io"), - // ProvisioningState: to.Ptr(armappcontainers.ConnectedEnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("20.42.33.145"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json -func ExampleConnectedEnvironmentsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedEnvironmentsClient().CheckNameAvailability(ctx, "examplerg", "testcontainerenv", armappcontainers.CheckNameAvailabilityRequest{ - Name: to.Ptr("testcertificatename"), - Type: to.Ptr("Microsoft.App/connectedEnvironments/certificates"), - }, 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 = armappcontainers.CheckNameAvailabilityResponse{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(armappcontainers.CheckNameAvailabilityReason("None")), - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client.go index a36d54aee67a..59cb383da6b9 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client.go @@ -46,7 +46,7 @@ func NewConnectedEnvironmentsCertificatesClient(subscriptionID string, credentia // CreateOrUpdate - Create or Update a Certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Connected Environment. // - certificateName - Name of the Certificate. @@ -98,7 +98,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) createOrUpdateCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.CertificateEnvelope != nil { @@ -122,7 +122,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) createOrUpdateHandleRespo // Delete - Deletes the specified Certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Connected Environment. // - certificateName - Name of the Certificate. @@ -173,7 +173,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) deleteCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +182,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) deleteCreateRequest(ctx c // Get - Get the specified Certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Connected Environment. // - certificateName - Name of the Certificate. @@ -234,7 +234,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,7 +251,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) getHandleResponse(resp *h // NewListPager - Get the Certificates in a given connected environment. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Connected Environment. // - options - ConnectedEnvironmentsCertificatesClientListOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.NewListPager @@ -299,7 +299,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -317,7 +317,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) listHandleResponse(resp * // Update - Patches a certificate. Currently only patching of tags is supported // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Connected Environment. // - certificateName - Name of the Certificate. @@ -370,7 +370,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) updateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, certificateEnvelope); err != nil { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client_example_test.go deleted file mode 100644 index 563cc51fab35..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client_example_test.go +++ /dev/null @@ -1,223 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json -func ExampleConnectedEnvironmentsCertificatesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectedEnvironmentsCertificatesClient().NewListPager("examplerg", "testcontainerenv", 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.CertificateCollection = armappcontainers.CertificateCollection{ - // Value: []*armappcontainers.Certificate{ - // { - // Name: to.Ptr("certificate-firendly-name"), - // Type: to.Ptr("Microsoft.App/ConnectedEnvironments/Certificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/testcontainerenv/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.CertificateProperties{ - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // IssueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-06T04:00:00.000Z"); return t}()), - // Issuer: to.Ptr("Issuer Name"), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectAlternativeNames: []*string{ - // to.Ptr("CN=my-subject-name.com")}, - // SubjectName: to.Ptr("my-subject-name.company.country.net"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // Valid: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("certificate-firendly-name"), - // Type: to.Ptr("Microsoft.App/ConnectedEnvironments/Certificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/testcontainerenv/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.CertificateProperties{ - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // IssueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-06T04:00:00.000Z"); return t}()), - // Issuer: to.Ptr("Issuer Name"), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectAlternativeNames: []*string{ - // to.Ptr("CN=my-subject-name.com")}, - // SubjectName: to.Ptr("my-subject-name.company.country.net"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // Valid: to.Ptr(true), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificate_Get.json -func ExampleConnectedEnvironmentsCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedEnvironmentsCertificatesClient().Get(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", 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.Certificate = armappcontainers.Certificate{ - // Name: to.Ptr("certificate-firendly-name"), - // Type: to.Ptr("Microsoft.App/ConnectedEnvironments/Certificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/testcontainerenv/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.CertificateProperties{ - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // IssueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-06T04:00:00.000Z"); return t}()), - // Issuer: to.Ptr("Issuer Name"), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectAlternativeNames: []*string{ - // to.Ptr("CN=my-subject-name.com")}, - // SubjectName: to.Ptr("my-subject-name.company.country.net"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // Valid: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json -func ExampleConnectedEnvironmentsCertificatesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedEnvironmentsCertificatesClient().CreateOrUpdate(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", &armappcontainers.ConnectedEnvironmentsCertificatesClientCreateOrUpdateOptions{CertificateEnvelope: &armappcontainers.Certificate{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.CertificateProperties{ - Password: to.Ptr("private key password"), - Value: []byte("Y2VydA=="), - }, - }, - }) - 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.Certificate = armappcontainers.Certificate{ - // Type: to.Ptr("Microsoft.App/ConnectedEnvironments/Certificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/testcontainerenv/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.CertificateProperties{ - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // IssueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-06T04:00:00.000Z"); return t}()), - // Issuer: to.Ptr("Issuer Name"), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectAlternativeNames: []*string{ - // to.Ptr("CN=my-subject-name.com")}, - // SubjectName: to.Ptr("my-subject-name.company.country.net"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // Valid: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificate_Delete.json -func ExampleConnectedEnvironmentsCertificatesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewConnectedEnvironmentsCertificatesClient().Delete(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", 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/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsCertificates_Patch.json -func ExampleConnectedEnvironmentsCertificatesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedEnvironmentsCertificatesClient().Update(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", armappcontainers.CertificatePatch{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.Certificate = armappcontainers.Certificate{ - // Type: to.Ptr("Microsoft.App/ConnectedEnvironments/Certificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/testcontainerenv/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armappcontainers.CertificateProperties{ - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // IssueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-06T04:00:00.000Z"); return t}()), - // Issuer: to.Ptr("Issuer Name"), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectAlternativeNames: []*string{ - // to.Ptr("CN=my-subject-name.com")}, - // SubjectName: to.Ptr("my-subject-name.company.country.net"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // Valid: to.Ptr(true), - // }, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client.go index 4766a92ad760..80cd27217b2c 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client.go @@ -46,7 +46,7 @@ func NewConnectedEnvironmentsDaprComponentsClient(subscriptionID string, credent // CreateOrUpdate - Creates or updates a Dapr Component in a connected environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connected environment. // - componentName - Name of the Dapr Component. @@ -99,7 +99,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) createOrUpdateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, daprComponentEnvelope); err != nil { @@ -120,7 +120,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) createOrUpdateHandleRes // Delete - Delete a Dapr Component from a connected environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connected environment. // - componentName - Name of the Dapr Component. @@ -171,7 +171,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) deleteCreateRequest(ctx // Get - Get a dapr component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connected environment. // - componentName - Name of the Dapr Component. @@ -232,7 +232,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) getHandleResponse(resp // NewListPager - Get the Dapr Components for a connected environment. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connected environment. // - options - ConnectedEnvironmentsDaprComponentsClientListOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.NewListPager @@ -297,7 +297,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) listCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -315,7 +315,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) listHandleResponse(resp // ListSecrets - List secrets for a dapr component // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connected environment. // - componentName - Name of the Dapr Component. @@ -367,7 +367,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) listSecretsCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client_example_test.go deleted file mode 100644 index b67e1bd0fa35..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client_example_test.go +++ /dev/null @@ -1,308 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_List.json -func ExampleConnectedEnvironmentsDaprComponentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectedEnvironmentsDaprComponentsClient().NewListPager("examplerg", "myenvironment", 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.DaprComponentsCollection = armappcontainers.DaprComponentsCollection{ - // Value: []*armappcontainers.DaprComponent{ - // { - // Name: to.Ptr("reddog"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments/daprcomponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/myenvironment/daprcomponents/reddog"), - // Properties: &armappcontainers.DaprComponentProperties{ - // ComponentType: to.Ptr("state.azure.cosmosdb"), - // IgnoreErrors: to.Ptr(false), - // InitTimeout: to.Ptr("50s"), - // Metadata: []*armappcontainers.DaprMetadata{ - // { - // Name: to.Ptr("url"), - // Value: to.Ptr(""), - // }, - // { - // Name: to.Ptr("database"), - // Value: to.Ptr("itemsDB"), - // }, - // { - // Name: to.Ptr("collection"), - // Value: to.Ptr("items"), - // }, - // { - // Name: to.Ptr("masterkey"), - // SecretRef: to.Ptr("masterkey"), - // }}, - // Scopes: []*string{ - // to.Ptr("container-app-1"), - // to.Ptr("container-app-2")}, - // Secrets: []*armappcontainers.Secret{ - // { - // Name: to.Ptr("masterkey"), - // }}, - // ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - // { - // Name: to.Ptr("statestore"), - // Metadata: &armappcontainers.DaprServiceBindMetadata{ - // Name: to.Ptr("daprcomponentBind"), - // Value: to.Ptr("redis-bind"), - // }, - // ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - // }}, - // Version: to.Ptr("v1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json -func ExampleConnectedEnvironmentsDaprComponentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedEnvironmentsDaprComponentsClient().Get(ctx, "examplerg", "myenvironment", "reddog", 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.DaprComponent = armappcontainers.DaprComponent{ - // Name: to.Ptr("reddog"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments/daprcomponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/jlaw-demo1/daprcomponents/reddog"), - // Properties: &armappcontainers.DaprComponentProperties{ - // ComponentType: to.Ptr("state.azure.cosmosdb"), - // IgnoreErrors: to.Ptr(false), - // InitTimeout: to.Ptr("50s"), - // Metadata: []*armappcontainers.DaprMetadata{ - // { - // Name: to.Ptr("url"), - // Value: to.Ptr(""), - // }, - // { - // Name: to.Ptr("database"), - // Value: to.Ptr("itemsDB"), - // }, - // { - // Name: to.Ptr("collection"), - // Value: to.Ptr("items"), - // }, - // { - // Name: to.Ptr("masterkey"), - // SecretRef: to.Ptr("masterkey"), - // }}, - // Scopes: []*string{ - // to.Ptr("container-app-1"), - // to.Ptr("container-app-2")}, - // Secrets: []*armappcontainers.Secret{ - // { - // Name: to.Ptr("masterkey"), - // }}, - // ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - // { - // Name: to.Ptr("statestore"), - // Metadata: &armappcontainers.DaprServiceBindMetadata{ - // Name: to.Ptr("daprcomponentBind"), - // Value: to.Ptr("redis-bind"), - // }, - // ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - // }}, - // Version: to.Ptr("v1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json -func ExampleConnectedEnvironmentsDaprComponentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedEnvironmentsDaprComponentsClient().CreateOrUpdate(ctx, "examplerg", "myenvironment", "reddog", armappcontainers.DaprComponent{ - Properties: &armappcontainers.DaprComponentProperties{ - ComponentType: to.Ptr("state.azure.cosmosdb"), - IgnoreErrors: to.Ptr(false), - InitTimeout: to.Ptr("50s"), - Metadata: []*armappcontainers.DaprMetadata{ - { - Name: to.Ptr("url"), - Value: to.Ptr(""), - }, - { - Name: to.Ptr("database"), - Value: to.Ptr("itemsDB"), - }, - { - Name: to.Ptr("collection"), - Value: to.Ptr("items"), - }, - { - Name: to.Ptr("masterkey"), - SecretRef: to.Ptr("masterkey"), - }}, - Scopes: []*string{ - to.Ptr("container-app-1"), - to.Ptr("container-app-2")}, - Secrets: []*armappcontainers.Secret{ - { - Name: to.Ptr("masterkey"), - Value: to.Ptr("keyvalue"), - }}, - ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - { - Name: to.Ptr("statestore"), - Metadata: &armappcontainers.DaprServiceBindMetadata{ - Name: to.Ptr("daprcomponentBind"), - Value: to.Ptr("redis-bind"), - }, - ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - }}, - Version: to.Ptr("v1"), - }, - }, 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.DaprComponent = armappcontainers.DaprComponent{ - // Name: to.Ptr("reddog"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments/daprcomponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/jlaw-demo1/daprcomponents/reddog"), - // Properties: &armappcontainers.DaprComponentProperties{ - // ComponentType: to.Ptr("state.azure.cosmosdb"), - // IgnoreErrors: to.Ptr(false), - // InitTimeout: to.Ptr("50s"), - // Metadata: []*armappcontainers.DaprMetadata{ - // { - // Name: to.Ptr("url"), - // Value: to.Ptr(""), - // }, - // { - // Name: to.Ptr("database"), - // Value: to.Ptr("itemsDB"), - // }, - // { - // Name: to.Ptr("collection"), - // Value: to.Ptr("items"), - // }, - // { - // Name: to.Ptr("masterkey"), - // SecretRef: to.Ptr("masterkey"), - // }}, - // Scopes: []*string{ - // to.Ptr("container-app-1"), - // to.Ptr("container-app-2")}, - // Secrets: []*armappcontainers.Secret{ - // { - // Name: to.Ptr("masterkey"), - // }}, - // ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - // { - // Name: to.Ptr("statestore"), - // Metadata: &armappcontainers.DaprServiceBindMetadata{ - // Name: to.Ptr("daprcomponentBind"), - // Value: to.Ptr("redis-bind"), - // }, - // ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - // }}, - // Version: to.Ptr("v1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_Delete.json -func ExampleConnectedEnvironmentsDaprComponentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewConnectedEnvironmentsDaprComponentsClient().Delete(ctx, "examplerg", "myenvironment", "reddog", 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/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json -func ExampleConnectedEnvironmentsDaprComponentsClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedEnvironmentsDaprComponentsClient().ListSecrets(ctx, "examplerg", "myenvironment", "reddog", 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.DaprSecretsCollection = armappcontainers.DaprSecretsCollection{ - // Value: []*armappcontainers.DaprSecret{ - // { - // Name: to.Ptr("secret1"), - // Value: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("secret2"), - // Value: to.Ptr("value2"), - // }}, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client.go index af0ec7b41b80..3299f2327ef8 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client.go @@ -46,7 +46,7 @@ func NewConnectedEnvironmentsStoragesClient(subscriptionID string, credential az // CreateOrUpdate - Create or update storage for a connectedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Environment. // - storageName - Name of the storage. @@ -99,7 +99,7 @@ func (client *ConnectedEnvironmentsStoragesClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, storageEnvelope); err != nil { @@ -120,7 +120,7 @@ func (client *ConnectedEnvironmentsStoragesClient) createOrUpdateHandleResponse( // Delete - Delete storage for a connectedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Environment. // - storageName - Name of the storage. @@ -171,7 +171,7 @@ func (client *ConnectedEnvironmentsStoragesClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *ConnectedEnvironmentsStoragesClient) deleteCreateRequest(ctx conte // Get - Get storage for a connectedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Environment. // - storageName - Name of the storage. @@ -232,7 +232,7 @@ func (client *ConnectedEnvironmentsStoragesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +250,7 @@ func (client *ConnectedEnvironmentsStoragesClient) getHandleResponse(resp *http. // List - Get all storages for a connectedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Environment. // - options - ConnectedEnvironmentsStoragesClientListOptions contains the optional parameters for the ConnectedEnvironmentsStoragesClient.List @@ -297,7 +297,7 @@ func (client *ConnectedEnvironmentsStoragesClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client_example_test.go deleted file mode 100644 index 9925b3346b94..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client_example_test.go +++ /dev/null @@ -1,144 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsStorages_List.json -func ExampleConnectedEnvironmentsStoragesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedEnvironmentsStoragesClient().List(ctx, "examplerg", "managedEnv", 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.ConnectedEnvironmentStoragesCollection = armappcontainers.ConnectedEnvironmentStoragesCollection{ - // Value: []*armappcontainers.ConnectedEnvironmentStorage{ - // { - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments/storages"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/managedEnv/storages/jlaw-demo1"), - // Properties: &armappcontainers.ConnectedEnvironmentStorageProperties{ - // AzureFile: &armappcontainers.AzureFileProperties{ - // AccessMode: to.Ptr(armappcontainers.AccessModeReadOnly), - // AccountName: to.Ptr("account1"), - // ShareName: to.Ptr("share1"), - // }, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsStorages_Get.json -func ExampleConnectedEnvironmentsStoragesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedEnvironmentsStoragesClient().Get(ctx, "examplerg", "env", "jlaw-demo1", 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.ConnectedEnvironmentStorage = armappcontainers.ConnectedEnvironmentStorage{ - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments/storages"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/env/storages/jlaw-demo1"), - // Properties: &armappcontainers.ConnectedEnvironmentStorageProperties{ - // AzureFile: &armappcontainers.AzureFileProperties{ - // AccessMode: to.Ptr(armappcontainers.AccessModeReadOnly), - // AccountName: to.Ptr("account1"), - // ShareName: to.Ptr("share1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json -func ExampleConnectedEnvironmentsStoragesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectedEnvironmentsStoragesClient().CreateOrUpdate(ctx, "examplerg", "env", "jlaw-demo1", armappcontainers.ConnectedEnvironmentStorage{ - Properties: &armappcontainers.ConnectedEnvironmentStorageProperties{ - AzureFile: &armappcontainers.AzureFileProperties{ - AccessMode: to.Ptr(armappcontainers.AccessModeReadOnly), - AccountKey: to.Ptr("key"), - AccountName: to.Ptr("account1"), - ShareName: to.Ptr("share1"), - }, - }, - }, 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.ConnectedEnvironmentStorage = armappcontainers.ConnectedEnvironmentStorage{ - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/connectedEnvironments/storages"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/connectedEnvironments/env/storages/jlaw-demo1"), - // Properties: &armappcontainers.ConnectedEnvironmentStorageProperties{ - // AzureFile: &armappcontainers.AzureFileProperties{ - // AccessMode: to.Ptr(armappcontainers.AccessModeReadOnly), - // AccountName: to.Ptr("account1"), - // ShareName: to.Ptr("share1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ConnectedEnvironmentsStorages_Delete.json -func ExampleConnectedEnvironmentsStoragesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewConnectedEnvironmentsStoragesClient().Delete(ctx, "examplerg", "env", "jlaw-demo1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/constants.go b/sdk/resourcemanager/appcontainers/armappcontainers/constants.go index 5ecd27950fbe..d507afd06df4 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/constants.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/constants.go @@ -10,7 +10,7 @@ package armappcontainers const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers" - moduleVersion = "v3.0.0-beta.1" + moduleVersion = "v3.0.0-beta.2" ) // AccessMode - Access mode for storage @@ -391,6 +391,24 @@ func PossibleDNSVerificationTestResultValues() []DNSVerificationTestResult { } } +// DetectionStatus - The status of the patch detection. +type DetectionStatus string + +const ( + DetectionStatusFailed DetectionStatus = "Failed" + DetectionStatusRegistryLoginFailed DetectionStatus = "RegistryLoginFailed" + DetectionStatusSucceeded DetectionStatus = "Succeeded" +) + +// PossibleDetectionStatusValues returns the possible values for the DetectionStatus const type. +func PossibleDetectionStatusValues() []DetectionStatus { + return []DetectionStatus{ + DetectionStatusFailed, + DetectionStatusRegistryLoginFailed, + DetectionStatusSucceeded, + } +} + // DotNetComponentProvisioningState - Provisioning state of the .NET Component. type DotNetComponentProvisioningState string @@ -417,15 +435,13 @@ func PossibleDotNetComponentProvisioningStateValues() []DotNetComponentProvision type DotNetComponentType string const ( - DotNetComponentTypeAspireDashboard DotNetComponentType = "AspireDashboard" - DotNetComponentTypeAspireResourceServerAPI DotNetComponentType = "AspireResourceServerApi" + DotNetComponentTypeAspireDashboard DotNetComponentType = "AspireDashboard" ) // PossibleDotNetComponentTypeValues returns the possible values for the DotNetComponentType const type. func PossibleDotNetComponentTypeValues() []DotNetComponentType { return []DotNetComponentType{ DotNetComponentTypeAspireDashboard, - DotNetComponentTypeAspireResourceServerAPI, } } @@ -493,6 +509,23 @@ func PossibleForwardProxyConventionValues() []ForwardProxyConvention { } } +// ImageType - The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to +// update image through image field. Set to ContainerImage for user provided image. +type ImageType string + +const ( + ImageTypeCloudBuild ImageType = "CloudBuild" + ImageTypeContainerImage ImageType = "ContainerImage" +) + +// PossibleImageTypeValues returns the possible values for the ImageType const type. +func PossibleImageTypeValues() []ImageType { + return []ImageType{ + ImageTypeCloudBuild, + ImageTypeContainerImage, + } +} + // IngressClientCertificateMode - Client certificate mode for mTLS authentication. Ignore indicates server drops client certificate // on forwarding. Accept indicates server forwards client certificate but does not require a client // certificate. Require indicates server requires a client certificate. @@ -575,6 +608,7 @@ func PossibleJavaComponentProvisioningStateValues() []JavaComponentProvisioningS type JavaComponentType string const ( + JavaComponentTypeNacos JavaComponentType = "Nacos" JavaComponentTypeSpringBootAdmin JavaComponentType = "SpringBootAdmin" JavaComponentTypeSpringCloudConfig JavaComponentType = "SpringCloudConfig" JavaComponentTypeSpringCloudEureka JavaComponentType = "SpringCloudEureka" @@ -583,6 +617,7 @@ const ( // PossibleJavaComponentTypeValues returns the possible values for the JavaComponentType const type. func PossibleJavaComponentTypeValues() []JavaComponentType { return []JavaComponentType{ + JavaComponentTypeNacos, JavaComponentTypeSpringBootAdmin, JavaComponentTypeSpringCloudConfig, JavaComponentTypeSpringCloudEureka, @@ -695,6 +730,76 @@ func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { } } +// PatchApplyStatus - The status of the patch once it has been provisioned +type PatchApplyStatus string + +const ( + PatchApplyStatusCanceled PatchApplyStatus = "Canceled" + PatchApplyStatusCreatingRevision PatchApplyStatus = "CreatingRevision" + PatchApplyStatusImagePushPullFailed PatchApplyStatus = "ImagePushPullFailed" + PatchApplyStatusManuallySkipped PatchApplyStatus = "ManuallySkipped" + PatchApplyStatusNotStarted PatchApplyStatus = "NotStarted" + PatchApplyStatusRebaseFailed PatchApplyStatus = "RebaseFailed" + PatchApplyStatusRebaseInProgress PatchApplyStatus = "RebaseInProgress" + PatchApplyStatusRevisionCreationFailed PatchApplyStatus = "RevisionCreationFailed" + PatchApplyStatusSucceeded PatchApplyStatus = "Succeeded" +) + +// PossiblePatchApplyStatusValues returns the possible values for the PatchApplyStatus const type. +func PossiblePatchApplyStatusValues() []PatchApplyStatus { + return []PatchApplyStatus{ + PatchApplyStatusCanceled, + PatchApplyStatusCreatingRevision, + PatchApplyStatusImagePushPullFailed, + PatchApplyStatusManuallySkipped, + PatchApplyStatusNotStarted, + PatchApplyStatusRebaseFailed, + PatchApplyStatusRebaseInProgress, + PatchApplyStatusRevisionCreationFailed, + PatchApplyStatusSucceeded, + } +} + +// PatchType - The type for the patch. +type PatchType string + +const ( + PatchTypeFrameworkAndOSSecurity PatchType = "FrameworkAndOSSecurity" + PatchTypeFrameworkSecurity PatchType = "FrameworkSecurity" + PatchTypeOSSecurity PatchType = "OSSecurity" + PatchTypeOther PatchType = "Other" +) + +// PossiblePatchTypeValues returns the possible values for the PatchType const type. +func PossiblePatchTypeValues() []PatchType { + return []PatchType{ + PatchTypeFrameworkAndOSSecurity, + PatchTypeFrameworkSecurity, + PatchTypeOSSecurity, + PatchTypeOther, + } +} + +// PatchingMode - Patching mode for the container app. Null or default in this field will be interpreted as Automatic by RP. +// Automatic mode will automatically apply available patches. Manual mode will require the user +// to manually apply patches. Disabled mode will stop patch detection and auto patching. +type PatchingMode string + +const ( + PatchingModeAutomatic PatchingMode = "Automatic" + PatchingModeDisabled PatchingMode = "Disabled" + PatchingModeManual PatchingMode = "Manual" +) + +// PossiblePatchingModeValues returns the possible values for the PatchingMode const type. +func PossiblePatchingModeValues() []PatchingMode { + return []PatchingMode{ + PatchingModeAutomatic, + PatchingModeDisabled, + PatchingModeManual, + } +} + // RevisionHealthState - Current health State of the revision type RevisionHealthState string diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go index c7454274b3cb..2e7933cff4af 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go @@ -46,7 +46,7 @@ func NewContainerAppsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Create or update a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - containerAppEnvelope - Properties used to create a container app @@ -73,7 +73,7 @@ func (client *ContainerAppsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Create or update a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ContainerAppsClient) createOrUpdate(ctx context.Context, resourceGroupName string, containerAppName string, containerAppEnvelope ContainerApp, options *ContainerAppsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ContainerAppsClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *ContainerAppsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, containerAppEnvelope); err != nil { @@ -127,7 +127,7 @@ func (client *ContainerAppsClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Delete a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - options - ContainerAppsClientBeginDeleteOptions contains the optional parameters for the ContainerAppsClient.BeginDelete @@ -153,7 +153,7 @@ func (client *ContainerAppsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Delete a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ContainerAppsClient) deleteOperation(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ContainerAppsClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *ContainerAppsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,7 @@ func (client *ContainerAppsClient) deleteCreateRequest(ctx context.Context, reso // Get - Get the properties of a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - options - ContainerAppsClientGetOptions contains the optional parameters for the ContainerAppsClient.Get method. @@ -250,7 +250,7 @@ func (client *ContainerAppsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *ContainerAppsClient) getHandleResponse(resp *http.Response) (Conta // GetAuthToken - Get auth token for a container app // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - options - ContainerAppsClientGetAuthTokenOptions contains the optional parameters for the ContainerAppsClient.GetAuthToken @@ -315,7 +315,7 @@ func (client *ContainerAppsClient) getAuthTokenCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,7 +332,7 @@ func (client *ContainerAppsClient) getAuthTokenHandleResponse(resp *http.Respons // NewListByResourceGroupPager - Get the Container Apps in a given resource group. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ContainerAppsClientListByResourceGroupOptions contains the optional parameters for the ContainerAppsClient.NewListByResourceGroupPager // method. @@ -375,7 +375,7 @@ func (client *ContainerAppsClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,7 +392,7 @@ func (client *ContainerAppsClient) listByResourceGroupHandleResponse(resp *http. // NewListBySubscriptionPager - Get the Container Apps in a given subscription. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - options - ContainerAppsClientListBySubscriptionOptions contains the optional parameters for the ContainerAppsClient.NewListBySubscriptionPager // method. func (client *ContainerAppsClient) NewListBySubscriptionPager(options *ContainerAppsClientListBySubscriptionOptions) *runtime.Pager[ContainerAppsClientListBySubscriptionResponse] { @@ -430,7 +430,7 @@ func (client *ContainerAppsClient) listBySubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -448,7 +448,7 @@ func (client *ContainerAppsClient) listBySubscriptionHandleResponse(resp *http.R // ListCustomHostNameAnalysis - Analyzes a custom hostname for a Container App // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - options - ContainerAppsClientListCustomHostNameAnalysisOptions contains the optional parameters for the ContainerAppsClient.ListCustomHostNameAnalysis @@ -495,7 +495,7 @@ func (client *ContainerAppsClient) listCustomHostNameAnalysisCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") if options != nil && options.CustomHostname != nil { reqQP.Set("customHostname", *options.CustomHostname) } @@ -516,7 +516,7 @@ func (client *ContainerAppsClient) listCustomHostNameAnalysisHandleResponse(resp // ListSecrets - List secrets for a container app // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - options - ContainerAppsClientListSecretsOptions contains the optional parameters for the ContainerAppsClient.ListSecrets @@ -563,7 +563,7 @@ func (client *ContainerAppsClient) listSecretsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -581,7 +581,7 @@ func (client *ContainerAppsClient) listSecretsHandleResponse(resp *http.Response // BeginStart - Start a container app // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - options - ContainerAppsClientBeginStartOptions contains the optional parameters for the ContainerAppsClient.BeginStart @@ -607,7 +607,7 @@ func (client *ContainerAppsClient) BeginStart(ctx context.Context, resourceGroup // Start - Start a container app // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ContainerAppsClient) start(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ContainerAppsClient.BeginStart" @@ -649,7 +649,7 @@ func (client *ContainerAppsClient) startCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -658,7 +658,7 @@ func (client *ContainerAppsClient) startCreateRequest(ctx context.Context, resou // BeginStop - Stop a container app // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - options - ContainerAppsClientBeginStopOptions contains the optional parameters for the ContainerAppsClient.BeginStop method. @@ -683,7 +683,7 @@ func (client *ContainerAppsClient) BeginStop(ctx context.Context, resourceGroupN // Stop - Stop a container app // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ContainerAppsClient) stop(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ContainerAppsClient.BeginStop" @@ -725,7 +725,7 @@ func (client *ContainerAppsClient) stopCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -734,7 +734,7 @@ func (client *ContainerAppsClient) stopCreateRequest(ctx context.Context, resour // BeginUpdate - Patches a Container App using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - containerAppEnvelope - Properties of a Container App that need to be updated @@ -760,7 +760,7 @@ func (client *ContainerAppsClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Patches a Container App using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ContainerAppsClient) update(ctx context.Context, resourceGroupName string, containerAppName string, containerAppEnvelope ContainerApp, options *ContainerAppsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ContainerAppsClient.BeginUpdate" @@ -802,7 +802,7 @@ func (client *ContainerAppsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, containerAppEnvelope); err != nil { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client_example_test.go deleted file mode 100644 index 56f5f8d2f1d8..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client_example_test.go +++ /dev/null @@ -1,1942 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_ListBySubscription.json -func ExampleContainerAppsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewContainerAppsClient().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.ContainerAppCollection = armappcontainers.ContainerAppCollection{ - // Value: []*armappcontainers.ContainerApp{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // Dapr: &armappcontainers.Dapr{ - // AppPort: to.Ptr[int32](3000), - // AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP), - // EnableAPILogging: to.Ptr(true), - // Enabled: to.Ptr(true), - // HTTPMaxRequestSize: to.Ptr[int32](10), - // HTTPReadBufferSize: to.Ptr[int32](30), - // LogLevel: to.Ptr(armappcontainers.LogLevelDebug), - // }, - // Ingress: &armappcontainers.Ingress{ - // CustomDomains: []*armappcontainers.CustomDomain{ - // { - // Name: to.Ptr("www.my-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - // }, - // { - // Name: to.Ptr("www.my--other-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), - // }}, - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{ - // { - // Name: to.Ptr("Allow work IP A subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/32"), - // }, - // { - // Name: to.Ptr("Allow work IP B subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/8"), - // }}, - // StickySessions: &armappcontainers.IngressStickySessions{ - // Affinity: to.Ptr(armappcontainers.AffinitySticky), - // }, - // TargetPort: to.Ptr[int32](3000), - // TargetPortHTTPScheme: to.Ptr(armappcontainers.IngressTargetPortHTTPSchemeHTTP), - // Traffic: []*armappcontainers.TrafficWeight{ - // { - // RevisionName: to.Ptr("testcontainerApp0-ab1234"), - // Weight: to.Ptr[int32](80), - // }, - // { - // Label: to.Ptr("staging"), - // RevisionName: to.Ptr("testcontainerApp0-ab4321"), - // Weight: to.Ptr[int32](20), - // }}, - // Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto), - // }, - // MaxInactiveRevisions: to.Ptr[int32](10), - // Service: &armappcontainers.Service{ - // Type: to.Ptr("redis"), - // }, - // }, - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // LatestReadyRevisionName: to.Ptr("testcontainerApp0-pjxhsye"), - // LatestRevisionFqdn: to.Ptr("testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // ServiceBinds: []*armappcontainers.ServiceBind{ - // { - // Name: to.Ptr("service"), - // ClientType: to.Ptr("dotnet"), - // CustomizedKeys: map[string]*string{ - // "DesiredKey": to.Ptr("defaultKey"), - // }, - // ServiceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service"), - // }}, - // }, - // WorkloadProfileName: to.Ptr("My-GP-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_ListByResourceGroup.json -func ExampleContainerAppsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewContainerAppsClient().NewListByResourceGroupPager("rg", 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.ContainerAppCollection = armappcontainers.ContainerAppCollection{ - // Value: []*armappcontainers.ContainerApp{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // Dapr: &armappcontainers.Dapr{ - // AppPort: to.Ptr[int32](3000), - // AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP), - // EnableAPILogging: to.Ptr(true), - // Enabled: to.Ptr(true), - // HTTPMaxRequestSize: to.Ptr[int32](10), - // HTTPReadBufferSize: to.Ptr[int32](30), - // LogLevel: to.Ptr(armappcontainers.LogLevelDebug), - // }, - // Ingress: &armappcontainers.Ingress{ - // CustomDomains: []*armappcontainers.CustomDomain{ - // { - // Name: to.Ptr("www.my-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - // }, - // { - // Name: to.Ptr("www.my--other-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), - // }}, - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{ - // { - // Name: to.Ptr("Allow work IP A subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/32"), - // }, - // { - // Name: to.Ptr("Allow work IP B subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/8"), - // }}, - // StickySessions: &armappcontainers.IngressStickySessions{ - // Affinity: to.Ptr(armappcontainers.AffinitySticky), - // }, - // TargetPort: to.Ptr[int32](3000), - // TargetPortHTTPScheme: to.Ptr(armappcontainers.IngressTargetPortHTTPSchemeHTTP), - // Traffic: []*armappcontainers.TrafficWeight{ - // { - // RevisionName: to.Ptr("testcontainerApp0-ab1234"), - // Weight: to.Ptr[int32](80), - // }, - // { - // Label: to.Ptr("staging"), - // RevisionName: to.Ptr("testcontainerApp0-ab4321"), - // Weight: to.Ptr[int32](20), - // }}, - // Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto), - // }, - // MaxInactiveRevisions: to.Ptr[int32](10), - // }, - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // LatestReadyRevisionName: to.Ptr("testcontainerApp0-pjxhsye"), - // LatestRevisionFqdn: to.Ptr("testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // }, - // WorkloadProfileName: to.Ptr("My-GP-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Get.json -func ExampleContainerAppsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsClient().Get(ctx, "rg", "testcontainerApp0", 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.ContainerApp = armappcontainers.ContainerApp{ - // Name: to.Ptr("testcontainerApp0"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // Dapr: &armappcontainers.Dapr{ - // AppPort: to.Ptr[int32](3000), - // AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP), - // EnableAPILogging: to.Ptr(true), - // Enabled: to.Ptr(true), - // HTTPMaxRequestSize: to.Ptr[int32](10), - // HTTPReadBufferSize: to.Ptr[int32](30), - // LogLevel: to.Ptr(armappcontainers.LogLevelDebug), - // }, - // Ingress: &armappcontainers.Ingress{ - // CustomDomains: []*armappcontainers.CustomDomain{ - // { - // Name: to.Ptr("www.my-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - // }, - // { - // Name: to.Ptr("www.my--other-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), - // }}, - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{ - // { - // Name: to.Ptr("Allow work IP A subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/32"), - // }, - // { - // Name: to.Ptr("Allow work IP B subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/8"), - // }}, - // StickySessions: &armappcontainers.IngressStickySessions{ - // Affinity: to.Ptr(armappcontainers.AffinitySticky), - // }, - // TargetPort: to.Ptr[int32](3000), - // TargetPortHTTPScheme: to.Ptr(armappcontainers.IngressTargetPortHTTPSchemeHTTP), - // Traffic: []*armappcontainers.TrafficWeight{ - // { - // RevisionName: to.Ptr("testcontainerApp0-ab1234"), - // Weight: to.Ptr[int32](80), - // }, - // { - // Label: to.Ptr("staging"), - // RevisionName: to.Ptr("testcontainerApp0-ab4321"), - // Weight: to.Ptr[int32](20), - // }}, - // Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto), - // }, - // MaxInactiveRevisions: to.Ptr[int32](10), - // Service: &armappcontainers.Service{ - // Type: to.Ptr("redis"), - // }, - // }, - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // LatestReadyRevisionName: to.Ptr("testcontainerApp0-pjxhsye"), - // LatestRevisionFqdn: to.Ptr("testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // VolumeMounts: []*armappcontainers.VolumeMount{ - // { - // MountPath: to.Ptr("/mnt/path1"), - // SubPath: to.Ptr("subPath1"), - // VolumeName: to.Ptr("azurefile"), - // }, - // { - // MountPath: to.Ptr("/mnt/path2"), - // SubPath: to.Ptr("subPath2"), - // VolumeName: to.Ptr("nfsazurefile"), - // }}, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // ServiceBinds: []*armappcontainers.ServiceBind{ - // { - // Name: to.Ptr("service"), - // ClientType: to.Ptr("dotnet"), - // CustomizedKeys: map[string]*string{ - // "DesiredKey": to.Ptr("defaultKey"), - // }, - // ServiceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service"), - // }}, - // Volumes: []*armappcontainers.Volume{ - // { - // Name: to.Ptr("azurefile"), - // StorageName: to.Ptr("storage"), - // StorageType: to.Ptr(armappcontainers.StorageTypeAzureFile), - // }, - // { - // Name: to.Ptr("nfsazurefile"), - // StorageName: to.Ptr("nfsStorage"), - // StorageType: to.Ptr(armappcontainers.StorageTypeNfsAzureFile), - // }}, - // }, - // WorkloadProfileName: to.Ptr("My-GP-01"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_CreateOrUpdate_ConnectedEnvironment.json -func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateAppOnAConnectedEnvironment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewContainerAppsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerApp0", armappcontainers.ContainerApp{ - Location: to.Ptr("East US"), - ExtendedLocation: &armappcontainers.ExtendedLocation{ - Name: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"), - Type: to.Ptr(armappcontainers.ExtendedLocationTypesCustomLocation), - }, - Properties: &armappcontainers.ContainerAppProperties{ - Configuration: &armappcontainers.Configuration{ - Dapr: &armappcontainers.Dapr{ - AppPort: to.Ptr[int32](3000), - AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP), - EnableAPILogging: to.Ptr(true), - Enabled: to.Ptr(true), - HTTPMaxRequestSize: to.Ptr[int32](10), - HTTPReadBufferSize: to.Ptr[int32](30), - LogLevel: to.Ptr(armappcontainers.LogLevelDebug), - }, - Ingress: &armappcontainers.Ingress{ - AdditionalPortMappings: []*armappcontainers.IngressPortMapping{ - { - External: to.Ptr(true), - TargetPort: to.Ptr[int32](1234), - }, - { - ExposedPort: to.Ptr[int32](3456), - External: to.Ptr(false), - TargetPort: to.Ptr[int32](2345), - }}, - ClientCertificateMode: to.Ptr(armappcontainers.IngressClientCertificateModeAccept), - CorsPolicy: &armappcontainers.CorsPolicy{ - AllowCredentials: to.Ptr(true), - AllowedHeaders: []*string{ - to.Ptr("HEADER1"), - to.Ptr("HEADER2")}, - AllowedMethods: []*string{ - to.Ptr("GET"), - to.Ptr("POST")}, - AllowedOrigins: []*string{ - to.Ptr("https://a.test.com"), - to.Ptr("https://b.test.com")}, - ExposeHeaders: []*string{ - to.Ptr("HEADER3"), - to.Ptr("HEADER4")}, - MaxAge: to.Ptr[int32](1234), - }, - CustomDomains: []*armappcontainers.CustomDomain{ - { - Name: to.Ptr("www.my-name.com"), - BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - }, - { - Name: to.Ptr("www.my-other-name.com"), - BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), - }}, - External: to.Ptr(true), - IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{ - { - Name: to.Ptr("Allow work IP A subnet"), - Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - Action: to.Ptr(armappcontainers.ActionAllow), - IPAddressRange: to.Ptr("192.168.1.1/32"), - }, - { - Name: to.Ptr("Allow work IP B subnet"), - Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - Action: to.Ptr(armappcontainers.ActionAllow), - IPAddressRange: to.Ptr("192.168.1.1/8"), - }}, - StickySessions: &armappcontainers.IngressStickySessions{ - Affinity: to.Ptr(armappcontainers.AffinitySticky), - }, - TargetPort: to.Ptr[int32](3000), - Traffic: []*armappcontainers.TrafficWeight{ - { - Label: to.Ptr("production"), - RevisionName: to.Ptr("testcontainerApp0-ab1234"), - Weight: to.Ptr[int32](100), - }}, - }, - MaxInactiveRevisions: to.Ptr[int32](10), - }, - EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube"), - Template: &armappcontainers.Template{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerApp0"), - Image: to.Ptr("repo/testcontainerApp0:v1"), - Probes: []*armappcontainers.ContainerAppProbe{ - { - Type: to.Ptr(armappcontainers.TypeLiveness), - HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{ - Path: to.Ptr("/health"), - HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{ - { - Name: to.Ptr("Custom-Header"), - Value: to.Ptr("Awesome"), - }}, - Port: to.Ptr[int32](8080), - }, - InitialDelaySeconds: to.Ptr[int32](3), - PeriodSeconds: to.Ptr[int32](3), - }}, - }}, - InitContainers: []*armappcontainers.InitContainer{ - { - Name: to.Ptr("testinitcontainerApp0"), - Args: []*string{ - to.Ptr("-c"), - to.Ptr("while true; do echo hello; sleep 10;done")}, - Command: []*string{ - to.Ptr("/bin/sh")}, - Image: to.Ptr("repo/testcontainerApp0:v4"), - Resources: &armappcontainers.ContainerResources{ - CPU: to.Ptr[float64](0.2), - Memory: to.Ptr("100Mi"), - }, - }}, - Scale: &armappcontainers.Scale{ - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - Rules: []*armappcontainers.ScaleRule{ - { - Name: to.Ptr("httpscalingrule"), - Custom: &armappcontainers.CustomScaleRule{ - Type: to.Ptr("http"), - Metadata: map[string]*string{ - "concurrentRequests": to.Ptr("50"), - }, - }, - }}, - }, - }, - }, - }, 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.ContainerApp = armappcontainers.ContainerApp{ - // Name: to.Ptr("testcontainerApp0"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"), - // Location: to.Ptr("East US"), - // ExtendedLocation: &armappcontainers.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"), - // Type: to.Ptr(armappcontainers.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // Dapr: &armappcontainers.Dapr{ - // AppPort: to.Ptr[int32](3000), - // AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP), - // Enabled: to.Ptr(true), - // HTTPReadBufferSize: to.Ptr[int32](30), - // }, - // Ingress: &armappcontainers.Ingress{ - // CustomDomains: []*armappcontainers.CustomDomain{ - // { - // Name: to.Ptr("www.my-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - // }, - // { - // Name: to.Ptr("www.my-other-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), - // }}, - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{ - // { - // Name: to.Ptr("Allow work IP A subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/32"), - // }, - // { - // Name: to.Ptr("Allow work IP B subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/8"), - // }}, - // StickySessions: &armappcontainers.IngressStickySessions{ - // Affinity: to.Ptr(armappcontainers.AffinitySticky), - // }, - // TargetPort: to.Ptr[int32](3000), - // TargetPortHTTPScheme: to.Ptr(armappcontainers.IngressTargetPortHTTPSchemeHTTP), - // Traffic: []*armappcontainers.TrafficWeight{ - // { - // RevisionName: to.Ptr("testcontainerApp0-ab1234"), - // Weight: to.Ptr[int32](80), - // }, - // { - // Label: to.Ptr("staging"), - // RevisionName: to.Ptr("testcontainerApp0-ab4321"), - // Weight: to.Ptr[int32](20), - // }}, - // Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto), - // }, - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // LatestReadyRevisionName: to.Ptr("testcontainerApp0-pjxhsye"), - // LatestRevisionFqdn: to.Ptr("testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // Probes: []*armappcontainers.ContainerAppProbe{ - // { - // Type: to.Ptr(armappcontainers.TypeLiveness), - // HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{ - // Path: to.Ptr("/health"), - // HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{ - // { - // Name: to.Ptr("Custom-Header"), - // Value: to.Ptr("Awesome"), - // }}, - // Port: to.Ptr[int32](8080), - // }, - // InitialDelaySeconds: to.Ptr[int32](3), - // PeriodSeconds: to.Ptr[int32](3), - // }}, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerApp0"), - // Args: []*string{ - // to.Ptr("-c"), - // to.Ptr("while true; do echo hello; sleep 10;done")}, - // Command: []*string{ - // to.Ptr("/bin/sh")}, - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_CreateOrUpdate.json -func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateContainerApp() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewContainerAppsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerApp0", armappcontainers.ContainerApp{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.ContainerAppProperties{ - Configuration: &armappcontainers.Configuration{ - Dapr: &armappcontainers.Dapr{ - AppPort: to.Ptr[int32](3000), - AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP), - EnableAPILogging: to.Ptr(true), - Enabled: to.Ptr(true), - HTTPMaxRequestSize: to.Ptr[int32](10), - HTTPReadBufferSize: to.Ptr[int32](30), - LogLevel: to.Ptr(armappcontainers.LogLevelDebug), - }, - Ingress: &armappcontainers.Ingress{ - AdditionalPortMappings: []*armappcontainers.IngressPortMapping{ - { - External: to.Ptr(true), - TargetPort: to.Ptr[int32](1234), - }, - { - ExposedPort: to.Ptr[int32](3456), - External: to.Ptr(false), - TargetPort: to.Ptr[int32](2345), - }}, - ClientCertificateMode: to.Ptr(armappcontainers.IngressClientCertificateModeAccept), - CorsPolicy: &armappcontainers.CorsPolicy{ - AllowCredentials: to.Ptr(true), - AllowedHeaders: []*string{ - to.Ptr("HEADER1"), - to.Ptr("HEADER2")}, - AllowedMethods: []*string{ - to.Ptr("GET"), - to.Ptr("POST")}, - AllowedOrigins: []*string{ - to.Ptr("https://a.test.com"), - to.Ptr("https://b.test.com")}, - ExposeHeaders: []*string{ - to.Ptr("HEADER3"), - to.Ptr("HEADER4")}, - MaxAge: to.Ptr[int32](1234), - }, - CustomDomains: []*armappcontainers.CustomDomain{ - { - Name: to.Ptr("www.my-name.com"), - BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - }, - { - Name: to.Ptr("www.my-other-name.com"), - BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), - }}, - External: to.Ptr(true), - IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{ - { - Name: to.Ptr("Allow work IP A subnet"), - Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - Action: to.Ptr(armappcontainers.ActionAllow), - IPAddressRange: to.Ptr("192.168.1.1/32"), - }, - { - Name: to.Ptr("Allow work IP B subnet"), - Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - Action: to.Ptr(armappcontainers.ActionAllow), - IPAddressRange: to.Ptr("192.168.1.1/8"), - }}, - StickySessions: &armappcontainers.IngressStickySessions{ - Affinity: to.Ptr(armappcontainers.AffinitySticky), - }, - TargetPort: to.Ptr[int32](3000), - Traffic: []*armappcontainers.TrafficWeight{ - { - Label: to.Ptr("production"), - RevisionName: to.Ptr("testcontainerApp0-ab1234"), - Weight: to.Ptr[int32](100), - }}, - }, - MaxInactiveRevisions: to.Ptr[int32](10), - Service: &armappcontainers.Service{ - Type: to.Ptr("redis"), - }, - }, - EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - Template: &armappcontainers.Template{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerApp0"), - Image: to.Ptr("repo/testcontainerApp0:v1"), - VolumeMounts: []*armappcontainers.VolumeMount{ - { - MountPath: to.Ptr("/mnt/path1"), - SubPath: to.Ptr("subPath1"), - VolumeName: to.Ptr("azurefile"), - }, - { - MountPath: to.Ptr("/mnt/path2"), - SubPath: to.Ptr("subPath2"), - VolumeName: to.Ptr("nfsazurefile"), - }}, - Probes: []*armappcontainers.ContainerAppProbe{ - { - Type: to.Ptr(armappcontainers.TypeLiveness), - HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{ - Path: to.Ptr("/health"), - HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{ - { - Name: to.Ptr("Custom-Header"), - Value: to.Ptr("Awesome"), - }}, - Port: to.Ptr[int32](8080), - }, - InitialDelaySeconds: to.Ptr[int32](3), - PeriodSeconds: to.Ptr[int32](3), - }}, - }}, - InitContainers: []*armappcontainers.InitContainer{ - { - Name: to.Ptr("testinitcontainerApp0"), - Args: []*string{ - to.Ptr("-c"), - to.Ptr("while true; do echo hello; sleep 10;done")}, - Command: []*string{ - to.Ptr("/bin/sh")}, - Image: to.Ptr("repo/testcontainerApp0:v4"), - Resources: &armappcontainers.ContainerResources{ - CPU: to.Ptr[float64](0.2), - Memory: to.Ptr("100Mi"), - }, - }}, - Scale: &armappcontainers.Scale{ - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - Rules: []*armappcontainers.ScaleRule{ - { - Name: to.Ptr("httpscalingrule"), - Custom: &armappcontainers.CustomScaleRule{ - Type: to.Ptr("http"), - Metadata: map[string]*string{ - "concurrentRequests": to.Ptr("50"), - }, - }, - }}, - }, - ServiceBinds: []*armappcontainers.ServiceBind{ - { - Name: to.Ptr("redisService"), - ClientType: to.Ptr("dotnet"), - CustomizedKeys: map[string]*string{ - "DesiredKey": to.Ptr("defaultKey"), - }, - ServiceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService"), - }}, - Volumes: []*armappcontainers.Volume{ - { - Name: to.Ptr("azurefile"), - StorageName: to.Ptr("storage"), - StorageType: to.Ptr(armappcontainers.StorageTypeAzureFile), - }, - { - Name: to.Ptr("nfsazurefile"), - StorageName: to.Ptr("nfsStorage"), - StorageType: to.Ptr(armappcontainers.StorageTypeNfsAzureFile), - }}, - }, - WorkloadProfileName: to.Ptr("My-GP-01"), - }, - }, 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.ContainerApp = armappcontainers.ContainerApp{ - // Name: to.Ptr("testcontainerApp0"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // Dapr: &armappcontainers.Dapr{ - // AppPort: to.Ptr[int32](3000), - // AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP), - // Enabled: to.Ptr(true), - // HTTPReadBufferSize: to.Ptr[int32](30), - // }, - // Ingress: &armappcontainers.Ingress{ - // CustomDomains: []*armappcontainers.CustomDomain{ - // { - // Name: to.Ptr("www.my-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - // }, - // { - // Name: to.Ptr("www.my-other-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), - // }}, - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{ - // { - // Name: to.Ptr("Allow work IP A subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/32"), - // }, - // { - // Name: to.Ptr("Allow work IP B subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/8"), - // }}, - // StickySessions: &armappcontainers.IngressStickySessions{ - // Affinity: to.Ptr(armappcontainers.AffinitySticky), - // }, - // TargetPort: to.Ptr[int32](3000), - // TargetPortHTTPScheme: to.Ptr(armappcontainers.IngressTargetPortHTTPSchemeHTTP), - // Traffic: []*armappcontainers.TrafficWeight{ - // { - // RevisionName: to.Ptr("testcontainerApp0-ab1234"), - // Weight: to.Ptr[int32](80), - // }, - // { - // Label: to.Ptr("staging"), - // RevisionName: to.Ptr("testcontainerApp0-ab4321"), - // Weight: to.Ptr[int32](20), - // }}, - // Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto), - // }, - // }, - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // LatestReadyRevisionName: to.Ptr("testcontainerApp0-pjxhsye"), - // LatestRevisionFqdn: to.Ptr("testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // VolumeMounts: []*armappcontainers.VolumeMount{ - // { - // MountPath: to.Ptr("/mnt/path1"), - // SubPath: to.Ptr("subPath1"), - // VolumeName: to.Ptr("azurefile"), - // }, - // { - // MountPath: to.Ptr("/mnt/path2"), - // SubPath: to.Ptr("subPath2"), - // VolumeName: to.Ptr("nfsazurefile"), - // }}, - // Probes: []*armappcontainers.ContainerAppProbe{ - // { - // Type: to.Ptr(armappcontainers.TypeLiveness), - // HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{ - // Path: to.Ptr("/health"), - // HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{ - // { - // Name: to.Ptr("Custom-Header"), - // Value: to.Ptr("Awesome"), - // }}, - // Port: to.Ptr[int32](8080), - // }, - // InitialDelaySeconds: to.Ptr[int32](3), - // PeriodSeconds: to.Ptr[int32](3), - // }}, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerApp0"), - // Args: []*string{ - // to.Ptr("-c"), - // to.Ptr("while true; do echo hello; sleep 10;done")}, - // Command: []*string{ - // to.Ptr("/bin/sh")}, - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // Volumes: []*armappcontainers.Volume{ - // { - // Name: to.Ptr("azurefile"), - // StorageName: to.Ptr("storage"), - // StorageType: to.Ptr(armappcontainers.StorageTypeAzureFile), - // }, - // { - // Name: to.Ptr("nfsazurefile"), - // StorageName: to.Ptr("nfsStorage"), - // StorageType: to.Ptr(armappcontainers.StorageTypeNfsAzureFile), - // }}, - // }, - // WorkloadProfileName: to.Ptr("My-GP-01"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_ManagedBy_CreateOrUpdate.json -func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateManagedByApp() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewContainerAppsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerAppManagedBy", armappcontainers.ContainerApp{ - Location: to.Ptr("East US"), - ManagedBy: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp"), - Properties: &armappcontainers.ContainerAppProperties{ - Configuration: &armappcontainers.Configuration{ - Ingress: &armappcontainers.Ingress{ - ExposedPort: to.Ptr[int32](4000), - External: to.Ptr(true), - TargetPort: to.Ptr[int32](3000), - Traffic: []*armappcontainers.TrafficWeight{ - { - RevisionName: to.Ptr("testcontainerAppManagedBy-ab1234"), - Weight: to.Ptr[int32](100), - }}, - Transport: to.Ptr(armappcontainers.IngressTransportMethodTCP), - }, - }, - EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - Template: &armappcontainers.Template{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerAppManagedBy"), - Image: to.Ptr("repo/testcontainerAppManagedBy:v1"), - Probes: []*armappcontainers.ContainerAppProbe{ - { - Type: to.Ptr(armappcontainers.TypeLiveness), - InitialDelaySeconds: to.Ptr[int32](3), - PeriodSeconds: to.Ptr[int32](3), - TCPSocket: &armappcontainers.ContainerAppProbeTCPSocket{ - Port: to.Ptr[int32](8080), - }, - }}, - }}, - Scale: &armappcontainers.Scale{ - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - Rules: []*armappcontainers.ScaleRule{ - { - Name: to.Ptr("tcpscalingrule"), - TCP: &armappcontainers.TCPScaleRule{ - Metadata: map[string]*string{ - "concurrentConnections": to.Ptr("50"), - }, - }, - }}, - }, - }, - }, - }, 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.ContainerApp = armappcontainers.ContainerApp{ - // Name: to.Ptr("testcontainerAppManagedBy"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerAppManagedBy"), - // Location: to.Ptr("East US"), - // ManagedBy: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp"), - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // Ingress: &armappcontainers.Ingress{ - // ExposedPort: to.Ptr[int32](4000), - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerAppManagedBy.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // TargetPort: to.Ptr[int32](3000), - // Traffic: []*armappcontainers.TrafficWeight{ - // { - // RevisionName: to.Ptr("testcontainerAppManagedBy-ab1234"), - // Weight: to.Ptr[int32](80), - // }, - // { - // RevisionName: to.Ptr("testcontainerAppManagedBy-ab4321"), - // Weight: to.Ptr[int32](20), - // }}, - // Transport: to.Ptr(armappcontainers.IngressTransportMethodTCP), - // }, - // }, - // LatestReadyRevisionName: to.Ptr("testcontainerAppManagedBy-pjxhsye"), - // LatestRevisionFqdn: to.Ptr("testcontainerAppManagedBy-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerAppManagedBy"), - // Image: to.Ptr("repo/testcontainerAppManagedBy:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // Probes: []*armappcontainers.ContainerAppProbe{ - // { - // Type: to.Ptr(armappcontainers.TypeLiveness), - // InitialDelaySeconds: to.Ptr[int32](3), - // PeriodSeconds: to.Ptr[int32](3), - // TCPSocket: &armappcontainers.ContainerAppProbeTCPSocket{ - // Port: to.Ptr[int32](8080), - // }, - // }}, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("tcpscalingrule"), - // TCP: &armappcontainers.TCPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentConnections": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_TcpApp_CreateOrUpdate.json -func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateTcpApp() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewContainerAppsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerAppTcp", armappcontainers.ContainerApp{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.ContainerAppProperties{ - Configuration: &armappcontainers.Configuration{ - Ingress: &armappcontainers.Ingress{ - ExposedPort: to.Ptr[int32](4000), - External: to.Ptr(true), - TargetPort: to.Ptr[int32](3000), - Traffic: []*armappcontainers.TrafficWeight{ - { - RevisionName: to.Ptr("testcontainerAppTcp-ab1234"), - Weight: to.Ptr[int32](100), - }}, - Transport: to.Ptr(armappcontainers.IngressTransportMethodTCP), - }, - }, - EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - Template: &armappcontainers.Template{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerAppTcp"), - Image: to.Ptr("repo/testcontainerAppTcp:v1"), - Probes: []*armappcontainers.ContainerAppProbe{ - { - Type: to.Ptr(armappcontainers.TypeLiveness), - InitialDelaySeconds: to.Ptr[int32](3), - PeriodSeconds: to.Ptr[int32](3), - TCPSocket: &armappcontainers.ContainerAppProbeTCPSocket{ - Port: to.Ptr[int32](8080), - }, - }}, - }}, - Scale: &armappcontainers.Scale{ - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - Rules: []*armappcontainers.ScaleRule{ - { - Name: to.Ptr("tcpscalingrule"), - TCP: &armappcontainers.TCPScaleRule{ - Metadata: map[string]*string{ - "concurrentConnections": to.Ptr("50"), - }, - }, - }}, - }, - }, - }, - }, 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.ContainerApp = armappcontainers.ContainerApp{ - // Name: to.Ptr("testcontainerAppTcp"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerAppTcp"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // Ingress: &armappcontainers.Ingress{ - // ExposedPort: to.Ptr[int32](4000), - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerAppTcp.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // TargetPort: to.Ptr[int32](3000), - // Traffic: []*armappcontainers.TrafficWeight{ - // { - // RevisionName: to.Ptr("testcontainerAppTcp-ab1234"), - // Weight: to.Ptr[int32](80), - // }, - // { - // RevisionName: to.Ptr("testcontainerAppTcp-ab4321"), - // Weight: to.Ptr[int32](20), - // }}, - // Transport: to.Ptr(armappcontainers.IngressTransportMethodTCP), - // }, - // }, - // LatestReadyRevisionName: to.Ptr("testcontainerAppTcp-pjxhsye"), - // LatestRevisionFqdn: to.Ptr("testcontainerAppTcp-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerAppTcp"), - // Image: to.Ptr("repo/testcontainerAppTcp:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // Probes: []*armappcontainers.ContainerAppProbe{ - // { - // Type: to.Ptr(armappcontainers.TypeLiveness), - // InitialDelaySeconds: to.Ptr[int32](3), - // PeriodSeconds: to.Ptr[int32](3), - // TCPSocket: &armappcontainers.ContainerAppProbeTCPSocket{ - // Port: to.Ptr[int32](8080), - // }, - // }}, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("tcpscalingrule"), - // TCP: &armappcontainers.TCPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentConnections": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Delete.json -func ExampleContainerAppsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewContainerAppsClient().BeginDelete(ctx, "rg", "testWorkerApp0", 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/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Patch.json -func ExampleContainerAppsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewContainerAppsClient().BeginUpdate(ctx, "rg", "testcontainerApp0", armappcontainers.ContainerApp{ - Location: to.Ptr("East US"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - Properties: &armappcontainers.ContainerAppProperties{ - Configuration: &armappcontainers.Configuration{ - Dapr: &armappcontainers.Dapr{ - AppPort: to.Ptr[int32](3000), - AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP), - EnableAPILogging: to.Ptr(true), - Enabled: to.Ptr(true), - HTTPMaxRequestSize: to.Ptr[int32](10), - HTTPReadBufferSize: to.Ptr[int32](30), - LogLevel: to.Ptr(armappcontainers.LogLevelDebug), - }, - Ingress: &armappcontainers.Ingress{ - CustomDomains: []*armappcontainers.CustomDomain{ - { - Name: to.Ptr("www.my-name.com"), - BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - }, - { - Name: to.Ptr("www.my-other-name.com"), - BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), - }}, - External: to.Ptr(true), - IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{ - { - Name: to.Ptr("Allow work IP A subnet"), - Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - Action: to.Ptr(armappcontainers.ActionAllow), - IPAddressRange: to.Ptr("192.168.1.1/32"), - }, - { - Name: to.Ptr("Allow work IP B subnet"), - Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - Action: to.Ptr(armappcontainers.ActionAllow), - IPAddressRange: to.Ptr("192.168.1.1/8"), - }}, - StickySessions: &armappcontainers.IngressStickySessions{ - Affinity: to.Ptr(armappcontainers.AffinitySticky), - }, - TargetPort: to.Ptr[int32](3000), - Traffic: []*armappcontainers.TrafficWeight{ - { - Label: to.Ptr("production"), - RevisionName: to.Ptr("testcontainerApp0-ab1234"), - Weight: to.Ptr[int32](100), - }}, - }, - MaxInactiveRevisions: to.Ptr[int32](10), - Service: &armappcontainers.Service{ - Type: to.Ptr("redis"), - }, - }, - Template: &armappcontainers.Template{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerApp0"), - Image: to.Ptr("repo/testcontainerApp0:v1"), - Probes: []*armappcontainers.ContainerAppProbe{ - { - Type: to.Ptr(armappcontainers.TypeLiveness), - HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{ - Path: to.Ptr("/health"), - HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{ - { - Name: to.Ptr("Custom-Header"), - Value: to.Ptr("Awesome"), - }}, - Port: to.Ptr[int32](8080), - }, - InitialDelaySeconds: to.Ptr[int32](3), - PeriodSeconds: to.Ptr[int32](3), - }}, - }}, - InitContainers: []*armappcontainers.InitContainer{ - { - Name: to.Ptr("testinitcontainerApp0"), - Image: to.Ptr("repo/testcontainerApp0:v4"), - Resources: &armappcontainers.ContainerResources{ - CPU: to.Ptr[float64](0.2), - Memory: to.Ptr("100Mi"), - }, - }}, - Scale: &armappcontainers.Scale{ - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - Rules: []*armappcontainers.ScaleRule{ - { - Name: to.Ptr("httpscalingrule"), - Custom: &armappcontainers.CustomScaleRule{ - Type: to.Ptr("http"), - Metadata: map[string]*string{ - "concurrentRequests": to.Ptr("50"), - }, - }, - }}, - }, - ServiceBinds: []*armappcontainers.ServiceBind{ - { - Name: to.Ptr("service"), - ClientType: to.Ptr("dotnet"), - CustomizedKeys: map[string]*string{ - "DesiredKey": to.Ptr("defaultKey"), - }, - ServiceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service"), - }}, - }, - }, - }, 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.ContainerApp = armappcontainers.ContainerApp{ - // Name: to.Ptr("testcontainerApp0"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // Dapr: &armappcontainers.Dapr{ - // AppPort: to.Ptr[int32](3000), - // AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP), - // EnableAPILogging: to.Ptr(true), - // Enabled: to.Ptr(true), - // HTTPMaxRequestSize: to.Ptr[int32](10), - // HTTPReadBufferSize: to.Ptr[int32](30), - // LogLevel: to.Ptr(armappcontainers.LogLevelDebug), - // }, - // Ingress: &armappcontainers.Ingress{ - // CustomDomains: []*armappcontainers.CustomDomain{ - // { - // Name: to.Ptr("www.my-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - // }, - // { - // Name: to.Ptr("www.my--other-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), - // }}, - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{ - // { - // Name: to.Ptr("Allow work IP A subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/32"), - // }, - // { - // Name: to.Ptr("Allow work IP B subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/8"), - // }}, - // TargetPort: to.Ptr[int32](3000), - // TargetPortHTTPScheme: to.Ptr(armappcontainers.IngressTargetPortHTTPSchemeHTTP), - // Traffic: []*armappcontainers.TrafficWeight{ - // { - // RevisionName: to.Ptr("testcontainerApp0-ab1234"), - // Weight: to.Ptr[int32](80), - // }, - // { - // Label: to.Ptr("staging"), - // RevisionName: to.Ptr("testcontainerApp0-ab4321"), - // Weight: to.Ptr[int32](20), - // }}, - // Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto), - // }, - // MaxInactiveRevisions: to.Ptr[int32](10), - // }, - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // LatestReadyRevisionName: to.Ptr("testcontainerApp0-pjxhsye"), - // LatestRevisionFqdn: to.Ptr("testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // }, - // WorkloadProfileName: to.Ptr("My-GP-01"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json -func ExampleContainerAppsClient_ListCustomHostNameAnalysis() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsClient().ListCustomHostNameAnalysis(ctx, "rg", "testcontainerApp0", &armappcontainers.ContainerAppsClientListCustomHostNameAnalysisOptions{CustomHostname: to.Ptr("my.name.corp")}) - 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.CustomHostnameAnalysisResult = armappcontainers.CustomHostnameAnalysisResult{ - // ARecords: []*string{ - // to.Ptr("aRecord1"), - // to.Ptr("aRecord2")}, - // AlternateCNameRecords: []*string{ - // to.Ptr("cNameRecord1"), - // to.Ptr("cNameRecord2")}, - // AlternateTxtRecords: []*string{ - // to.Ptr("txtRecord1"), - // to.Ptr("txtRecord2")}, - // CNameRecords: []*string{ - // to.Ptr("cNameRecord1"), - // to.Ptr("cNameRecord2")}, - // ConflictingContainerAppResourceID: to.Ptr(""), - // CustomDomainVerificationFailureInfo: &armappcontainers.CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo{ - // }, - // CustomDomainVerificationTest: to.Ptr(armappcontainers.DNSVerificationTestResultPassed), - // HasConflictOnManagedEnvironment: to.Ptr(false), - // HostName: to.Ptr("my.name.corp"), - // IsHostnameAlreadyVerified: to.Ptr(true), - // TxtRecords: []*string{ - // to.Ptr("txtRecord1"), - // to.Ptr("txtRecord2")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_ListSecrets.json -func ExampleContainerAppsClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsClient().ListSecrets(ctx, "rg", "testcontainerApp0", 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.SecretsCollection = armappcontainers.SecretsCollection{ - // Value: []*armappcontainers.ContainerAppSecret{ - // { - // Name: to.Ptr("secret1"), - // }, - // { - // Name: to.Ptr("secret2"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_GetAuthToken.json -func ExampleContainerAppsClient_GetAuthToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsClient().GetAuthToken(ctx, "rg", "testcontainerApp0", 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.ContainerAppAuthToken = armappcontainers.ContainerAppAuthToken{ - // Name: to.Ptr("testcontainerApp0"), - // Type: to.Ptr("Microsoft.App/containerApps/accesstoken"), - // ID: to.Ptr("/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ContainerAppAuthTokenProperties{ - // Expires: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-14T19:22:50.308Z"); return t}()), - // Token: to.Ptr("testToken"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Start.json -func ExampleContainerAppsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewContainerAppsClient().BeginStart(ctx, "rg", "testWorkerApp0", 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.ContainerApp = armappcontainers.ContainerApp{ - // Name: to.Ptr("testcontainerApp0"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // Dapr: &armappcontainers.Dapr{ - // AppPort: to.Ptr[int32](3000), - // AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP), - // EnableAPILogging: to.Ptr(true), - // Enabled: to.Ptr(true), - // HTTPMaxRequestSize: to.Ptr[int32](10), - // HTTPReadBufferSize: to.Ptr[int32](30), - // LogLevel: to.Ptr(armappcontainers.LogLevelDebug), - // }, - // Ingress: &armappcontainers.Ingress{ - // CustomDomains: []*armappcontainers.CustomDomain{ - // { - // Name: to.Ptr("www.my-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - // }, - // { - // Name: to.Ptr("www.my--other-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), - // }}, - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{ - // { - // Name: to.Ptr("Allow work IP A subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/32"), - // }, - // { - // Name: to.Ptr("Allow work IP B subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/8"), - // }}, - // TargetPort: to.Ptr[int32](3000), - // TargetPortHTTPScheme: to.Ptr(armappcontainers.IngressTargetPortHTTPSchemeHTTP), - // Traffic: []*armappcontainers.TrafficWeight{ - // { - // RevisionName: to.Ptr("testcontainerApp0-ab1234"), - // Weight: to.Ptr[int32](80), - // }, - // { - // Label: to.Ptr("staging"), - // RevisionName: to.Ptr("testcontainerApp0-ab4321"), - // Weight: to.Ptr[int32](20), - // }}, - // Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto), - // }, - // MaxInactiveRevisions: to.Ptr[int32](10), - // }, - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // LatestReadyRevisionName: to.Ptr("testcontainerApp0-pjxhsye"), - // LatestRevisionFqdn: to.Ptr("testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // }, - // WorkloadProfileName: to.Ptr("My-GP-01"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Stop.json -func ExampleContainerAppsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewContainerAppsClient().BeginStop(ctx, "rg", "testWorkerApp0", 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.ContainerApp = armappcontainers.ContainerApp{ - // Name: to.Ptr("testcontainerApp0"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // Dapr: &armappcontainers.Dapr{ - // AppPort: to.Ptr[int32](3000), - // AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP), - // EnableAPILogging: to.Ptr(true), - // Enabled: to.Ptr(true), - // HTTPMaxRequestSize: to.Ptr[int32](10), - // HTTPReadBufferSize: to.Ptr[int32](30), - // LogLevel: to.Ptr(armappcontainers.LogLevelDebug), - // }, - // Ingress: &armappcontainers.Ingress{ - // CustomDomains: []*armappcontainers.CustomDomain{ - // { - // Name: to.Ptr("www.my-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - // }, - // { - // Name: to.Ptr("www.my--other-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), - // }}, - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{ - // { - // Name: to.Ptr("Allow work IP A subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/32"), - // }, - // { - // Name: to.Ptr("Allow work IP B subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/8"), - // }}, - // TargetPort: to.Ptr[int32](3000), - // TargetPortHTTPScheme: to.Ptr(armappcontainers.IngressTargetPortHTTPSchemeHTTP), - // Traffic: []*armappcontainers.TrafficWeight{ - // { - // RevisionName: to.Ptr("testcontainerApp0-ab1234"), - // Weight: to.Ptr[int32](80), - // }, - // { - // Label: to.Ptr("staging"), - // RevisionName: to.Ptr("testcontainerApp0-ab4321"), - // Weight: to.Ptr[int32](20), - // }}, - // Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto), - // }, - // MaxInactiveRevisions: to.Ptr[int32](10), - // }, - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // LatestReadyRevisionName: to.Ptr("testcontainerApp0-pjxhsye"), - // LatestRevisionFqdn: to.Ptr("testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // }, - // WorkloadProfileName: to.Ptr("My-GP-01"), - // }, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsapi_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsapi_client.go index 7d3fd0dfd722..014745c50651 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsapi_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsapi_client.go @@ -46,7 +46,7 @@ func NewContainerAppsAPIClient(subscriptionID string, credential azcore.TokenCre // GetCustomDomainVerificationID - Get the verification id of a subscription used for verifying custom domains // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - options - ContainerAppsAPIClientGetCustomDomainVerificationIDOptions contains the optional parameters for the ContainerAppsAPIClient.GetCustomDomainVerificationID // method. func (client *ContainerAppsAPIClient) GetCustomDomainVerificationID(ctx context.Context, options *ContainerAppsAPIClientGetCustomDomainVerificationIDOptions) (ContainerAppsAPIClientGetCustomDomainVerificationIDResponse, error) { @@ -83,7 +83,7 @@ func (client *ContainerAppsAPIClient) getCustomDomainVerificationIDCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -101,7 +101,7 @@ func (client *ContainerAppsAPIClient) getCustomDomainVerificationIDHandleRespons // JobExecution - Get details of a single job execution // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - jobExecutionName - Job execution name. @@ -153,7 +153,7 @@ func (client *ContainerAppsAPIClient) jobExecutionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsapi_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsapi_client_example_test.go deleted file mode 100644 index af69eb51e777..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsapi_client_example_test.go +++ /dev/null @@ -1,92 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Execution_Get.json -func ExampleContainerAppsAPIClient_JobExecution() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsAPIClient().JobExecution(ctx, "rg", "testcontainerAppsJob0", "jobExecution1", 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.JobExecution = armappcontainers.JobExecution{ - // Name: to.Ptr("jobExecution1"), - // Properties: &armappcontainers.JobExecutionProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-13T20:47:30.000Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-13T20:37:30.000Z"); return t}()), - // Status: to.Ptr(armappcontainers.JobExecutionRunningStateRunning), - // Template: &armappcontainers.JobExecutionTemplate{ - // Containers: []*armappcontainers.JobExecutionContainer{ - // { - // Name: to.Ptr("testcontainerappsjob0"), - // Image: to.Ptr("repo/testcontainerappsjob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.5), - // Memory: to.Ptr("1Gi"), - // }, - // }}, - // InitContainers: []*armappcontainers.JobExecutionContainer{ - // { - // Name: to.Ptr("testinitcontainerAppsJob0"), - // Args: []*string{ - // to.Ptr("-c"), - // to.Ptr("while true; do echo hello; sleep 10;done")}, - // Command: []*string{ - // to.Ptr("/bin/sh")}, - // Image: to.Ptr("repo/testcontainerappsjob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.5), - // Memory: to.Ptr("1Gi"), - // }, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Subscriptions_GetCustomDomainVerificationId.json -func ExampleContainerAppsAPIClient_GetCustomDomainVerificationID() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsAPIClient().GetCustomDomainVerificationID(ctx, 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.Value = "5B406D5E790BBD224468CE0AA814C396203C7CE755F135A80E35D41865E51967" -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client.go index 8747c68af1f2..ea506f5ceb42 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client.go @@ -46,7 +46,7 @@ func NewContainerAppsAuthConfigsClient(subscriptionID string, credential azcore. // CreateOrUpdate - Create or update the AuthConfig for a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - authConfigName - Name of the Container App AuthConfig. @@ -99,7 +99,7 @@ func (client *ContainerAppsAuthConfigsClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, authConfigEnvelope); err != nil { @@ -120,7 +120,7 @@ func (client *ContainerAppsAuthConfigsClient) createOrUpdateHandleResponse(resp // Delete - Delete a Container App AuthConfig. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - authConfigName - Name of the Container App AuthConfig. @@ -171,7 +171,7 @@ func (client *ContainerAppsAuthConfigsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *ContainerAppsAuthConfigsClient) deleteCreateRequest(ctx context.Co // Get - Get a AuthConfig of a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - authConfigName - Name of the Container App AuthConfig. @@ -232,7 +232,7 @@ func (client *ContainerAppsAuthConfigsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *ContainerAppsAuthConfigsClient) getHandleResponse(resp *http.Respo // NewListByContainerAppPager - Get the Container App AuthConfigs in a given resource group. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - options - ContainerAppsAuthConfigsClientListByContainerAppOptions contains the optional parameters for the ContainerAppsAuthConfigsClient.NewListByContainerAppPager @@ -297,7 +297,7 @@ func (client *ContainerAppsAuthConfigsClient) listByContainerAppCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client_example_test.go deleted file mode 100644 index 18f336d2574c..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AuthConfigs_ListByContainer.json -func ExampleContainerAppsAuthConfigsClient_NewListByContainerAppPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewContainerAppsAuthConfigsClient().NewListByContainerAppPager("workerapps-rg-xj", "testcanadacentral", 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.AuthConfigCollection = armappcontainers.AuthConfigCollection{ - // Value: []*armappcontainers.AuthConfig{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.App/containerapps/authconfigs"), - // ID: to.Ptr("/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.App/containerApps/testcanadacentral/authconfigs/current"), - // Properties: &armappcontainers.AuthConfigProperties{ - // EncryptionSettings: &armappcontainers.EncryptionSettings{ - // ContainerAppAuthEncryptionSecretName: to.Ptr("testEncryptionSecretName"), - // ContainerAppAuthSigningSecretName: to.Ptr("testSigningSecretName"), - // }, - // GlobalValidation: &armappcontainers.GlobalValidation{ - // UnauthenticatedClientAction: to.Ptr(armappcontainers.UnauthenticatedClientActionV2AllowAnonymous), - // }, - // IdentityProviders: &armappcontainers.IdentityProviders{ - // Facebook: &armappcontainers.Facebook{ - // Registration: &armappcontainers.AppRegistration{ - // AppID: to.Ptr("123"), - // AppSecretSettingName: to.Ptr("facebook-secret"), - // }, - // }, - // }, - // Platform: &armappcontainers.AuthPlatform{ - // Enabled: to.Ptr(true), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AuthConfigs_Get.json -func ExampleContainerAppsAuthConfigsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsAuthConfigsClient().Get(ctx, "workerapps-rg-xj", "testcanadacentral", "current", 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.AuthConfig = armappcontainers.AuthConfig{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.App/containerapps/authconfigs"), - // ID: to.Ptr("/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.App/containerApps/testcanadacentral/authconfigs/current"), - // Properties: &armappcontainers.AuthConfigProperties{ - // EncryptionSettings: &armappcontainers.EncryptionSettings{ - // ContainerAppAuthEncryptionSecretName: to.Ptr("testEncryptionSecretName"), - // ContainerAppAuthSigningSecretName: to.Ptr("testSigningSecretName"), - // }, - // GlobalValidation: &armappcontainers.GlobalValidation{ - // UnauthenticatedClientAction: to.Ptr(armappcontainers.UnauthenticatedClientActionV2AllowAnonymous), - // }, - // IdentityProviders: &armappcontainers.IdentityProviders{ - // Facebook: &armappcontainers.Facebook{ - // Registration: &armappcontainers.AppRegistration{ - // AppID: to.Ptr("123"), - // AppSecretSettingName: to.Ptr("facebook-secret"), - // }, - // }, - // }, - // Platform: &armappcontainers.AuthPlatform{ - // Enabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AuthConfigs_CreateOrUpdate.json -func ExampleContainerAppsAuthConfigsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsAuthConfigsClient().CreateOrUpdate(ctx, "workerapps-rg-xj", "testcanadacentral", "current", armappcontainers.AuthConfig{ - Properties: &armappcontainers.AuthConfigProperties{ - EncryptionSettings: &armappcontainers.EncryptionSettings{ - ContainerAppAuthEncryptionSecretName: to.Ptr("testEncryptionSecretName"), - ContainerAppAuthSigningSecretName: to.Ptr("testSigningSecretName"), - }, - GlobalValidation: &armappcontainers.GlobalValidation{ - UnauthenticatedClientAction: to.Ptr(armappcontainers.UnauthenticatedClientActionV2AllowAnonymous), - }, - IdentityProviders: &armappcontainers.IdentityProviders{ - Facebook: &armappcontainers.Facebook{ - Registration: &armappcontainers.AppRegistration{ - AppID: to.Ptr("123"), - AppSecretSettingName: to.Ptr("facebook-secret"), - }, - }, - }, - Platform: &armappcontainers.AuthPlatform{ - Enabled: to.Ptr(true), - }, - }, - }, 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.AuthConfig = armappcontainers.AuthConfig{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.App/containerapps/authconfigs"), - // ID: to.Ptr("/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.App/containerApps/myapp/authconfigs/current"), - // Properties: &armappcontainers.AuthConfigProperties{ - // EncryptionSettings: &armappcontainers.EncryptionSettings{ - // ContainerAppAuthEncryptionSecretName: to.Ptr("testEncryptionSecretName"), - // ContainerAppAuthSigningSecretName: to.Ptr("testSigningSecretName"), - // }, - // GlobalValidation: &armappcontainers.GlobalValidation{ - // UnauthenticatedClientAction: to.Ptr(armappcontainers.UnauthenticatedClientActionV2AllowAnonymous), - // }, - // IdentityProviders: &armappcontainers.IdentityProviders{ - // Facebook: &armappcontainers.Facebook{ - // Registration: &armappcontainers.AppRegistration{ - // AppID: to.Ptr("123"), - // AppSecretSettingName: to.Ptr("facebook-secret"), - // }, - // }, - // }, - // Platform: &armappcontainers.AuthPlatform{ - // Enabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/AuthConfigs_Delete.json -func ExampleContainerAppsAuthConfigsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewContainerAppsAuthConfigsClient().Delete(ctx, "workerapps-rg-xj", "testcanadacentral", "current", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuilds_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuilds_client.go new file mode 100644 index 000000000000..1ff56b57938a --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuilds_client.go @@ -0,0 +1,196 @@ +//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 armappcontainers + +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" +) + +// ContainerAppsBuildsClient contains the methods for the ContainerAppsBuilds group. +// Don't use this type directly, use NewContainerAppsBuildsClient() instead. +type ContainerAppsBuildsClient struct { + internal *arm.Client + subscriptionID string + containerAppName string +} + +// NewContainerAppsBuildsClient creates a new instance of ContainerAppsBuildsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - containerAppName - Name of the Container App the Build is associated. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewContainerAppsBuildsClient(subscriptionID string, containerAppName string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerAppsBuildsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ContainerAppsBuildsClient{ + subscriptionID: subscriptionID, + containerAppName: containerAppName, + internal: cl, + } + return client, nil +} + +// BeginDelete - Delete a Container Apps Build resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - buildName - The name of a build. +// - options - ContainerAppsBuildsClientBeginDeleteOptions contains the optional parameters for the ContainerAppsBuildsClient.BeginDelete +// method. +func (client *ContainerAppsBuildsClient) BeginDelete(ctx context.Context, resourceGroupName string, buildName string, options *ContainerAppsBuildsClientBeginDeleteOptions) (*runtime.Poller[ContainerAppsBuildsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, buildName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerAppsBuildsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ContainerAppsBuildsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete a Container Apps Build resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-02-preview +func (client *ContainerAppsBuildsClient) deleteOperation(ctx context.Context, resourceGroupName string, buildName string, options *ContainerAppsBuildsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ContainerAppsBuildsClient.BeginDelete" + 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, buildName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ContainerAppsBuildsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, buildName string, options *ContainerAppsBuildsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}" + 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 client.containerAppName == "" { + return nil, errors.New("parameter client.containerAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(client.containerAppName)) + if buildName == "" { + return nil, errors.New("parameter buildName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{buildName}", url.PathEscape(buildName)) + 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-02-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a Container Apps Build resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - buildName - The name of a build. +// - options - ContainerAppsBuildsClientGetOptions contains the optional parameters for the ContainerAppsBuildsClient.Get method. +func (client *ContainerAppsBuildsClient) Get(ctx context.Context, resourceGroupName string, buildName string, options *ContainerAppsBuildsClientGetOptions) (ContainerAppsBuildsClientGetResponse, error) { + var err error + const operationName = "ContainerAppsBuildsClient.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, buildName, options) + if err != nil { + return ContainerAppsBuildsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ContainerAppsBuildsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ContainerAppsBuildsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ContainerAppsBuildsClient) getCreateRequest(ctx context.Context, resourceGroupName string, buildName string, options *ContainerAppsBuildsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}" + 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 client.containerAppName == "" { + return nil, errors.New("parameter client.containerAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(client.containerAppName)) + if buildName == "" { + return nil, errors.New("parameter buildName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{buildName}", url.PathEscape(buildName)) + 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-02-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ContainerAppsBuildsClient) getHandleResponse(resp *http.Response) (ContainerAppsBuildsClientGetResponse, error) { + result := ContainerAppsBuildsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ContainerAppsBuildResource); err != nil { + return ContainerAppsBuildsClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuildsbycontainerapp_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuildsbycontainerapp_client.go new file mode 100644 index 000000000000..f34521d46e3c --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuildsbycontainerapp_client.go @@ -0,0 +1,111 @@ +//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 armappcontainers + +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" +) + +// ContainerAppsBuildsByContainerAppClient contains the methods for the ContainerAppsBuildsByContainerApp group. +// Don't use this type directly, use NewContainerAppsBuildsByContainerAppClient() instead. +type ContainerAppsBuildsByContainerAppClient struct { + internal *arm.Client + subscriptionID string + containerAppName string +} + +// NewContainerAppsBuildsByContainerAppClient creates a new instance of ContainerAppsBuildsByContainerAppClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - containerAppName - Name of the Container App the Build is associated. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewContainerAppsBuildsByContainerAppClient(subscriptionID string, containerAppName string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerAppsBuildsByContainerAppClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ContainerAppsBuildsByContainerAppClient{ + subscriptionID: subscriptionID, + containerAppName: containerAppName, + internal: cl, + } + return client, nil +} + +// NewListPager - List Container Apps Build resources by Container App +// +// Generated from API version 2024-02-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ContainerAppsBuildsByContainerAppClientListOptions contains the optional parameters for the ContainerAppsBuildsByContainerAppClient.NewListPager +// method. +func (client *ContainerAppsBuildsByContainerAppClient) NewListPager(resourceGroupName string, options *ContainerAppsBuildsByContainerAppClientListOptions) *runtime.Pager[ContainerAppsBuildsByContainerAppClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ContainerAppsBuildsByContainerAppClientListResponse]{ + More: func(page ContainerAppsBuildsByContainerAppClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ContainerAppsBuildsByContainerAppClientListResponse) (ContainerAppsBuildsByContainerAppClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ContainerAppsBuildsByContainerAppClient.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 ContainerAppsBuildsByContainerAppClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *ContainerAppsBuildsByContainerAppClient) listCreateRequest(ctx context.Context, resourceGroupName string, options *ContainerAppsBuildsByContainerAppClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds" + 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 client.containerAppName == "" { + return nil, errors.New("parameter client.containerAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(client.containerAppName)) + 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-02-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ContainerAppsBuildsByContainerAppClient) listHandleResponse(resp *http.Response) (ContainerAppsBuildsByContainerAppClientListResponse, error) { + result := ContainerAppsBuildsByContainerAppClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ContainerAppsBuildCollection); err != nil { + return ContainerAppsBuildsByContainerAppClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go index 465c86da8466..42dbe5272889 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go @@ -46,7 +46,7 @@ func NewContainerAppsDiagnosticsClient(subscriptionID string, credential azcore. // GetDetector - Get a diagnostics result of a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - detectorName - Name of the Container App Detector. @@ -98,7 +98,7 @@ func (client *ContainerAppsDiagnosticsClient) getDetectorCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *ContainerAppsDiagnosticsClient) getDetectorHandleResponse(resp *ht // GetRevision - Get a revision of a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - revisionName - Name of the Container App Revision. @@ -168,7 +168,7 @@ func (client *ContainerAppsDiagnosticsClient) getRevisionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +186,7 @@ func (client *ContainerAppsDiagnosticsClient) getRevisionHandleResponse(resp *ht // GetRoot - Get the properties of a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - options - ContainerAppsDiagnosticsClientGetRootOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.GetRoot @@ -233,7 +233,7 @@ func (client *ContainerAppsDiagnosticsClient) getRootCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +250,7 @@ func (client *ContainerAppsDiagnosticsClient) getRootHandleResponse(resp *http.R // NewListDetectorsPager - Get the list of diagnostics for a given Container App. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App for which detector info is needed. // - options - ContainerAppsDiagnosticsClientListDetectorsOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.NewListDetectorsPager @@ -298,7 +298,7 @@ func (client *ContainerAppsDiagnosticsClient) listDetectorsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -315,7 +315,7 @@ func (client *ContainerAppsDiagnosticsClient) listDetectorsHandleResponse(resp * // NewListRevisionsPager - Get the Revisions for a given Container App. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App for which Revisions are needed. // - options - ContainerAppsDiagnosticsClientListRevisionsOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.NewListRevisionsPager @@ -366,7 +366,7 @@ func (client *ContainerAppsDiagnosticsClient) listRevisionsCreateRequest(ctx con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client_example_test.go deleted file mode 100644 index ab0427972c9e..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client_example_test.go +++ /dev/null @@ -1,420 +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 armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerAppsDiagnostics_List.json -func ExampleContainerAppsDiagnosticsClient_NewListDetectorsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewContainerAppsDiagnosticsClient().NewListDetectorsPager("mikono-workerapp-test-rg", "mikono-capp-stage1", 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.DiagnosticsCollection = armappcontainers.DiagnosticsCollection{ - // Value: []*armappcontainers.Diagnostics{ - // { - // Name: to.Ptr("cappContainerAppAvailabilityMetrics"), - // Type: to.Ptr("Microsoft.App/containerapps/detectors"), - // ID: to.Ptr("/subscriptions/f07f3711-b45e-40fe-a941-4e6d93f851e6/resourceGroups/mikono-workerapp-test-rg/providers/Microsoft.App/containerApps/mikono-capp-stage1/detectors/cappContainerAppAvailabilityMetrics"), - // Properties: &armappcontainers.DiagnosticsProperties{ - // Dataset: []*armappcontainers.DiagnosticsDataAPIResponse{ - // }, - // Metadata: &armappcontainers.DiagnosticsDefinition{ - // Name: to.Ptr("Availability Metrics for Container Apps"), - // Type: to.Ptr("Analysis"), - // Author: to.Ptr(""), - // Category: to.Ptr("Availability and Performance"), - // ID: to.Ptr("cappContainerAppAvailabilityMetrics"), - // Score: to.Ptr[float32](0), - // SupportTopicList: []*armappcontainers.DiagnosticSupportTopic{ - // }, - // }, - // Status: &armappcontainers.DiagnosticsStatus{ - // StatusID: to.Ptr[int32](4), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerAppsDiagnostics_Get.json -func ExampleContainerAppsDiagnosticsClient_GetDetector() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsDiagnosticsClient().GetDetector(ctx, "mikono-workerapp-test-rg", "mikono-capp-stage1", "cappcontainerappnetworkIO", 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.Diagnostics = armappcontainers.Diagnostics{ - // Name: to.Ptr("cappcontainerappnetworkIO"), - // Type: to.Ptr("Microsoft.App/containerapps/detectors"), - // ID: to.Ptr("/subscriptions/f07f3711-b45e-40fe-a941-4e6d93f851e6/resourceGroups/mikono-workerapp-test-rg/providers/Microsoft.App/containerApps/mikono-capp-stage1/detectors/cappcontainerappnetworkIO"), - // Properties: &armappcontainers.DiagnosticsProperties{ - // Dataset: []*armappcontainers.DiagnosticsDataAPIResponse{ - // { - // RenderingProperties: &armappcontainers.DiagnosticRendering{ - // Type: to.Ptr[int32](8), - // Description: to.Ptr(""), - // IsVisible: to.Ptr(true), - // Title: to.Ptr("Container Apps Network Inbound "), - // }, - // Table: &armappcontainers.DiagnosticDataTableResponseObject{ - // Columns: []*armappcontainers.DiagnosticDataTableResponseColumn{ - // { - // ColumnName: to.Ptr("TimeStamp"), - // DataType: to.Ptr("DateTime"), - // }, - // { - // ColumnName: to.Ptr("Metric"), - // DataType: to.Ptr("String"), - // }, - // { - // ColumnName: to.Ptr("Average"), - // DataType: to.Ptr("Double"), - // }}, - // Rows: []any{ - // []any{ - // "2022-03-15T21:35:00", - // "RxBytes", - // float64(0), - // }}, - // TableName: to.Ptr(""), - // }, - // }}, - // Metadata: &armappcontainers.DiagnosticsDefinition{ - // Name: to.Ptr("Container App Network Inbound and Outbound"), - // Type: to.Ptr("Detector"), - // Description: to.Ptr("This detector shows the Container App Network Inbound and Outbound."), - // Author: to.Ptr(""), - // Category: to.Ptr("Availability and Performance"), - // ID: to.Ptr("cappcontainerappnetworkIO"), - // Score: to.Ptr[float32](0), - // SupportTopicList: []*armappcontainers.DiagnosticSupportTopic{ - // }, - // }, - // Status: &armappcontainers.DiagnosticsStatus{ - // StatusID: to.Ptr[int32](3), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_List.json -func ExampleContainerAppsDiagnosticsClient_NewListRevisionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewContainerAppsDiagnosticsClient().NewListRevisionsPager("rg", "testcontainerApp0", &armappcontainers.ContainerAppsDiagnosticsClientListRevisionsOptions{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.RevisionCollection = armappcontainers.RevisionCollection{ - // Value: []*armappcontainers.Revision{ - // { - // Name: to.Ptr("testcontainerApp0-pjxhsye"), - // Type: to.Ptr("Microsoft.App/containerApps/revisions"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0/revisions/testcontainerApp0-pjxhsye"), - // Properties: &armappcontainers.RevisionProperties{ - // Active: to.Ptr(true), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-24T21:24:22.000Z"); return t}()), - // Fqdn: to.Ptr("testcontainerApp0-pjxhsye.politehill-ab123456.eastus.azurecontainerapps.io"), - // LastActiveTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-24T21:24:22.000Z"); return t}()), - // Replicas: to.Ptr[int32](1), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v2"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // }, - // TrafficWeight: to.Ptr[int32](80), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Get.json -func ExampleContainerAppsDiagnosticsClient_GetRevision() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsDiagnosticsClient().GetRevision(ctx, "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", 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.Revision = armappcontainers.Revision{ - // Name: to.Ptr("testcontainerApp0-pjxhsye"), - // Type: to.Ptr("Microsoft.App/containerApps/revisions"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppcontainerApps/testcontainerApp0/revisions/testcontainerApp0-pjxhsye"), - // Properties: &armappcontainers.RevisionProperties{ - // Active: to.Ptr(true), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-24T21:24:22.000Z"); return t}()), - // Fqdn: to.Ptr("testcontainerApp0-pjxhsye.politehill-ab123456.eastus.azurecontainerapps.io"), - // LastActiveTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-24T21:24:22.000Z"); return t}()), - // Replicas: to.Ptr[int32](1), - // RunningState: to.Ptr(armappcontainers.RevisionRunningStateRunning), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v2"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // }, - // TrafficWeight: to.Ptr[int32](80), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_Get.json -func ExampleContainerAppsDiagnosticsClient_GetRoot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsDiagnosticsClient().GetRoot(ctx, "rg", "testcontainerApp0", 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.ContainerApp = armappcontainers.ContainerApp{ - // Name: to.Ptr("testcontainerApp0"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // Dapr: &armappcontainers.Dapr{ - // AppPort: to.Ptr[int32](3000), - // AppProtocol: to.Ptr(armappcontainers.AppProtocolHTTP), - // EnableAPILogging: to.Ptr(true), - // Enabled: to.Ptr(true), - // HTTPMaxRequestSize: to.Ptr[int32](10), - // HTTPReadBufferSize: to.Ptr[int32](30), - // LogLevel: to.Ptr(armappcontainers.LogLevelDebug), - // }, - // Ingress: &armappcontainers.Ingress{ - // CustomDomains: []*armappcontainers.CustomDomain{ - // { - // Name: to.Ptr("www.my-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com"), - // }, - // { - // Name: to.Ptr("www.my--other-name.com"), - // BindingType: to.Ptr(armappcontainers.BindingTypeSniEnabled), - // CertificateID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com"), - // }}, - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerApp0.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // IPSecurityRestrictions: []*armappcontainers.IPSecurityRestrictionRule{ - // { - // Name: to.Ptr("Allow work IP A subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/32"), - // }, - // { - // Name: to.Ptr("Allow work IP B subnet"), - // Description: to.Ptr("Allowing all IP's within the subnet below to access containerapp"), - // Action: to.Ptr(armappcontainers.ActionAllow), - // IPAddressRange: to.Ptr("192.168.1.1/8"), - // }}, - // StickySessions: &armappcontainers.IngressStickySessions{ - // Affinity: to.Ptr(armappcontainers.AffinitySticky), - // }, - // TargetPort: to.Ptr[int32](3000), - // TargetPortHTTPScheme: to.Ptr(armappcontainers.IngressTargetPortHTTPSchemeHTTP), - // Traffic: []*armappcontainers.TrafficWeight{ - // { - // RevisionName: to.Ptr("testcontainerApp0-ab1234"), - // Weight: to.Ptr[int32](80), - // }, - // { - // Label: to.Ptr("staging"), - // RevisionName: to.Ptr("testcontainerApp0-ab4321"), - // Weight: to.Ptr[int32](20), - // }}, - // Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto), - // }, - // MaxInactiveRevisions: to.Ptr[int32](10), - // Service: &armappcontainers.Service{ - // Type: to.Ptr("redis"), - // }, - // }, - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // LatestReadyRevisionName: to.Ptr("testcontainerApp0-pjxhsye"), - // LatestRevisionFqdn: to.Ptr("testcontainerApp0-pjxhsye.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // VolumeMounts: []*armappcontainers.VolumeMount{ - // { - // MountPath: to.Ptr("/mnt/path1"), - // SubPath: to.Ptr("subPath1"), - // VolumeName: to.Ptr("azurefile"), - // }, - // { - // MountPath: to.Ptr("/mnt/path2"), - // SubPath: to.Ptr("subPath2"), - // VolumeName: to.Ptr("nfsazurefile"), - // }}, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // ServiceBinds: []*armappcontainers.ServiceBind{ - // { - // Name: to.Ptr("service"), - // ClientType: to.Ptr("dotnet"), - // CustomizedKeys: map[string]*string{ - // "DesiredKey": to.Ptr("defaultKey"), - // }, - // ServiceID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service"), - // }}, - // Volumes: []*armappcontainers.Volume{ - // { - // Name: to.Ptr("azurefile"), - // StorageName: to.Ptr("storage"), - // StorageType: to.Ptr(armappcontainers.StorageTypeAzureFile), - // }, - // { - // Name: to.Ptr("nfsazurefile"), - // StorageName: to.Ptr("nfsStorage"), - // StorageType: to.Ptr(armappcontainers.StorageTypeNfsAzureFile), - // }}, - // }, - // WorkloadProfileName: to.Ptr("My-GP-01"), - // }, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappspatches_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappspatches_client.go new file mode 100644 index 000000000000..9a46119ea91d --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappspatches_client.go @@ -0,0 +1,430 @@ +//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 armappcontainers + +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" +) + +// ContainerAppsPatchesClient contains the methods for the ContainerAppsPatches group. +// Don't use this type directly, use NewContainerAppsPatchesClient() instead. +type ContainerAppsPatchesClient struct { + internal *arm.Client + subscriptionID string + containerAppName string +} + +// NewContainerAppsPatchesClient creates a new instance of ContainerAppsPatchesClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - containerAppName - Name of the Container App the Build is associated. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewContainerAppsPatchesClient(subscriptionID string, containerAppName string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerAppsPatchesClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ContainerAppsPatchesClient{ + subscriptionID: subscriptionID, + containerAppName: containerAppName, + internal: cl, + } + return client, nil +} + +// BeginApply - Apply a Container Apps Patch resource with patch name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - patchName - The name of the patch +// - options - ContainerAppsPatchesClientBeginApplyOptions contains the optional parameters for the ContainerAppsPatchesClient.BeginApply +// method. +func (client *ContainerAppsPatchesClient) BeginApply(ctx context.Context, resourceGroupName string, patchName string, options *ContainerAppsPatchesClientBeginApplyOptions) (*runtime.Poller[ContainerAppsPatchesClientApplyResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.apply(ctx, resourceGroupName, patchName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerAppsPatchesClientApplyResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ContainerAppsPatchesClientApplyResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Apply - Apply a Container Apps Patch resource with patch name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-02-preview +func (client *ContainerAppsPatchesClient) apply(ctx context.Context, resourceGroupName string, patchName string, options *ContainerAppsPatchesClientBeginApplyOptions) (*http.Response, error) { + var err error + const operationName = "ContainerAppsPatchesClient.BeginApply" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.applyCreateRequest(ctx, resourceGroupName, patchName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// applyCreateRequest creates the Apply request. +func (client *ContainerAppsPatchesClient) applyCreateRequest(ctx context.Context, resourceGroupName string, patchName string, options *ContainerAppsPatchesClientBeginApplyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/apply" + 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 client.containerAppName == "" { + return nil, errors.New("parameter client.containerAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(client.containerAppName)) + if patchName == "" { + return nil, errors.New("parameter patchName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{patchName}", url.PathEscape(patchName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-02-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginDelete - Delete specific Container Apps Patch by patch name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - patchName - The name of the patch +// - options - ContainerAppsPatchesClientBeginDeleteOptions contains the optional parameters for the ContainerAppsPatchesClient.BeginDelete +// method. +func (client *ContainerAppsPatchesClient) BeginDelete(ctx context.Context, resourceGroupName string, patchName string, options *ContainerAppsPatchesClientBeginDeleteOptions) (*runtime.Poller[ContainerAppsPatchesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, patchName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerAppsPatchesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ContainerAppsPatchesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete specific Container Apps Patch by patch name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-02-preview +func (client *ContainerAppsPatchesClient) deleteOperation(ctx context.Context, resourceGroupName string, patchName string, options *ContainerAppsPatchesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ContainerAppsPatchesClient.BeginDelete" + 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, patchName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ContainerAppsPatchesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, patchName string, options *ContainerAppsPatchesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}" + 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 client.containerAppName == "" { + return nil, errors.New("parameter client.containerAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(client.containerAppName)) + if patchName == "" { + return nil, errors.New("parameter patchName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{patchName}", url.PathEscape(patchName)) + 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-02-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get details for specific Container Apps Patch by patch name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - patchName - The name of the patch +// - options - ContainerAppsPatchesClientGetOptions contains the optional parameters for the ContainerAppsPatchesClient.Get +// method. +func (client *ContainerAppsPatchesClient) Get(ctx context.Context, resourceGroupName string, patchName string, options *ContainerAppsPatchesClientGetOptions) (ContainerAppsPatchesClientGetResponse, error) { + var err error + const operationName = "ContainerAppsPatchesClient.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, patchName, options) + if err != nil { + return ContainerAppsPatchesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ContainerAppsPatchesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ContainerAppsPatchesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ContainerAppsPatchesClient) getCreateRequest(ctx context.Context, resourceGroupName string, patchName string, options *ContainerAppsPatchesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}" + 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 client.containerAppName == "" { + return nil, errors.New("parameter client.containerAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(client.containerAppName)) + if patchName == "" { + return nil, errors.New("parameter patchName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{patchName}", url.PathEscape(patchName)) + 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-02-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ContainerAppsPatchesClient) getHandleResponse(resp *http.Response) (ContainerAppsPatchesClientGetResponse, error) { + result := ContainerAppsPatchesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ContainerAppsPatchResource); err != nil { + return ContainerAppsPatchesClientGetResponse{}, err + } + return result, nil +} + +// NewListByContainerAppPager - List Container Apps Patch resources by ContainerApp. +// +// Generated from API version 2024-02-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ContainerAppsPatchesClientListByContainerAppOptions contains the optional parameters for the ContainerAppsPatchesClient.NewListByContainerAppPager +// method. +func (client *ContainerAppsPatchesClient) NewListByContainerAppPager(resourceGroupName string, options *ContainerAppsPatchesClientListByContainerAppOptions) *runtime.Pager[ContainerAppsPatchesClientListByContainerAppResponse] { + return runtime.NewPager(runtime.PagingHandler[ContainerAppsPatchesClientListByContainerAppResponse]{ + More: func(page ContainerAppsPatchesClientListByContainerAppResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ContainerAppsPatchesClientListByContainerAppResponse) (ContainerAppsPatchesClientListByContainerAppResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ContainerAppsPatchesClient.NewListByContainerAppPager") + 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.listByContainerAppCreateRequest(ctx, resourceGroupName, options) + }, nil) + if err != nil { + return ContainerAppsPatchesClientListByContainerAppResponse{}, err + } + return client.listByContainerAppHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByContainerAppCreateRequest creates the ListByContainerApp request. +func (client *ContainerAppsPatchesClient) listByContainerAppCreateRequest(ctx context.Context, resourceGroupName string, options *ContainerAppsPatchesClientListByContainerAppOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches" + 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 client.containerAppName == "" { + return nil, errors.New("parameter client.containerAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(client.containerAppName)) + 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-02-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByContainerAppHandleResponse handles the ListByContainerApp response. +func (client *ContainerAppsPatchesClient) listByContainerAppHandleResponse(resp *http.Response) (ContainerAppsPatchesClientListByContainerAppResponse, error) { + result := ContainerAppsPatchesClientListByContainerAppResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PatchCollection); err != nil { + return ContainerAppsPatchesClientListByContainerAppResponse{}, err + } + return result, nil +} + +// BeginSkipConfigure - Configure the Container Apps Patch skip option by patch name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - patchName - The name of the patch +// - patchSkipConfig - Configure patcher to skip a patch or not. +// - options - ContainerAppsPatchesClientBeginSkipConfigureOptions contains the optional parameters for the ContainerAppsPatchesClient.BeginSkipConfigure +// method. +func (client *ContainerAppsPatchesClient) BeginSkipConfigure(ctx context.Context, resourceGroupName string, patchName string, patchSkipConfig PatchSkipConfig, options *ContainerAppsPatchesClientBeginSkipConfigureOptions) (*runtime.Poller[ContainerAppsPatchesClientSkipConfigureResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.skipConfigure(ctx, resourceGroupName, patchName, patchSkipConfig, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerAppsPatchesClientSkipConfigureResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ContainerAppsPatchesClientSkipConfigureResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// SkipConfigure - Configure the Container Apps Patch skip option by patch name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-02-preview +func (client *ContainerAppsPatchesClient) skipConfigure(ctx context.Context, resourceGroupName string, patchName string, patchSkipConfig PatchSkipConfig, options *ContainerAppsPatchesClientBeginSkipConfigureOptions) (*http.Response, error) { + var err error + const operationName = "ContainerAppsPatchesClient.BeginSkipConfigure" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.skipConfigureCreateRequest(ctx, resourceGroupName, patchName, patchSkipConfig, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// skipConfigureCreateRequest creates the SkipConfigure request. +func (client *ContainerAppsPatchesClient) skipConfigureCreateRequest(ctx context.Context, resourceGroupName string, patchName string, patchSkipConfig PatchSkipConfig, options *ContainerAppsPatchesClientBeginSkipConfigureOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/skipConfig" + 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 client.containerAppName == "" { + return nil, errors.New("parameter client.containerAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(client.containerAppName)) + if patchName == "" { + return nil, errors.New("parameter patchName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{patchName}", url.PathEscape(patchName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-02-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, patchSkipConfig); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go index 2ec564244f46..35a2f8f86186 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go @@ -46,7 +46,7 @@ func NewContainerAppsRevisionReplicasClient(subscriptionID string, credential az // GetReplica - Get a replica for a Container App Revision. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - revisionName - Name of the Container App Revision. @@ -103,7 +103,7 @@ func (client *ContainerAppsRevisionReplicasClient) getReplicaCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -121,7 +121,7 @@ func (client *ContainerAppsRevisionReplicasClient) getReplicaHandleResponse(resp // ListReplicas - List replicas for a Container App Revision. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - revisionName - Name of the Container App Revision. @@ -173,7 +173,7 @@ func (client *ContainerAppsRevisionReplicasClient) listReplicasCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client_example_test.go deleted file mode 100644 index 44e50ca69f67..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client_example_test.go +++ /dev/null @@ -1,109 +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 armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Replicas_Get.json -func ExampleContainerAppsRevisionReplicasClient_GetReplica() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsRevisionReplicasClient().GetReplica(ctx, "workerapps-rg-xj", "myapp", "myapp--0wlqy09", "myapp--0wlqy09-5d9774cff-5wnd8", 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.Replica = armappcontainers.Replica{ - // Name: to.Ptr("myapp--0wlqy09-5d9774cff-5wnd8"), - // Type: to.Ptr("Microsoft.Web/containerapps/revisions/replicas"), - // ID: to.Ptr("/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.App/containerApps/myapp/revisions/myapp--0wlqy09/replicas/myapp--0wlqy09-5d9774cff-5wnd8"), - // Properties: &armappcontainers.ReplicaProperties{ - // Containers: []*armappcontainers.ReplicaContainer{ - // { - // Name: to.Ptr("hello92"), - // ContainerID: to.Ptr("containerd://6bac7bb3afed1c704b5fe563c34c0ecf59ac30c766bb73488f7fa552dc42ee54"), - // ExecEndpoint: to.Ptr("testExecEndpoint"), - // LogStreamEndpoint: to.Ptr("testLogStreamEndpoint"), - // Ready: to.Ptr(true), - // RestartCount: to.Ptr[int32](0), - // RunningState: to.Ptr(armappcontainers.ContainerAppContainerRunningStateRunning), - // RunningStateDetails: to.Ptr("testDetail"), - // Started: to.Ptr(true), - // }}, - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-25T19:42:45.000Z"); return t}()), - // InitContainers: []*armappcontainers.ReplicaContainer{ - // }, - // RunningState: to.Ptr(armappcontainers.ContainerAppReplicaRunningStateRunning), - // RunningStateDetails: to.Ptr("testDetail"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Replicas_List.json -func ExampleContainerAppsRevisionReplicasClient_ListReplicas() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsRevisionReplicasClient().ListReplicas(ctx, "workerapps-rg-xj", "myapp", "myapp--0wlqy09", 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.ReplicaCollection = armappcontainers.ReplicaCollection{ - // Value: []*armappcontainers.Replica{ - // { - // Name: to.Ptr("myapp--0wlqy09-5d9774cff-5wnd8"), - // Type: to.Ptr("Microsoft.Web/containerapps/revisions/replicas"), - // ID: to.Ptr("/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.App/containerApps/myapp/revisions/myapp--0wlqy09/replicas/myapp--0wlqy09-5d9774cff-5wnd8"), - // Properties: &armappcontainers.ReplicaProperties{ - // Containers: []*armappcontainers.ReplicaContainer{ - // { - // Name: to.Ptr("hello92"), - // ContainerID: to.Ptr("containerd://6bac7bb3afed1c704b5fe563c34c0ecf59ac30c766bb73488f7fa552dc42ee54"), - // ExecEndpoint: to.Ptr("testExecEndpoint"), - // LogStreamEndpoint: to.Ptr("testLogStreamEndpoint"), - // Ready: to.Ptr(true), - // RestartCount: to.Ptr[int32](0), - // RunningState: to.Ptr(armappcontainers.ContainerAppContainerRunningStateRunning), - // RunningStateDetails: to.Ptr("testDetail"), - // Started: to.Ptr(true), - // }}, - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-25T19:42:45.000Z"); return t}()), - // InitContainers: []*armappcontainers.ReplicaContainer{ - // }, - // RunningState: to.Ptr(armappcontainers.ContainerAppReplicaRunningStateRunning), - // RunningStateDetails: to.Ptr("testDetail"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client.go index f98a95a6aa2c..e3342c033414 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client.go @@ -46,7 +46,7 @@ func NewContainerAppsRevisionsClient(subscriptionID string, credential azcore.To // ActivateRevision - Activates a revision for a Container App // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - revisionName - Name of the Container App Revision. @@ -97,7 +97,7 @@ func (client *ContainerAppsRevisionsClient) activateRevisionCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +106,7 @@ func (client *ContainerAppsRevisionsClient) activateRevisionCreateRequest(ctx co // DeactivateRevision - Deactivates a revision for a Container App // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - revisionName - Name of the Container App Revision. @@ -157,7 +157,7 @@ func (client *ContainerAppsRevisionsClient) deactivateRevisionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -166,7 +166,7 @@ func (client *ContainerAppsRevisionsClient) deactivateRevisionCreateRequest(ctx // GetRevision - Get a revision of a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - revisionName - Name of the Container App Revision. @@ -218,7 +218,7 @@ func (client *ContainerAppsRevisionsClient) getRevisionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,7 +235,7 @@ func (client *ContainerAppsRevisionsClient) getRevisionHandleResponse(resp *http // NewListRevisionsPager - Get the Revisions for a given Container App. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App for which Revisions are needed. // - options - ContainerAppsRevisionsClientListRevisionsOptions contains the optional parameters for the ContainerAppsRevisionsClient.NewListRevisionsPager @@ -286,7 +286,7 @@ func (client *ContainerAppsRevisionsClient) listRevisionsCreateRequest(ctx conte if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,7 +304,7 @@ func (client *ContainerAppsRevisionsClient) listRevisionsHandleResponse(resp *ht // RestartRevision - Restarts a revision for a Container App // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - revisionName - Name of the Container App Revision. @@ -355,7 +355,7 @@ func (client *ContainerAppsRevisionsClient) restartRevisionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client_example_test.go deleted file mode 100644 index cb1bbb9f47ea..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client_example_test.go +++ /dev/null @@ -1,192 +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 armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_List.json -func ExampleContainerAppsRevisionsClient_NewListRevisionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewContainerAppsRevisionsClient().NewListRevisionsPager("rg", "testcontainerApp0", &armappcontainers.ContainerAppsRevisionsClientListRevisionsOptions{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.RevisionCollection = armappcontainers.RevisionCollection{ - // Value: []*armappcontainers.Revision{ - // { - // Name: to.Ptr("testcontainerApp0-pjxhsye"), - // Type: to.Ptr("Microsoft.App/containerApps/revisions"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0/revisions/testcontainerApp0-pjxhsye"), - // Properties: &armappcontainers.RevisionProperties{ - // Active: to.Ptr(true), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-24T21:24:22.000Z"); return t}()), - // Fqdn: to.Ptr("testcontainerApp0-pjxhsye.politehill-ab123456.eastus.azurecontainerapps.io"), - // LastActiveTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-24T21:24:22.000Z"); return t}()), - // Replicas: to.Ptr[int32](1), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v2"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // }, - // TrafficWeight: to.Ptr[int32](80), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Get.json -func ExampleContainerAppsRevisionsClient_GetRevision() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsRevisionsClient().GetRevision(ctx, "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", 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.Revision = armappcontainers.Revision{ - // Name: to.Ptr("testcontainerApp0-pjxhsye"), - // Type: to.Ptr("Microsoft.App/containerApps/revisions"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppcontainerApps/testcontainerApp0/revisions/testcontainerApp0-pjxhsye"), - // Properties: &armappcontainers.RevisionProperties{ - // Active: to.Ptr(true), - // CreatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-24T21:24:22.000Z"); return t}()), - // Fqdn: to.Ptr("testcontainerApp0-pjxhsye.politehill-ab123456.eastus.azurecontainerapps.io"), - // LastActiveTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-05-24T21:24:22.000Z"); return t}()), - // Replicas: to.Ptr[int32](1), - // RunningState: to.Ptr(armappcontainers.RevisionRunningStateRunning), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerApp0:v2"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // }, - // TrafficWeight: to.Ptr[int32](80), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Activate.json -func ExampleContainerAppsRevisionsClient_ActivateRevision() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewContainerAppsRevisionsClient().ActivateRevision(ctx, "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", 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/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Deactivate.json -func ExampleContainerAppsRevisionsClient_DeactivateRevision() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewContainerAppsRevisionsClient().DeactivateRevision(ctx, "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", 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/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Revisions_Restart.json -func ExampleContainerAppsRevisionsClient_RestartRevision() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewContainerAppsRevisionsClient().RestartRevision(ctx, "rg", "testStaticSite0", "testcontainerApp0-pjxhsye", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go index 069fd6fba78e..fba66be2ffd9 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go @@ -46,7 +46,7 @@ func NewContainerAppsSourceControlsClient(subscriptionID string, credential azco // BeginCreateOrUpdate - Create or update the SourceControl for a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - sourceControlName - Name of the Container App SourceControl. @@ -73,7 +73,7 @@ func (client *ContainerAppsSourceControlsClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Create or update the SourceControl for a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ContainerAppsSourceControlsClient) createOrUpdate(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, sourceControlEnvelope SourceControl, options *ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ContainerAppsSourceControlsClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *ContainerAppsSourceControlsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, sourceControlEnvelope); err != nil { @@ -131,7 +131,7 @@ func (client *ContainerAppsSourceControlsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Delete a Container App SourceControl. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - sourceControlName - Name of the Container App SourceControl. @@ -157,7 +157,7 @@ func (client *ContainerAppsSourceControlsClient) BeginDelete(ctx context.Context // Delete - Delete a Container App SourceControl. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ContainerAppsSourceControlsClient) deleteOperation(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, options *ContainerAppsSourceControlsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ContainerAppsSourceControlsClient.BeginDelete" @@ -203,7 +203,7 @@ func (client *ContainerAppsSourceControlsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *ContainerAppsSourceControlsClient) deleteCreateRequest(ctx context // Get - Get a SourceControl of a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - sourceControlName - Name of the Container App SourceControl. @@ -264,7 +264,7 @@ func (client *ContainerAppsSourceControlsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +281,7 @@ func (client *ContainerAppsSourceControlsClient) getHandleResponse(resp *http.Re // NewListByContainerAppPager - Get the Container App SourceControls in a given resource group. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - containerAppName - Name of the Container App. // - options - ContainerAppsSourceControlsClientListByContainerAppOptions contains the optional parameters for the ContainerAppsSourceControlsClient.NewListByContainerAppPager @@ -329,7 +329,7 @@ func (client *ContainerAppsSourceControlsClient) listByContainerAppCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client_example_test.go deleted file mode 100644 index e50b5967744c..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client_example_test.go +++ /dev/null @@ -1,221 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/SourceControls_ListByContainer.json -func ExampleContainerAppsSourceControlsClient_NewListByContainerAppPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewContainerAppsSourceControlsClient().NewListByContainerAppPager("workerapps-rg-xj", "testcanadacentral", 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.SourceControlCollection = armappcontainers.SourceControlCollection{ - // Value: []*armappcontainers.SourceControl{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.App/containerapps/sourcecontrols"), - // ID: to.Ptr("/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.App/containerApps/testcanadacentral/sourcecontrols/current"), - // Properties: &armappcontainers.SourceControlProperties{ - // Branch: to.Ptr("master"), - // GithubActionConfiguration: &armappcontainers.GithubActionConfiguration{ - // BuildEnvironmentVariables: []*armappcontainers.EnvironmentVariable{ - // { - // Name: to.Ptr("foo1"), - // Value: to.Ptr("bar1"), - // }, - // { - // Name: to.Ptr("foo2"), - // Value: to.Ptr("bar2"), - // }}, - // ContextPath: to.Ptr("./"), - // Image: to.Ptr("image/tag"), - // RegistryInfo: &armappcontainers.RegistryInfo{ - // RegistryURL: to.Ptr("xwang971reg.azurecr.io"), - // RegistryUserName: to.Ptr("xwang971reg"), - // }, - // }, - // RepoURL: to.Ptr("https://github.com/xwang971/ghatest"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/SourceControls_Get.json -func ExampleContainerAppsSourceControlsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContainerAppsSourceControlsClient().Get(ctx, "workerapps-rg-xj", "testcanadacentral", "current", 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.SourceControl = armappcontainers.SourceControl{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.App/containerapps/sourcecontrols"), - // ID: to.Ptr("/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.App/containerApps/testcanadacentral/sourcecontrols/current"), - // Properties: &armappcontainers.SourceControlProperties{ - // Branch: to.Ptr("master"), - // GithubActionConfiguration: &armappcontainers.GithubActionConfiguration{ - // BuildEnvironmentVariables: []*armappcontainers.EnvironmentVariable{ - // { - // Name: to.Ptr("foo1"), - // Value: to.Ptr("bar1"), - // }, - // { - // Name: to.Ptr("foo2"), - // Value: to.Ptr("bar2"), - // }}, - // ContextPath: to.Ptr("./"), - // Image: to.Ptr("image/tag"), - // RegistryInfo: &armappcontainers.RegistryInfo{ - // RegistryURL: to.Ptr("xwang971reg.azurecr.io"), - // RegistryUserName: to.Ptr("xwang971reg"), - // }, - // }, - // RepoURL: to.Ptr("https://github.com/xwang971/ghatest"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/SourceControls_CreateOrUpdate.json -func ExampleContainerAppsSourceControlsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewContainerAppsSourceControlsClient().BeginCreateOrUpdate(ctx, "workerapps-rg-xj", "testcanadacentral", "current", armappcontainers.SourceControl{ - Properties: &armappcontainers.SourceControlProperties{ - Branch: to.Ptr("master"), - GithubActionConfiguration: &armappcontainers.GithubActionConfiguration{ - AzureCredentials: &armappcontainers.AzureCredentials{ - ClientID: to.Ptr(""), - ClientSecret: to.Ptr(""), - Kind: to.Ptr("feaderated"), - TenantID: to.Ptr(""), - }, - BuildEnvironmentVariables: []*armappcontainers.EnvironmentVariable{ - { - Name: to.Ptr("foo1"), - Value: to.Ptr("bar1"), - }, - { - Name: to.Ptr("foo2"), - Value: to.Ptr("bar2"), - }}, - ContextPath: to.Ptr("./"), - GithubPersonalAccessToken: to.Ptr("test"), - Image: to.Ptr("image/tag"), - RegistryInfo: &armappcontainers.RegistryInfo{ - RegistryPassword: to.Ptr(""), - RegistryURL: to.Ptr("test-registry.azurecr.io"), - RegistryUserName: to.Ptr("test-registry"), - }, - }, - RepoURL: to.Ptr("https://github.com/xwang971/ghatest"), - }, - }, 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.SourceControl = armappcontainers.SourceControl{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.App/containerapps/sourcecontrols"), - // ID: to.Ptr("/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/providers/Microsoft.App/containerApps/myapp/sourcecontrols/current"), - // Properties: &armappcontainers.SourceControlProperties{ - // Branch: to.Ptr("master"), - // GithubActionConfiguration: &armappcontainers.GithubActionConfiguration{ - // BuildEnvironmentVariables: []*armappcontainers.EnvironmentVariable{ - // { - // Name: to.Ptr("foo1"), - // Value: to.Ptr("bar1"), - // }, - // { - // Name: to.Ptr("foo2"), - // Value: to.Ptr("bar2"), - // }}, - // ContextPath: to.Ptr("./"), - // Image: to.Ptr("image/tag"), - // RegistryInfo: &armappcontainers.RegistryInfo{ - // RegistryURL: to.Ptr("test-registry.azurecr.io"), - // RegistryUserName: to.Ptr("testreg"), - // }, - // }, - // OperationState: to.Ptr(armappcontainers.SourceControlOperationStateInProgress), - // RepoURL: to.Ptr("https://github.com/xwang971/ghatest"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/SourceControls_Delete.json -func ExampleContainerAppsSourceControlsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewContainerAppsSourceControlsClient().BeginDelete(ctx, "workerapps-rg-xj", "testcanadacentral", "current", 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/appcontainers/armappcontainers/daprcomponentresiliencypolicies_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponentresiliencypolicies_client.go index afe372fbb121..0f334b8363cb 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponentresiliencypolicies_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponentresiliencypolicies_client.go @@ -46,7 +46,7 @@ func NewDaprComponentResiliencyPoliciesClient(subscriptionID string, credential // CreateOrUpdate - Creates or updates a resiliency policy for a Dapr component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - componentName - Name of the Dapr Component. @@ -104,7 +104,7 @@ func (client *DaprComponentResiliencyPoliciesClient) createOrUpdateCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, daprComponentResiliencyPolicyEnvelope); err != nil { @@ -125,7 +125,7 @@ func (client *DaprComponentResiliencyPoliciesClient) createOrUpdateHandleRespons // Delete - Delete a resiliency policy for a Dapr component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - componentName - Name of the Dapr Component. @@ -181,7 +181,7 @@ func (client *DaprComponentResiliencyPoliciesClient) deleteCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *DaprComponentResiliencyPoliciesClient) deleteCreateRequest(ctx con // Get - Get a Dapr component resiliency policy. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - componentName - Name of the Dapr Component. @@ -247,7 +247,7 @@ func (client *DaprComponentResiliencyPoliciesClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,7 +264,7 @@ func (client *DaprComponentResiliencyPoliciesClient) getHandleResponse(resp *htt // NewListPager - Get the resiliency policies for a Dapr component. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - componentName - Name of the Dapr Component. @@ -317,7 +317,7 @@ func (client *DaprComponentResiliencyPoliciesClient) listCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponentresiliencypolicies_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponentresiliencypolicies_client_example_test.go deleted file mode 100644 index 91ee41e5566d..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponentresiliencypolicies_client_example_test.go +++ /dev/null @@ -1,392 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicies_List.json -func ExampleDaprComponentResiliencyPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDaprComponentResiliencyPoliciesClient().NewListPager("examplerg", "myenvironment", "mydaprcomponent", 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.DaprComponentResiliencyPoliciesCollection = armappcontainers.DaprComponentResiliencyPoliciesCollection{ - // Value: []*armappcontainers.DaprComponentResiliencyPolicy{ - // { - // Name: to.Ptr("something"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprComponents/resiliencyPolicies"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprComponents/mydaprcomponent/resiliencyPolicies/myresiliencypolicy"), - // Properties: &armappcontainers.DaprComponentResiliencyPolicyProperties{ - // InboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - // CircuitBreakerPolicy: &armappcontainers.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration{ - // ConsecutiveErrors: to.Ptr[int32](5), - // TimeoutInSeconds: to.Ptr[int32](10), - // }, - // HTTPRetryPolicy: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration{ - // MaxRetries: to.Ptr[int32](15), - // RetryBackOff: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration{ - // InitialDelayInMilliseconds: to.Ptr[int32](2000), - // MaxIntervalInMilliseconds: to.Ptr[int32](5500), - // }, - // }, - // TimeoutPolicy: &armappcontainers.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration{ - // ResponseTimeoutInSeconds: to.Ptr[int32](30), - // }, - // }, - // OutboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - // CircuitBreakerPolicy: &armappcontainers.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration{ - // ConsecutiveErrors: to.Ptr[int32](3), - // IntervalInSeconds: to.Ptr[int32](60), - // TimeoutInSeconds: to.Ptr[int32](20), - // }, - // HTTPRetryPolicy: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration{ - // MaxRetries: to.Ptr[int32](5), - // RetryBackOff: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration{ - // InitialDelayInMilliseconds: to.Ptr[int32](100), - // MaxIntervalInMilliseconds: to.Ptr[int32](30000), - // }, - // }, - // TimeoutPolicy: &armappcontainers.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration{ - // ResponseTimeoutInSeconds: to.Ptr[int32](12), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicies_Get.json -func ExampleDaprComponentResiliencyPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprComponentResiliencyPoliciesClient().Get(ctx, "examplerg", "myenvironment", "mydaprcomponent", "myresiliencypolicy", 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.DaprComponentResiliencyPolicy = armappcontainers.DaprComponentResiliencyPolicy{ - // Name: to.Ptr("myresiliencypolicy"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprComponents/resiliencyPolicies"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprComponents/mydaprcomponent/resiliencyPolicies/myresiliencypolicy"), - // Properties: &armappcontainers.DaprComponentResiliencyPolicyProperties{ - // InboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - // CircuitBreakerPolicy: &armappcontainers.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration{ - // ConsecutiveErrors: to.Ptr[int32](5), - // TimeoutInSeconds: to.Ptr[int32](10), - // }, - // HTTPRetryPolicy: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration{ - // MaxRetries: to.Ptr[int32](15), - // RetryBackOff: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration{ - // InitialDelayInMilliseconds: to.Ptr[int32](2000), - // MaxIntervalInMilliseconds: to.Ptr[int32](5500), - // }, - // }, - // TimeoutPolicy: &armappcontainers.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration{ - // ResponseTimeoutInSeconds: to.Ptr[int32](30), - // }, - // }, - // OutboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - // CircuitBreakerPolicy: &armappcontainers.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration{ - // ConsecutiveErrors: to.Ptr[int32](3), - // IntervalInSeconds: to.Ptr[int32](60), - // TimeoutInSeconds: to.Ptr[int32](20), - // }, - // HTTPRetryPolicy: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration{ - // MaxRetries: to.Ptr[int32](5), - // RetryBackOff: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration{ - // InitialDelayInMilliseconds: to.Ptr[int32](100), - // MaxIntervalInMilliseconds: to.Ptr[int32](30000), - // }, - // }, - // TimeoutPolicy: &armappcontainers.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration{ - // ResponseTimeoutInSeconds: to.Ptr[int32](12), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_AllOptions.json -func ExampleDaprComponentResiliencyPoliciesClient_CreateOrUpdate_createOrUpdateDaprComponentResiliencyPolicyWithAllOptions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprComponentResiliencyPoliciesClient().CreateOrUpdate(ctx, "examplerg", "myenvironment", "mydaprcomponent", "myresiliencypolicy", armappcontainers.DaprComponentResiliencyPolicy{ - Properties: &armappcontainers.DaprComponentResiliencyPolicyProperties{ - InboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - CircuitBreakerPolicy: &armappcontainers.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration{ - ConsecutiveErrors: to.Ptr[int32](5), - IntervalInSeconds: to.Ptr[int32](4), - TimeoutInSeconds: to.Ptr[int32](10), - }, - HTTPRetryPolicy: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration{ - MaxRetries: to.Ptr[int32](15), - RetryBackOff: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration{ - InitialDelayInMilliseconds: to.Ptr[int32](2000), - MaxIntervalInMilliseconds: to.Ptr[int32](5500), - }, - }, - TimeoutPolicy: &armappcontainers.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration{ - ResponseTimeoutInSeconds: to.Ptr[int32](30), - }, - }, - OutboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - CircuitBreakerPolicy: &armappcontainers.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration{ - ConsecutiveErrors: to.Ptr[int32](3), - IntervalInSeconds: to.Ptr[int32](60), - TimeoutInSeconds: to.Ptr[int32](20), - }, - HTTPRetryPolicy: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration{ - MaxRetries: to.Ptr[int32](5), - RetryBackOff: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration{ - InitialDelayInMilliseconds: to.Ptr[int32](100), - MaxIntervalInMilliseconds: to.Ptr[int32](30000), - }, - }, - TimeoutPolicy: &armappcontainers.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration{ - ResponseTimeoutInSeconds: to.Ptr[int32](12), - }, - }, - }, - }, 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.DaprComponentResiliencyPolicy = armappcontainers.DaprComponentResiliencyPolicy{ - // Name: to.Ptr("myresiliencypolicy"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprComponents/resiliencyPolicies"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprComponents/mydaprcomponent/resiliencyPolicies/myresiliencypolicy"), - // Properties: &armappcontainers.DaprComponentResiliencyPolicyProperties{ - // InboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - // CircuitBreakerPolicy: &armappcontainers.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration{ - // ConsecutiveErrors: to.Ptr[int32](5), - // IntervalInSeconds: to.Ptr[int32](4), - // TimeoutInSeconds: to.Ptr[int32](10), - // }, - // HTTPRetryPolicy: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration{ - // MaxRetries: to.Ptr[int32](15), - // RetryBackOff: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration{ - // InitialDelayInMilliseconds: to.Ptr[int32](2000), - // MaxIntervalInMilliseconds: to.Ptr[int32](5500), - // }, - // }, - // TimeoutPolicy: &armappcontainers.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration{ - // ResponseTimeoutInSeconds: to.Ptr[int32](30), - // }, - // }, - // OutboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - // CircuitBreakerPolicy: &armappcontainers.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration{ - // ConsecutiveErrors: to.Ptr[int32](3), - // IntervalInSeconds: to.Ptr[int32](60), - // TimeoutInSeconds: to.Ptr[int32](20), - // }, - // HTTPRetryPolicy: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration{ - // MaxRetries: to.Ptr[int32](5), - // RetryBackOff: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration{ - // InitialDelayInMilliseconds: to.Ptr[int32](100), - // MaxIntervalInMilliseconds: to.Ptr[int32](30000), - // }, - // }, - // TimeoutPolicy: &armappcontainers.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration{ - // ResponseTimeoutInSeconds: to.Ptr[int32](12), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_OutboundOnly.json -func ExampleDaprComponentResiliencyPoliciesClient_CreateOrUpdate_createOrUpdateDaprComponentResiliencyPolicyWithOutboundPolicyOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprComponentResiliencyPoliciesClient().CreateOrUpdate(ctx, "examplerg", "myenvironment", "mydaprcomponent", "myresiliencypolicy", armappcontainers.DaprComponentResiliencyPolicy{ - Properties: &armappcontainers.DaprComponentResiliencyPolicyProperties{ - OutboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - CircuitBreakerPolicy: &armappcontainers.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration{ - ConsecutiveErrors: to.Ptr[int32](3), - IntervalInSeconds: to.Ptr[int32](60), - TimeoutInSeconds: to.Ptr[int32](20), - }, - HTTPRetryPolicy: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration{ - MaxRetries: to.Ptr[int32](5), - RetryBackOff: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration{ - InitialDelayInMilliseconds: to.Ptr[int32](100), - MaxIntervalInMilliseconds: to.Ptr[int32](30000), - }, - }, - TimeoutPolicy: &armappcontainers.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration{ - ResponseTimeoutInSeconds: to.Ptr[int32](12), - }, - }, - }, - }, 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.DaprComponentResiliencyPolicy = armappcontainers.DaprComponentResiliencyPolicy{ - // Name: to.Ptr("myresiliencypolicy"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprComponents/resiliencyPolicies"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprComponents/mydaprcomponent/resiliencyPolicies/myresiliencypolicy"), - // Properties: &armappcontainers.DaprComponentResiliencyPolicyProperties{ - // OutboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - // CircuitBreakerPolicy: &armappcontainers.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration{ - // ConsecutiveErrors: to.Ptr[int32](3), - // IntervalInSeconds: to.Ptr[int32](60), - // TimeoutInSeconds: to.Ptr[int32](20), - // }, - // HTTPRetryPolicy: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration{ - // MaxRetries: to.Ptr[int32](5), - // RetryBackOff: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration{ - // InitialDelayInMilliseconds: to.Ptr[int32](100), - // MaxIntervalInMilliseconds: to.Ptr[int32](30000), - // }, - // }, - // TimeoutPolicy: &armappcontainers.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration{ - // ResponseTimeoutInSeconds: to.Ptr[int32](12), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_SparseOptions.json -func ExampleDaprComponentResiliencyPoliciesClient_CreateOrUpdate_createOrUpdateDaprComponentResiliencyPolicyWithSparseOptions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprComponentResiliencyPoliciesClient().CreateOrUpdate(ctx, "examplerg", "myenvironment", "mydaprcomponent", "myresiliencypolicy", armappcontainers.DaprComponentResiliencyPolicy{ - Properties: &armappcontainers.DaprComponentResiliencyPolicyProperties{ - InboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - CircuitBreakerPolicy: &armappcontainers.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration{ - ConsecutiveErrors: to.Ptr[int32](3), - TimeoutInSeconds: to.Ptr[int32](20), - }, - HTTPRetryPolicy: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration{ - MaxRetries: to.Ptr[int32](5), - RetryBackOff: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration{ - InitialDelayInMilliseconds: to.Ptr[int32](2000), - MaxIntervalInMilliseconds: to.Ptr[int32](5500), - }, - }, - }, - OutboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - TimeoutPolicy: &armappcontainers.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration{ - ResponseTimeoutInSeconds: to.Ptr[int32](12), - }, - }, - }, - }, 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.DaprComponentResiliencyPolicy = armappcontainers.DaprComponentResiliencyPolicy{ - // Name: to.Ptr("myresiliencypolicy"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprComponents/resiliencyPolicies"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprComponents/mydaprcomponent/resiliencyPolicies/myresiliencypolicy"), - // Properties: &armappcontainers.DaprComponentResiliencyPolicyProperties{ - // InboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - // CircuitBreakerPolicy: &armappcontainers.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration{ - // ConsecutiveErrors: to.Ptr[int32](3), - // TimeoutInSeconds: to.Ptr[int32](20), - // }, - // HTTPRetryPolicy: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration{ - // MaxRetries: to.Ptr[int32](5), - // RetryBackOff: &armappcontainers.DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration{ - // InitialDelayInMilliseconds: to.Ptr[int32](2000), - // MaxIntervalInMilliseconds: to.Ptr[int32](5500), - // }, - // }, - // }, - // OutboundPolicy: &armappcontainers.DaprComponentResiliencyPolicyConfiguration{ - // TimeoutPolicy: &armappcontainers.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration{ - // ResponseTimeoutInSeconds: to.Ptr[int32](12), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponentResiliencyPolicies_Delete.json -func ExampleDaprComponentResiliencyPoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDaprComponentResiliencyPoliciesClient().Delete(ctx, "examplerg", "myenvironment", "mydaprcomponent", "myresiliencypolicy", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client.go index 722d83793b91..124477e1534d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client.go @@ -46,7 +46,7 @@ func NewDaprComponentsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Creates or updates a Dapr Component in a Managed Environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - componentName - Name of the Dapr Component. @@ -99,7 +99,7 @@ func (client *DaprComponentsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, daprComponentEnvelope); err != nil { @@ -120,7 +120,7 @@ func (client *DaprComponentsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Delete a Dapr Component from a Managed Environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - componentName - Name of the Dapr Component. @@ -170,7 +170,7 @@ func (client *DaprComponentsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -179,7 +179,7 @@ func (client *DaprComponentsClient) deleteCreateRequest(ctx context.Context, res // Get - Get a dapr component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - componentName - Name of the Dapr Component. @@ -230,7 +230,7 @@ func (client *DaprComponentsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,7 +247,7 @@ func (client *DaprComponentsClient) getHandleResponse(resp *http.Response) (Dapr // NewListPager - Get the Dapr Components for a managed environment. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - options - DaprComponentsClientListOptions contains the optional parameters for the DaprComponentsClient.NewListPager method. @@ -294,7 +294,7 @@ func (client *DaprComponentsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -312,7 +312,7 @@ func (client *DaprComponentsClient) listHandleResponse(resp *http.Response) (Dap // ListSecrets - List secrets for a dapr component // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - componentName - Name of the Dapr Component. @@ -364,7 +364,7 @@ func (client *DaprComponentsClient) listSecretsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client_example_test.go deleted file mode 100644 index 92e938630cc6..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client_example_test.go +++ /dev/null @@ -1,547 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_List.json -func ExampleDaprComponentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDaprComponentsClient().NewListPager("examplerg", "myenvironment", 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.DaprComponentsCollection = armappcontainers.DaprComponentsCollection{ - // Value: []*armappcontainers.DaprComponent{ - // { - // Name: to.Ptr("reddog"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprcomponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprcomponents/reddog"), - // Properties: &armappcontainers.DaprComponentProperties{ - // ComponentType: to.Ptr("state.azure.cosmosdb"), - // IgnoreErrors: to.Ptr(false), - // InitTimeout: to.Ptr("50s"), - // Metadata: []*armappcontainers.DaprMetadata{ - // { - // Name: to.Ptr("url"), - // Value: to.Ptr(""), - // }, - // { - // Name: to.Ptr("database"), - // Value: to.Ptr("itemsDB"), - // }, - // { - // Name: to.Ptr("collection"), - // Value: to.Ptr("items"), - // }, - // { - // Name: to.Ptr("masterkey"), - // SecretRef: to.Ptr("masterkey"), - // }}, - // Scopes: []*string{ - // to.Ptr("container-app-1"), - // to.Ptr("container-app-2")}, - // Secrets: []*armappcontainers.Secret{ - // { - // Name: to.Ptr("masterkey"), - // }}, - // ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - // { - // Name: to.Ptr("statestore"), - // Metadata: &armappcontainers.DaprServiceBindMetadata{ - // Name: to.Ptr("daprcomponentBind"), - // Value: to.Ptr("redis-bind"), - // }, - // ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - // }}, - // Version: to.Ptr("v1"), - // }, - // }, - // { - // Name: to.Ptr("vaultdog"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprcomponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprcomponents/vaultdog"), - // Properties: &armappcontainers.DaprComponentProperties{ - // ComponentType: to.Ptr("state.azure.cosmosdb"), - // IgnoreErrors: to.Ptr(false), - // InitTimeout: to.Ptr("50s"), - // Metadata: []*armappcontainers.DaprMetadata{ - // { - // Name: to.Ptr("url"), - // Value: to.Ptr(""), - // }, - // { - // Name: to.Ptr("database"), - // Value: to.Ptr("itemsDB"), - // }, - // { - // Name: to.Ptr("collection"), - // Value: to.Ptr("items"), - // }, - // { - // Name: to.Ptr("masterkey"), - // SecretRef: to.Ptr("masterkey"), - // }}, - // Scopes: []*string{ - // to.Ptr("container-app-1"), - // to.Ptr("container-app-2")}, - // SecretStoreComponent: to.Ptr("my-secret-store"), - // ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - // { - // Name: to.Ptr("statestore"), - // Metadata: &armappcontainers.DaprServiceBindMetadata{ - // Name: to.Ptr("daprcomponentBind"), - // Value: to.Ptr("redis-bind"), - // }, - // ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - // }}, - // Version: to.Ptr("v1"), - // }, - // }, - // { - // Name: to.Ptr("vaultdog"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprcomponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprcomponents/vaultdog"), - // Properties: &armappcontainers.DaprComponentProperties{ - // ComponentType: to.Ptr("state.azure.cosmosdb"), - // IgnoreErrors: to.Ptr(false), - // InitTimeout: to.Ptr("50s"), - // Metadata: []*armappcontainers.DaprMetadata{ - // { - // Name: to.Ptr("url"), - // SecretRef: to.Ptr("cosmosdb/url"), - // }, - // { - // Name: to.Ptr("database"), - // Value: to.Ptr("itemsDB"), - // }, - // { - // Name: to.Ptr("collection"), - // Value: to.Ptr("items"), - // }, - // { - // Name: to.Ptr("masterkey"), - // SecretRef: to.Ptr("cosmosdb/masterkey"), - // }}, - // Scopes: []*string{ - // to.Ptr("container-app-1"), - // to.Ptr("container-app-2")}, - // SecretStoreComponent: to.Ptr("my-secret-store"), - // ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - // { - // Name: to.Ptr("statestore"), - // Metadata: &armappcontainers.DaprServiceBindMetadata{ - // Name: to.Ptr("daprcomponentBind"), - // Value: to.Ptr("redis-bind"), - // }, - // ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - // }}, - // Version: to.Ptr("v1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_Get_SecretStoreComponent.json -func ExampleDaprComponentsClient_Get_getDaprComponentWithSecretStoreComponent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprComponentsClient().Get(ctx, "examplerg", "myenvironment", "reddog", 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.DaprComponent = armappcontainers.DaprComponent{ - // Name: to.Ptr("reddog"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprcomponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1/daprcomponents/reddog"), - // Properties: &armappcontainers.DaprComponentProperties{ - // ComponentType: to.Ptr("state.azure.cosmosdb"), - // IgnoreErrors: to.Ptr(false), - // InitTimeout: to.Ptr("50s"), - // Metadata: []*armappcontainers.DaprMetadata{ - // { - // Name: to.Ptr("url"), - // Value: to.Ptr(""), - // }, - // { - // Name: to.Ptr("database"), - // Value: to.Ptr("itemsDB"), - // }, - // { - // Name: to.Ptr("collection"), - // Value: to.Ptr("items"), - // }, - // { - // Name: to.Ptr("masterkey"), - // SecretRef: to.Ptr("masterkey"), - // }}, - // Scopes: []*string{ - // to.Ptr("container-app-1"), - // to.Ptr("container-app-2")}, - // SecretStoreComponent: to.Ptr("my-secret-store"), - // ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - // { - // Name: to.Ptr("statestore"), - // Metadata: &armappcontainers.DaprServiceBindMetadata{ - // Name: to.Ptr("daprcomponentBind"), - // Value: to.Ptr("redis-bind"), - // }, - // ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - // }}, - // Version: to.Ptr("v1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_Get_Secrets.json -func ExampleDaprComponentsClient_Get_getDaprComponentWithSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprComponentsClient().Get(ctx, "examplerg", "myenvironment", "reddog", 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.DaprComponent = armappcontainers.DaprComponent{ - // Name: to.Ptr("reddog"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprcomponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1/daprcomponents/reddog"), - // Properties: &armappcontainers.DaprComponentProperties{ - // ComponentType: to.Ptr("state.azure.cosmosdb"), - // IgnoreErrors: to.Ptr(false), - // InitTimeout: to.Ptr("50s"), - // Metadata: []*armappcontainers.DaprMetadata{ - // { - // Name: to.Ptr("url"), - // Value: to.Ptr(""), - // }, - // { - // Name: to.Ptr("database"), - // Value: to.Ptr("itemsDB"), - // }, - // { - // Name: to.Ptr("collection"), - // Value: to.Ptr("items"), - // }, - // { - // Name: to.Ptr("masterkey"), - // SecretRef: to.Ptr("masterkey"), - // }}, - // Scopes: []*string{ - // to.Ptr("container-app-1"), - // to.Ptr("container-app-2")}, - // Secrets: []*armappcontainers.Secret{ - // { - // Name: to.Ptr("masterkey"), - // }}, - // ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - // { - // Name: to.Ptr("statestore"), - // Metadata: &armappcontainers.DaprServiceBindMetadata{ - // Name: to.Ptr("daprcomponentBind"), - // Value: to.Ptr("redis-bind"), - // }, - // ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - // }}, - // Version: to.Ptr("v1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json -func ExampleDaprComponentsClient_CreateOrUpdate_createOrUpdateDaprComponentWithSecretStoreComponent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprComponentsClient().CreateOrUpdate(ctx, "examplerg", "myenvironment", "reddog", armappcontainers.DaprComponent{ - Properties: &armappcontainers.DaprComponentProperties{ - ComponentType: to.Ptr("state.azure.cosmosdb"), - IgnoreErrors: to.Ptr(false), - InitTimeout: to.Ptr("50s"), - Metadata: []*armappcontainers.DaprMetadata{ - { - Name: to.Ptr("url"), - Value: to.Ptr(""), - }, - { - Name: to.Ptr("database"), - Value: to.Ptr("itemsDB"), - }, - { - Name: to.Ptr("collection"), - Value: to.Ptr("items"), - }, - { - Name: to.Ptr("masterkey"), - SecretRef: to.Ptr("masterkey"), - }}, - Scopes: []*string{ - to.Ptr("container-app-1"), - to.Ptr("container-app-2")}, - SecretStoreComponent: to.Ptr("my-secret-store"), - ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - { - Name: to.Ptr("statestore"), - Metadata: &armappcontainers.DaprServiceBindMetadata{ - Name: to.Ptr("daprcomponentBind"), - Value: to.Ptr("redis-bind"), - }, - ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - }}, - Version: to.Ptr("v1"), - }, - }, 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.DaprComponent = armappcontainers.DaprComponent{ - // Name: to.Ptr("reddog"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprcomponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1/daprcomponents/reddog"), - // Properties: &armappcontainers.DaprComponentProperties{ - // ComponentType: to.Ptr("state.azure.cosmosdb"), - // IgnoreErrors: to.Ptr(false), - // InitTimeout: to.Ptr("50s"), - // Metadata: []*armappcontainers.DaprMetadata{ - // { - // Name: to.Ptr("url"), - // Value: to.Ptr(""), - // }, - // { - // Name: to.Ptr("database"), - // Value: to.Ptr("itemsDB"), - // }, - // { - // Name: to.Ptr("collection"), - // Value: to.Ptr("items"), - // }, - // { - // Name: to.Ptr("masterkey"), - // SecretRef: to.Ptr("masterkey"), - // }}, - // Scopes: []*string{ - // to.Ptr("container-app-1"), - // to.Ptr("container-app-2")}, - // SecretStoreComponent: to.Ptr("my-secret-store"), - // ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - // { - // Name: to.Ptr("statestore"), - // Metadata: &armappcontainers.DaprServiceBindMetadata{ - // Name: to.Ptr("daprcomponentBind"), - // Value: to.Ptr("redis-bind"), - // }, - // ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - // }}, - // Version: to.Ptr("v1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_CreateOrUpdate_Secrets.json -func ExampleDaprComponentsClient_CreateOrUpdate_createOrUpdateDaprComponentWithSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprComponentsClient().CreateOrUpdate(ctx, "examplerg", "myenvironment", "reddog", armappcontainers.DaprComponent{ - Properties: &armappcontainers.DaprComponentProperties{ - ComponentType: to.Ptr("state.azure.cosmosdb"), - IgnoreErrors: to.Ptr(false), - InitTimeout: to.Ptr("50s"), - Metadata: []*armappcontainers.DaprMetadata{ - { - Name: to.Ptr("url"), - Value: to.Ptr(""), - }, - { - Name: to.Ptr("database"), - Value: to.Ptr("itemsDB"), - }, - { - Name: to.Ptr("collection"), - Value: to.Ptr("items"), - }, - { - Name: to.Ptr("masterkey"), - SecretRef: to.Ptr("masterkey"), - }}, - Scopes: []*string{ - to.Ptr("container-app-1"), - to.Ptr("container-app-2")}, - Secrets: []*armappcontainers.Secret{ - { - Name: to.Ptr("masterkey"), - Value: to.Ptr("keyvalue"), - }}, - ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - { - Name: to.Ptr("statestore"), - Metadata: &armappcontainers.DaprServiceBindMetadata{ - Name: to.Ptr("daprcomponentBind"), - Value: to.Ptr("redis-bind"), - }, - ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - }}, - Version: to.Ptr("v1"), - }, - }, 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.DaprComponent = armappcontainers.DaprComponent{ - // Name: to.Ptr("reddog"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprcomponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1/daprcomponents/reddog"), - // Properties: &armappcontainers.DaprComponentProperties{ - // ComponentType: to.Ptr("state.azure.cosmosdb"), - // IgnoreErrors: to.Ptr(false), - // InitTimeout: to.Ptr("50s"), - // Metadata: []*armappcontainers.DaprMetadata{ - // { - // Name: to.Ptr("url"), - // Value: to.Ptr(""), - // }, - // { - // Name: to.Ptr("database"), - // Value: to.Ptr("itemsDB"), - // }, - // { - // Name: to.Ptr("collection"), - // Value: to.Ptr("items"), - // }, - // { - // Name: to.Ptr("masterkey"), - // SecretRef: to.Ptr("masterkey"), - // }}, - // Scopes: []*string{ - // to.Ptr("container-app-1"), - // to.Ptr("container-app-2")}, - // Secrets: []*armappcontainers.Secret{ - // { - // Name: to.Ptr("masterkey"), - // }}, - // ServiceComponentBind: []*armappcontainers.DaprComponentServiceBinding{ - // { - // Name: to.Ptr("statestore"), - // Metadata: &armappcontainers.DaprServiceBindMetadata{ - // Name: to.Ptr("daprcomponentBind"), - // Value: to.Ptr("redis-bind"), - // }, - // ServiceID: to.Ptr("/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis"), - // }}, - // Version: to.Ptr("v1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_Delete.json -func ExampleDaprComponentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDaprComponentsClient().Delete(ctx, "examplerg", "myenvironment", "reddog", 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/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprComponents_ListSecrets.json -func ExampleDaprComponentsClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprComponentsClient().ListSecrets(ctx, "examplerg", "myenvironment", "reddog", 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.DaprSecretsCollection = armappcontainers.DaprSecretsCollection{ - // Value: []*armappcontainers.DaprSecret{ - // { - // Name: to.Ptr("secret1"), - // }, - // { - // Name: to.Ptr("secret2"), - // }}, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/daprsubscriptions_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/daprsubscriptions_client.go index 5e24bd315ce1..3ce2f72ea49d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/daprsubscriptions_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/daprsubscriptions_client.go @@ -46,7 +46,7 @@ func NewDaprSubscriptionsClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Creates or updates a Dapr subscription in a Managed Environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - name - Name of the Dapr subscription. @@ -99,7 +99,7 @@ func (client *DaprSubscriptionsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, daprSubscriptionEnvelope); err != nil { @@ -120,7 +120,7 @@ func (client *DaprSubscriptionsClient) createOrUpdateHandleResponse(resp *http.R // Delete - Delete a Dapr subscription from a Managed Environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - name - Name of the Dapr subscription. @@ -171,7 +171,7 @@ func (client *DaprSubscriptionsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *DaprSubscriptionsClient) deleteCreateRequest(ctx context.Context, // Get - Get a dapr subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - name - Name of the Dapr subscription. @@ -231,7 +231,7 @@ func (client *DaprSubscriptionsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +248,7 @@ func (client *DaprSubscriptionsClient) getHandleResponse(resp *http.Response) (D // NewListPager - Get the Dapr subscriptions for a managed environment. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - options - DaprSubscriptionsClientListOptions contains the optional parameters for the DaprSubscriptionsClient.NewListPager @@ -296,7 +296,7 @@ func (client *DaprSubscriptionsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/daprsubscriptions_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/daprsubscriptions_client_example_test.go deleted file mode 100644 index db4d37f17459..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/daprsubscriptions_client_example_test.go +++ /dev/null @@ -1,409 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_List.json -func ExampleDaprSubscriptionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDaprSubscriptionsClient().NewListPager("examplerg", "myenvironment", 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.DaprSubscriptionsCollection = armappcontainers.DaprSubscriptionsCollection{ - // Value: []*armappcontainers.DaprSubscription{ - // { - // Name: to.Ptr("mybulksubscription"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprSubscriptions"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprSubscriptions/mybulksubscription"), - // Properties: &armappcontainers.DaprSubscriptionProperties{ - // BulkSubscribe: &armappcontainers.DaprSubscriptionBulkSubscribeOptions{ - // Enabled: to.Ptr(true), - // MaxAwaitDurationMs: to.Ptr[int32](500), - // MaxMessagesCount: to.Ptr[int32](123), - // }, - // PubsubName: to.Ptr("mypubsubcomponent"), - // Routes: &armappcontainers.DaprSubscriptionRoutes{ - // Default: to.Ptr("/products"), - // Rules: []*armappcontainers.DaprSubscriptionRouteRule{ - // }, - // }, - // Topic: to.Ptr("inventory"), - // }, - // }, - // { - // Name: to.Ptr("mydefaultsubscription"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprSubscriptions"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprSubscriptions/mydefaultsubscription"), - // Properties: &armappcontainers.DaprSubscriptionProperties{ - // PubsubName: to.Ptr("mypubsubcomponent"), - // Routes: &armappcontainers.DaprSubscriptionRoutes{ - // Default: to.Ptr("/products"), - // Rules: []*armappcontainers.DaprSubscriptionRouteRule{ - // }, - // }, - // Topic: to.Ptr("inventory"), - // }, - // }, - // { - // Name: to.Ptr("myroutingsubscription"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprSubscriptions"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprSubscriptions/myroutingsubscription"), - // Properties: &armappcontainers.DaprSubscriptionProperties{ - // Metadata: map[string]*string{ - // "foo": to.Ptr("bar"), - // "hello": to.Ptr("world"), - // }, - // PubsubName: to.Ptr("mypubsubcomponent"), - // Routes: &armappcontainers.DaprSubscriptionRoutes{ - // Default: to.Ptr("/products"), - // Rules: []*armappcontainers.DaprSubscriptionRouteRule{ - // { - // Path: to.Ptr("/widgets"), - // Match: to.Ptr("event.type == 'widget'"), - // }, - // { - // Path: to.Ptr("/gadgets"), - // Match: to.Ptr("event.type == 'gadget'"), - // }}, - // }, - // Topic: to.Ptr("inventory"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Get_DefaultRoute.json -func ExampleDaprSubscriptionsClient_Get_getDaprSubscriptionWithBulkSubscribeConfigurationAndScopes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprSubscriptionsClient().Get(ctx, "examplerg", "myenvironment", "mypubsubcomponent", 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.DaprSubscription = armappcontainers.DaprSubscription{ - // Name: to.Ptr("mysubscription"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprSubscriptions"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprSubscriptions/mysubscription"), - // Properties: &armappcontainers.DaprSubscriptionProperties{ - // PubsubName: to.Ptr("mypubsubcomponent"), - // Routes: &armappcontainers.DaprSubscriptionRoutes{ - // Default: to.Ptr("/products"), - // Rules: []*armappcontainers.DaprSubscriptionRouteRule{ - // }, - // }, - // Topic: to.Ptr("inventory"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Get_BulkSubscribeAndScopes.json -func ExampleDaprSubscriptionsClient_Get_getDaprSubscriptionWithDefaultRouteOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprSubscriptionsClient().Get(ctx, "examplerg", "myenvironment", "mypubsubcomponent", 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.DaprSubscription = armappcontainers.DaprSubscription{ - // Name: to.Ptr("mysubscription"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprSubscriptions"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprSubscriptions/mysubscription"), - // Properties: &armappcontainers.DaprSubscriptionProperties{ - // BulkSubscribe: &armappcontainers.DaprSubscriptionBulkSubscribeOptions{ - // Enabled: to.Ptr(true), - // MaxAwaitDurationMs: to.Ptr[int32](500), - // MaxMessagesCount: to.Ptr[int32](123), - // }, - // PubsubName: to.Ptr("mypubsubcomponent"), - // Routes: &armappcontainers.DaprSubscriptionRoutes{ - // Default: to.Ptr("/products"), - // Rules: []*armappcontainers.DaprSubscriptionRouteRule{ - // }, - // }, - // Scopes: []*string{ - // to.Ptr("warehouseapp"), - // to.Ptr("customersupportapp")}, - // Topic: to.Ptr("inventory"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Get_RouteRulesAndMetadata.json -func ExampleDaprSubscriptionsClient_Get_getDaprSubscriptionWithRouteRulesAndMetadata() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprSubscriptionsClient().Get(ctx, "examplerg", "myenvironment", "mypubsubcomponent", 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.DaprSubscription = armappcontainers.DaprSubscription{ - // Name: to.Ptr("mysubscription"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprSubscriptions"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprSubscriptions/mysubscription"), - // Properties: &armappcontainers.DaprSubscriptionProperties{ - // Metadata: map[string]*string{ - // "foo": to.Ptr("bar"), - // "hello": to.Ptr("world"), - // }, - // PubsubName: to.Ptr("mypubsubcomponent"), - // Routes: &armappcontainers.DaprSubscriptionRoutes{ - // Default: to.Ptr("/products"), - // Rules: []*armappcontainers.DaprSubscriptionRouteRule{ - // { - // Path: to.Ptr("/widgets"), - // Match: to.Ptr("event.type == 'widget'"), - // }, - // { - // Path: to.Ptr("/gadgets"), - // Match: to.Ptr("event.type == 'gadget'"), - // }}, - // }, - // Topic: to.Ptr("inventory"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_CreateOrUpdate_BulkSubscribeAndScopes.json -func ExampleDaprSubscriptionsClient_CreateOrUpdate_createOrUpdateDaprSubscriptionWithBulkSubscribeConfigurationAndScopes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprSubscriptionsClient().CreateOrUpdate(ctx, "examplerg", "myenvironment", "mysubscription", armappcontainers.DaprSubscription{ - Properties: &armappcontainers.DaprSubscriptionProperties{ - BulkSubscribe: &armappcontainers.DaprSubscriptionBulkSubscribeOptions{ - Enabled: to.Ptr(true), - MaxAwaitDurationMs: to.Ptr[int32](500), - MaxMessagesCount: to.Ptr[int32](123), - }, - PubsubName: to.Ptr("mypubsubcomponent"), - Routes: &armappcontainers.DaprSubscriptionRoutes{ - Default: to.Ptr("/products"), - }, - Scopes: []*string{ - to.Ptr("warehouseapp"), - to.Ptr("customersupportapp")}, - Topic: to.Ptr("inventory"), - }, - }, 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.DaprSubscription = armappcontainers.DaprSubscription{ - // Name: to.Ptr("mysubscription"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprSubscriptions"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprSubscriptions/mysubscription"), - // Properties: &armappcontainers.DaprSubscriptionProperties{ - // BulkSubscribe: &armappcontainers.DaprSubscriptionBulkSubscribeOptions{ - // Enabled: to.Ptr(true), - // MaxAwaitDurationMs: to.Ptr[int32](500), - // MaxMessagesCount: to.Ptr[int32](123), - // }, - // PubsubName: to.Ptr("mypubsubcomponent"), - // Routes: &armappcontainers.DaprSubscriptionRoutes{ - // Default: to.Ptr("/products"), - // Rules: []*armappcontainers.DaprSubscriptionRouteRule{ - // }, - // }, - // Scopes: []*string{ - // to.Ptr("warehouseapp"), - // to.Ptr("customersupportapp")}, - // Topic: to.Ptr("inventory"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_CreateOrUpdate_DefaultRoute.json -func ExampleDaprSubscriptionsClient_CreateOrUpdate_createOrUpdateDaprSubscriptionWithDefaultRouteOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprSubscriptionsClient().CreateOrUpdate(ctx, "examplerg", "myenvironment", "mysubscription", armappcontainers.DaprSubscription{ - Properties: &armappcontainers.DaprSubscriptionProperties{ - PubsubName: to.Ptr("mypubsubcomponent"), - Routes: &armappcontainers.DaprSubscriptionRoutes{ - Default: to.Ptr("/products"), - }, - Topic: to.Ptr("inventory"), - }, - }, 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.DaprSubscription = armappcontainers.DaprSubscription{ - // Name: to.Ptr("mysubscription"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprSubscriptions"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprSubscriptions/mysubscription"), - // Properties: &armappcontainers.DaprSubscriptionProperties{ - // PubsubName: to.Ptr("mypubsubcomponent"), - // Routes: &armappcontainers.DaprSubscriptionRoutes{ - // Default: to.Ptr("/products"), - // Rules: []*armappcontainers.DaprSubscriptionRouteRule{ - // }, - // }, - // Topic: to.Ptr("inventory"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_CreateOrUpdate_RouteRulesAndMetadata.json -func ExampleDaprSubscriptionsClient_CreateOrUpdate_createOrUpdateDaprSubscriptionWithRouteRulesAndMetadata() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDaprSubscriptionsClient().CreateOrUpdate(ctx, "examplerg", "myenvironment", "mysubscription", armappcontainers.DaprSubscription{ - Properties: &armappcontainers.DaprSubscriptionProperties{ - Metadata: map[string]*string{ - "foo": to.Ptr("bar"), - "hello": to.Ptr("world"), - }, - PubsubName: to.Ptr("mypubsubcomponent"), - Routes: &armappcontainers.DaprSubscriptionRoutes{ - Default: to.Ptr("/products"), - Rules: []*armappcontainers.DaprSubscriptionRouteRule{ - { - Path: to.Ptr("/widgets"), - Match: to.Ptr("event.type == 'widget'"), - }, - { - Path: to.Ptr("/gadgets"), - Match: to.Ptr("event.type == 'gadget'"), - }}, - }, - Topic: to.Ptr("inventory"), - }, - }, 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.DaprSubscription = armappcontainers.DaprSubscription{ - // Name: to.Ptr("mysubscription"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/daprSubscriptions"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/daprSubscriptions/mysubscription"), - // Properties: &armappcontainers.DaprSubscriptionProperties{ - // Metadata: map[string]*string{ - // "foo": to.Ptr("bar"), - // "hello": to.Ptr("world"), - // }, - // PubsubName: to.Ptr("mypubsubcomponent"), - // Routes: &armappcontainers.DaprSubscriptionRoutes{ - // Default: to.Ptr("/products"), - // Rules: []*armappcontainers.DaprSubscriptionRouteRule{ - // { - // Path: to.Ptr("/widgets"), - // Match: to.Ptr("event.type == 'widget'"), - // }, - // { - // Path: to.Ptr("/gadgets"), - // Match: to.Ptr("event.type == 'gadget'"), - // }}, - // }, - // Topic: to.Ptr("inventory"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DaprSubscriptions_Delete.json -func ExampleDaprSubscriptionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDaprSubscriptionsClient().Delete(ctx, "examplerg", "myenvironment", "mysubscription", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/dotnetcomponents_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/dotnetcomponents_client.go index 2f19c843f10d..f378286dea1f 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/dotnetcomponents_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/dotnetcomponents_client.go @@ -46,7 +46,7 @@ func NewDotNetComponentsClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates a .NET Component in a Managed Environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - name - Name of the .NET Component. @@ -74,7 +74,7 @@ func (client *DotNetComponentsClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates a .NET Component in a Managed Environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *DotNetComponentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, name string, dotNetComponentEnvelope DotNetComponent, options *DotNetComponentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DotNetComponentsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *DotNetComponentsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, dotNetComponentEnvelope); err != nil { @@ -132,7 +132,7 @@ func (client *DotNetComponentsClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Delete a .NET Component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - name - Name of the .NET Component. @@ -159,7 +159,7 @@ func (client *DotNetComponentsClient) BeginDelete(ctx context.Context, resourceG // Delete - Delete a .NET Component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *DotNetComponentsClient) deleteOperation(ctx context.Context, resourceGroupName string, environmentName string, name string, options *DotNetComponentsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DotNetComponentsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *DotNetComponentsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *DotNetComponentsClient) deleteCreateRequest(ctx context.Context, r // Get - Get a .NET Component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - name - Name of the .NET Component. @@ -265,7 +265,7 @@ func (client *DotNetComponentsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *DotNetComponentsClient) getHandleResponse(resp *http.Response) (Do // NewListPager - Get the .NET Components for a managed environment. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - options - DotNetComponentsClientListOptions contains the optional parameters for the DotNetComponentsClient.NewListPager @@ -330,7 +330,7 @@ func (client *DotNetComponentsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,7 +348,7 @@ func (client *DotNetComponentsClient) listHandleResponse(resp *http.Response) (D // BeginUpdate - Patches a .NET Component using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - name - Name of the .NET Component. @@ -375,7 +375,7 @@ func (client *DotNetComponentsClient) BeginUpdate(ctx context.Context, resourceG // Update - Patches a .NET Component using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *DotNetComponentsClient) update(ctx context.Context, resourceGroupName string, environmentName string, name string, dotNetComponentEnvelope DotNetComponent, options *DotNetComponentsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "DotNetComponentsClient.BeginUpdate" @@ -421,7 +421,7 @@ func (client *DotNetComponentsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, dotNetComponentEnvelope); err != nil { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/dotnetcomponents_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/dotnetcomponents_client_example_test.go deleted file mode 100644 index 3a49df2ba3ee..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/dotnetcomponents_client_example_test.go +++ /dev/null @@ -1,443 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_List.json -func ExampleDotNetComponentsClient_NewListPager_listNetComponents() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDotNetComponentsClient().NewListPager("examplerg", "myenvironment", 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.DotNetComponentsCollection = armappcontainers.DotNetComponentsCollection{ - // Value: []*armappcontainers.DotNetComponent{ - // { - // Name: to.Ptr("blueshark"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/dotNetComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/blueshark"), - // Properties: &armappcontainers.DotNetComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireDashboard), - // Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("dashboard-theme"), - // Value: to.Ptr("dark"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.DotNetComponentProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("yellowcat"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/dotNetComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"), - // Properties: &armappcontainers.DotNetComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireResourceServerAPI), - // Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("timeout-value"), - // Value: to.Ptr("10000ms"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.DotNetComponentProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_List_ServiceBind.json -func ExampleDotNetComponentsClient_NewListPager_listNetComponentsWithServiceBinds() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDotNetComponentsClient().NewListPager("examplerg", "myenvironment", 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.DotNetComponentsCollection = armappcontainers.DotNetComponentsCollection{ - // Value: []*armappcontainers.DotNetComponent{ - // { - // Name: to.Ptr("blueshark"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/dotNetComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/blueshark"), - // Properties: &armappcontainers.DotNetComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireDashboard), - // Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("dashboard-theme"), - // Value: to.Ptr("dark"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.DotNetComponentProvisioningStateSucceeded), - // ServiceBinds: []*armappcontainers.DotNetComponentServiceBind{ - // { - // Name: to.Ptr("yellowcat"), - // ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("yellowcat"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/dotNetComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"), - // Properties: &armappcontainers.DotNetComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireResourceServerAPI), - // Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("timeout-value"), - // Value: to.Ptr("10000ms"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.DotNetComponentProvisioningStateSucceeded), - // ServiceBinds: []*armappcontainers.DotNetComponentServiceBind{ - // { - // Name: to.Ptr("blueshark"), - // ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/blueshark"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Get.json -func ExampleDotNetComponentsClient_Get_getNetComponent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDotNetComponentsClient().Get(ctx, "examplerg", "myenvironment", "mydotnetcomponent", 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.DotNetComponent = armappcontainers.DotNetComponent{ - // Name: to.Ptr("mydotnetcomponent"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/dotNetComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/mydotnetcomponent"), - // Properties: &armappcontainers.DotNetComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireDashboard), - // Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("dashboard-theme"), - // Value: to.Ptr("dark"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.DotNetComponentProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Get_ServiceBind.json -func ExampleDotNetComponentsClient_Get_getNetComponentWithServiceBinds() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDotNetComponentsClient().Get(ctx, "examplerg", "myenvironment", "mydotnetcomponent", 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.DotNetComponent = armappcontainers.DotNetComponent{ - // Name: to.Ptr("mydotnetcomponent"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/dotNetComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/mydotnetcomponent"), - // Properties: &armappcontainers.DotNetComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireDashboard), - // Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("dashboard-theme"), - // Value: to.Ptr("dark"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.DotNetComponentProvisioningStateSucceeded), - // ServiceBinds: []*armappcontainers.DotNetComponentServiceBind{ - // { - // Name: to.Ptr("yellowcat"), - // ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_CreateOrUpdate.json -func ExampleDotNetComponentsClient_BeginCreateOrUpdate_createOrUpdateNetComponent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDotNetComponentsClient().BeginCreateOrUpdate(ctx, "examplerg", "myenvironment", "mydotnetcomponent", armappcontainers.DotNetComponent{ - Properties: &armappcontainers.DotNetComponentProperties{ - ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireDashboard), - Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - { - PropertyName: to.Ptr("dashboard-theme"), - Value: to.Ptr("dark"), - }}, - }, - }, 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.DotNetComponent = armappcontainers.DotNetComponent{ - // Name: to.Ptr("mydotnetcomponent"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/dotNetComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/mydotnetcomponent"), - // Properties: &armappcontainers.DotNetComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireDashboard), - // Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("dashboard-theme"), - // Value: to.Ptr("dark"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.DotNetComponentProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_CreateOrUpdate_ServiceBind.json -func ExampleDotNetComponentsClient_BeginCreateOrUpdate_createOrUpdateNetComponentWithServiceBinds() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDotNetComponentsClient().BeginCreateOrUpdate(ctx, "examplerg", "myenvironment", "mydotnetcomponent", armappcontainers.DotNetComponent{ - Properties: &armappcontainers.DotNetComponentProperties{ - ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireDashboard), - Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - { - PropertyName: to.Ptr("dashboard-theme"), - Value: to.Ptr("dark"), - }}, - ServiceBinds: []*armappcontainers.DotNetComponentServiceBind{ - { - Name: to.Ptr("yellowcat"), - ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"), - }}, - }, - }, 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.DotNetComponent = armappcontainers.DotNetComponent{ - // Name: to.Ptr("mydotnetcomponent"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/dotNetComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/mydotnetcomponent"), - // Properties: &armappcontainers.DotNetComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireDashboard), - // Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("dashboard-theme"), - // Value: to.Ptr("dark"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.DotNetComponentProvisioningStateSucceeded), - // ServiceBinds: []*armappcontainers.DotNetComponentServiceBind{ - // { - // Name: to.Ptr("yellowcat"), - // ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Patch.json -func ExampleDotNetComponentsClient_BeginUpdate_patchNetComponent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDotNetComponentsClient().BeginUpdate(ctx, "examplerg", "myenvironment", "mydotnetcomponent", armappcontainers.DotNetComponent{ - Properties: &armappcontainers.DotNetComponentProperties{ - ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireDashboard), - Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - { - PropertyName: to.Ptr("dashboard-theme"), - Value: to.Ptr("dark"), - }}, - }, - }, 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.DotNetComponent = armappcontainers.DotNetComponent{ - // Name: to.Ptr("mydotnetcomponent"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/dotNetComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/mydotnetcomponent"), - // Properties: &armappcontainers.DotNetComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireDashboard), - // Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("dashboard-theme"), - // Value: to.Ptr("dark"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.DotNetComponentProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Patch_ServiceBind.json -func ExampleDotNetComponentsClient_BeginUpdate_patchNetComponentWithServiceBinds() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDotNetComponentsClient().BeginUpdate(ctx, "examplerg", "myenvironment", "mydotnetcomponent", armappcontainers.DotNetComponent{ - Properties: &armappcontainers.DotNetComponentProperties{ - ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireDashboard), - Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - { - PropertyName: to.Ptr("dashboard-theme"), - Value: to.Ptr("dark"), - }}, - ServiceBinds: []*armappcontainers.DotNetComponentServiceBind{ - { - Name: to.Ptr("yellowcat"), - ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"), - }}, - }, - }, 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.DotNetComponent = armappcontainers.DotNetComponent{ - // Name: to.Ptr("mydotnetcomponent"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/dotNetComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/mydotnetcomponent"), - // Properties: &armappcontainers.DotNetComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.DotNetComponentTypeAspireDashboard), - // Configurations: []*armappcontainers.DotNetComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("dashboard-theme"), - // Value: to.Ptr("dark"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.DotNetComponentProvisioningStateSucceeded), - // ServiceBinds: []*armappcontainers.DotNetComponentServiceBind{ - // { - // Name: to.Ptr("yellowcat"), - // ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/DotNetComponents_Delete.json -func ExampleDotNetComponentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDotNetComponentsClient().BeginDelete(ctx, "examplerg", "myenvironment", "mydotnetcomponent", 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/appcontainers/armappcontainers/fake/containerappsbuilds_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsbuilds_server.go new file mode 100644 index 000000000000..35be73599624 --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsbuilds_server.go @@ -0,0 +1,154 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" + "net/http" + "net/url" + "regexp" +) + +// ContainerAppsBuildsServer is a fake server for instances of the armappcontainers.ContainerAppsBuildsClient type. +type ContainerAppsBuildsServer struct { + // BeginDelete is the fake for method ContainerAppsBuildsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, buildName string, options *armappcontainers.ContainerAppsBuildsClientBeginDeleteOptions) (resp azfake.PollerResponder[armappcontainers.ContainerAppsBuildsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ContainerAppsBuildsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, buildName string, options *armappcontainers.ContainerAppsBuildsClientGetOptions) (resp azfake.Responder[armappcontainers.ContainerAppsBuildsClientGetResponse], errResp azfake.ErrorResponder) +} + +// NewContainerAppsBuildsServerTransport creates a new instance of ContainerAppsBuildsServerTransport with the provided implementation. +// The returned ContainerAppsBuildsServerTransport instance is connected to an instance of armappcontainers.ContainerAppsBuildsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewContainerAppsBuildsServerTransport(srv *ContainerAppsBuildsServer) *ContainerAppsBuildsServerTransport { + return &ContainerAppsBuildsServerTransport{ + srv: srv, + beginDelete: newTracker[azfake.PollerResponder[armappcontainers.ContainerAppsBuildsClientDeleteResponse]](), + } +} + +// ContainerAppsBuildsServerTransport connects instances of armappcontainers.ContainerAppsBuildsClient to instances of ContainerAppsBuildsServer. +// Don't use this type directly, use NewContainerAppsBuildsServerTransport instead. +type ContainerAppsBuildsServerTransport struct { + srv *ContainerAppsBuildsServer + beginDelete *tracker[azfake.PollerResponder[armappcontainers.ContainerAppsBuildsClientDeleteResponse]] +} + +// Do implements the policy.Transporter interface for ContainerAppsBuildsServerTransport. +func (c *ContainerAppsBuildsServerTransport) 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 "ContainerAppsBuildsClient.BeginDelete": + resp, err = c.dispatchBeginDelete(req) + case "ContainerAppsBuildsClient.Get": + resp, err = c.dispatchGet(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *ContainerAppsBuildsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if c.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := c.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/containerApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/builds/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + 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 + } + buildNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("buildName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginDelete(req.Context(), resourceGroupNameParam, buildNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + c.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + c.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + c.beginDelete.remove(req) + } + + return resp, nil +} + +func (c *ContainerAppsBuildsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.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\.App/containerApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/builds/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + 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 + } + buildNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("buildName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, buildNameParam, 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).ContainerAppsBuildResource, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsbuildsbycontainerapp_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsbuildsbycontainerapp_server.go new file mode 100644 index 000000000000..cee29444b0d1 --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsbuildsbycontainerapp_server.go @@ -0,0 +1,108 @@ +//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 ( + "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/appcontainers/armappcontainers/v3" + "net/http" + "net/url" + "regexp" +) + +// ContainerAppsBuildsByContainerAppServer is a fake server for instances of the armappcontainers.ContainerAppsBuildsByContainerAppClient type. +type ContainerAppsBuildsByContainerAppServer struct { + // NewListPager is the fake for method ContainerAppsBuildsByContainerAppClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, options *armappcontainers.ContainerAppsBuildsByContainerAppClientListOptions) (resp azfake.PagerResponder[armappcontainers.ContainerAppsBuildsByContainerAppClientListResponse]) +} + +// NewContainerAppsBuildsByContainerAppServerTransport creates a new instance of ContainerAppsBuildsByContainerAppServerTransport with the provided implementation. +// The returned ContainerAppsBuildsByContainerAppServerTransport instance is connected to an instance of armappcontainers.ContainerAppsBuildsByContainerAppClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewContainerAppsBuildsByContainerAppServerTransport(srv *ContainerAppsBuildsByContainerAppServer) *ContainerAppsBuildsByContainerAppServerTransport { + return &ContainerAppsBuildsByContainerAppServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armappcontainers.ContainerAppsBuildsByContainerAppClientListResponse]](), + } +} + +// ContainerAppsBuildsByContainerAppServerTransport connects instances of armappcontainers.ContainerAppsBuildsByContainerAppClient to instances of ContainerAppsBuildsByContainerAppServer. +// Don't use this type directly, use NewContainerAppsBuildsByContainerAppServerTransport instead. +type ContainerAppsBuildsByContainerAppServerTransport struct { + srv *ContainerAppsBuildsByContainerAppServer + newListPager *tracker[azfake.PagerResponder[armappcontainers.ContainerAppsBuildsByContainerAppClientListResponse]] +} + +// Do implements the policy.Transporter interface for ContainerAppsBuildsByContainerAppServerTransport. +func (c *ContainerAppsBuildsByContainerAppServerTransport) 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 "ContainerAppsBuildsByContainerAppClient.NewListPager": + resp, err = c.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *ContainerAppsBuildsByContainerAppServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/containerApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/builds` + 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 + } + resp := c.srv.NewListPager(resourceGroupNameParam, nil) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armappcontainers.ContainerAppsBuildsByContainerAppClientListResponse, 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) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappspatches_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappspatches_server.go new file mode 100644 index 000000000000..8987b6e56476 --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappspatches_server.go @@ -0,0 +1,320 @@ +//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/appcontainers/armappcontainers/v3" + "net/http" + "net/url" + "regexp" +) + +// ContainerAppsPatchesServer is a fake server for instances of the armappcontainers.ContainerAppsPatchesClient type. +type ContainerAppsPatchesServer struct { + // BeginApply is the fake for method ContainerAppsPatchesClient.BeginApply + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginApply func(ctx context.Context, resourceGroupName string, patchName string, options *armappcontainers.ContainerAppsPatchesClientBeginApplyOptions) (resp azfake.PollerResponder[armappcontainers.ContainerAppsPatchesClientApplyResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ContainerAppsPatchesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, patchName string, options *armappcontainers.ContainerAppsPatchesClientBeginDeleteOptions) (resp azfake.PollerResponder[armappcontainers.ContainerAppsPatchesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ContainerAppsPatchesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, patchName string, options *armappcontainers.ContainerAppsPatchesClientGetOptions) (resp azfake.Responder[armappcontainers.ContainerAppsPatchesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByContainerAppPager is the fake for method ContainerAppsPatchesClient.NewListByContainerAppPager + // HTTP status codes to indicate success: http.StatusOK + NewListByContainerAppPager func(resourceGroupName string, options *armappcontainers.ContainerAppsPatchesClientListByContainerAppOptions) (resp azfake.PagerResponder[armappcontainers.ContainerAppsPatchesClientListByContainerAppResponse]) + + // BeginSkipConfigure is the fake for method ContainerAppsPatchesClient.BeginSkipConfigure + // HTTP status codes to indicate success: http.StatusAccepted + BeginSkipConfigure func(ctx context.Context, resourceGroupName string, patchName string, patchSkipConfig armappcontainers.PatchSkipConfig, options *armappcontainers.ContainerAppsPatchesClientBeginSkipConfigureOptions) (resp azfake.PollerResponder[armappcontainers.ContainerAppsPatchesClientSkipConfigureResponse], errResp azfake.ErrorResponder) +} + +// NewContainerAppsPatchesServerTransport creates a new instance of ContainerAppsPatchesServerTransport with the provided implementation. +// The returned ContainerAppsPatchesServerTransport instance is connected to an instance of armappcontainers.ContainerAppsPatchesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewContainerAppsPatchesServerTransport(srv *ContainerAppsPatchesServer) *ContainerAppsPatchesServerTransport { + return &ContainerAppsPatchesServerTransport{ + srv: srv, + beginApply: newTracker[azfake.PollerResponder[armappcontainers.ContainerAppsPatchesClientApplyResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armappcontainers.ContainerAppsPatchesClientDeleteResponse]](), + newListByContainerAppPager: newTracker[azfake.PagerResponder[armappcontainers.ContainerAppsPatchesClientListByContainerAppResponse]](), + beginSkipConfigure: newTracker[azfake.PollerResponder[armappcontainers.ContainerAppsPatchesClientSkipConfigureResponse]](), + } +} + +// ContainerAppsPatchesServerTransport connects instances of armappcontainers.ContainerAppsPatchesClient to instances of ContainerAppsPatchesServer. +// Don't use this type directly, use NewContainerAppsPatchesServerTransport instead. +type ContainerAppsPatchesServerTransport struct { + srv *ContainerAppsPatchesServer + beginApply *tracker[azfake.PollerResponder[armappcontainers.ContainerAppsPatchesClientApplyResponse]] + beginDelete *tracker[azfake.PollerResponder[armappcontainers.ContainerAppsPatchesClientDeleteResponse]] + newListByContainerAppPager *tracker[azfake.PagerResponder[armappcontainers.ContainerAppsPatchesClientListByContainerAppResponse]] + beginSkipConfigure *tracker[azfake.PollerResponder[armappcontainers.ContainerAppsPatchesClientSkipConfigureResponse]] +} + +// Do implements the policy.Transporter interface for ContainerAppsPatchesServerTransport. +func (c *ContainerAppsPatchesServerTransport) 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 "ContainerAppsPatchesClient.BeginApply": + resp, err = c.dispatchBeginApply(req) + case "ContainerAppsPatchesClient.BeginDelete": + resp, err = c.dispatchBeginDelete(req) + case "ContainerAppsPatchesClient.Get": + resp, err = c.dispatchGet(req) + case "ContainerAppsPatchesClient.NewListByContainerAppPager": + resp, err = c.dispatchNewListByContainerAppPager(req) + case "ContainerAppsPatchesClient.BeginSkipConfigure": + resp, err = c.dispatchBeginSkipConfigure(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *ContainerAppsPatchesServerTransport) dispatchBeginApply(req *http.Request) (*http.Response, error) { + if c.srv.BeginApply == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginApply not implemented")} + } + beginApply := c.beginApply.get(req) + if beginApply == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/containerApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/patches/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/apply` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + 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 + } + patchNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("patchName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginApply(req.Context(), resourceGroupNameParam, patchNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginApply = &respr + c.beginApply.add(req, beginApply) + } + + resp, err := server.PollerResponderNext(beginApply, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginApply.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginApply) { + c.beginApply.remove(req) + } + + return resp, nil +} + +func (c *ContainerAppsPatchesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if c.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := c.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/containerApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/patches/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + 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 + } + patchNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("patchName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginDelete(req.Context(), resourceGroupNameParam, patchNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + c.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + c.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + c.beginDelete.remove(req) + } + + return resp, nil +} + +func (c *ContainerAppsPatchesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.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\.App/containerApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/patches/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + 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 + } + patchNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("patchName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, patchNameParam, 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).ContainerAppsPatchResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ContainerAppsPatchesServerTransport) dispatchNewListByContainerAppPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListByContainerAppPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByContainerAppPager not implemented")} + } + newListByContainerAppPager := c.newListByContainerAppPager.get(req) + if newListByContainerAppPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/containerApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/patches` + 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) + } + 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 *armappcontainers.ContainerAppsPatchesClientListByContainerAppOptions + if filterParam != nil { + options = &armappcontainers.ContainerAppsPatchesClientListByContainerAppOptions{ + Filter: filterParam, + } + } + resp := c.srv.NewListByContainerAppPager(resourceGroupNameParam, options) + newListByContainerAppPager = &resp + c.newListByContainerAppPager.add(req, newListByContainerAppPager) + server.PagerResponderInjectNextLinks(newListByContainerAppPager, req, func(page *armappcontainers.ContainerAppsPatchesClientListByContainerAppResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByContainerAppPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListByContainerAppPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByContainerAppPager) { + c.newListByContainerAppPager.remove(req) + } + return resp, nil +} + +func (c *ContainerAppsPatchesServerTransport) dispatchBeginSkipConfigure(req *http.Request) (*http.Response, error) { + if c.srv.BeginSkipConfigure == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginSkipConfigure not implemented")} + } + beginSkipConfigure := c.beginSkipConfigure.get(req) + if beginSkipConfigure == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/containerApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/patches/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/skipConfig` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armappcontainers.PatchSkipConfig](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + patchNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("patchName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginSkipConfigure(req.Context(), resourceGroupNameParam, patchNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginSkipConfigure = &respr + c.beginSkipConfigure.add(req, beginSkipConfigure) + } + + resp, err := server.PollerResponderNext(beginSkipConfigure, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + c.beginSkipConfigure.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginSkipConfigure) { + c.beginSkipConfigure.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/functionsextension_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/functionsextension_server.go new file mode 100644 index 000000000000..dd50bd60af85 --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/functionsextension_server.go @@ -0,0 +1,108 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" + "net/http" + "net/url" + "regexp" +) + +// FunctionsExtensionServer is a fake server for instances of the armappcontainers.FunctionsExtensionClient type. +type FunctionsExtensionServer struct { + // InvokeFunctionsHost is the fake for method FunctionsExtensionClient.InvokeFunctionsHost + // HTTP status codes to indicate success: http.StatusOK + InvokeFunctionsHost func(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, functionAppName string, options *armappcontainers.FunctionsExtensionClientInvokeFunctionsHostOptions) (resp azfake.Responder[armappcontainers.FunctionsExtensionClientInvokeFunctionsHostResponse], errResp azfake.ErrorResponder) +} + +// NewFunctionsExtensionServerTransport creates a new instance of FunctionsExtensionServerTransport with the provided implementation. +// The returned FunctionsExtensionServerTransport instance is connected to an instance of armappcontainers.FunctionsExtensionClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewFunctionsExtensionServerTransport(srv *FunctionsExtensionServer) *FunctionsExtensionServerTransport { + return &FunctionsExtensionServerTransport{srv: srv} +} + +// FunctionsExtensionServerTransport connects instances of armappcontainers.FunctionsExtensionClient to instances of FunctionsExtensionServer. +// Don't use this type directly, use NewFunctionsExtensionServerTransport instead. +type FunctionsExtensionServerTransport struct { + srv *FunctionsExtensionServer +} + +// Do implements the policy.Transporter interface for FunctionsExtensionServerTransport. +func (f *FunctionsExtensionServerTransport) 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 "FunctionsExtensionClient.InvokeFunctionsHost": + resp, err = f.dispatchInvokeFunctionsHost(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (f *FunctionsExtensionServerTransport) dispatchInvokeFunctionsHost(req *http.Request) (*http.Response, error) { + if f.srv.InvokeFunctionsHost == nil { + return nil, &nonRetriableError{errors.New("fake for method InvokeFunctionsHost not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/containerApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/revisions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/functions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/invoke` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + 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 + } + containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) + if err != nil { + return nil, err + } + revisionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("revisionName")]) + if err != nil { + return nil, err + } + functionAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("functionAppName")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.InvokeFunctionsHost(req.Context(), resourceGroupNameParam, containerAppNameParam, revisionNameParam, functionAppNameParam, 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).Value, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/server_factory.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/server_factory.go index 3bc8533e04b4..a29471da61be 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/server_factory.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/server_factory.go @@ -33,8 +33,11 @@ type ServerFactory struct { ConnectedEnvironmentsStoragesServer ConnectedEnvironmentsStoragesServer ContainerAppsAPIServer ContainerAppsAPIServer ContainerAppsAuthConfigsServer ContainerAppsAuthConfigsServer + ContainerAppsBuildsByContainerAppServer ContainerAppsBuildsByContainerAppServer + ContainerAppsBuildsServer ContainerAppsBuildsServer ContainerAppsServer ContainerAppsServer ContainerAppsDiagnosticsServer ContainerAppsDiagnosticsServer + ContainerAppsPatchesServer ContainerAppsPatchesServer ContainerAppsRevisionReplicasServer ContainerAppsRevisionReplicasServer ContainerAppsRevisionsServer ContainerAppsRevisionsServer ContainerAppsSourceControlsServer ContainerAppsSourceControlsServer @@ -42,6 +45,7 @@ type ServerFactory struct { DaprComponentsServer DaprComponentsServer DaprSubscriptionsServer DaprSubscriptionsServer DotNetComponentsServer DotNetComponentsServer + FunctionsExtensionServer FunctionsExtensionServer JavaComponentsServer JavaComponentsServer JobsServer JobsServer JobsExecutionsServer JobsExecutionsServer @@ -84,8 +88,11 @@ type ServerFactoryTransport struct { trConnectedEnvironmentsStoragesServer *ConnectedEnvironmentsStoragesServerTransport trContainerAppsAPIServer *ContainerAppsAPIServerTransport trContainerAppsAuthConfigsServer *ContainerAppsAuthConfigsServerTransport + trContainerAppsBuildsByContainerAppServer *ContainerAppsBuildsByContainerAppServerTransport + trContainerAppsBuildsServer *ContainerAppsBuildsServerTransport trContainerAppsServer *ContainerAppsServerTransport trContainerAppsDiagnosticsServer *ContainerAppsDiagnosticsServerTransport + trContainerAppsPatchesServer *ContainerAppsPatchesServerTransport trContainerAppsRevisionReplicasServer *ContainerAppsRevisionReplicasServerTransport trContainerAppsRevisionsServer *ContainerAppsRevisionsServerTransport trContainerAppsSourceControlsServer *ContainerAppsSourceControlsServerTransport @@ -93,6 +100,7 @@ type ServerFactoryTransport struct { trDaprComponentsServer *DaprComponentsServerTransport trDaprSubscriptionsServer *DaprSubscriptionsServerTransport trDotNetComponentsServer *DotNetComponentsServerTransport + trFunctionsExtensionServer *FunctionsExtensionServerTransport trJavaComponentsServer *JavaComponentsServerTransport trJobsServer *JobsServerTransport trJobsExecutionsServer *JobsExecutionsServerTransport @@ -184,6 +192,16 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewContainerAppsAuthConfigsServerTransport(&s.srv.ContainerAppsAuthConfigsServer) }) resp, err = s.trContainerAppsAuthConfigsServer.Do(req) + case "ContainerAppsBuildsByContainerAppClient": + initServer(s, &s.trContainerAppsBuildsByContainerAppServer, func() *ContainerAppsBuildsByContainerAppServerTransport { + return NewContainerAppsBuildsByContainerAppServerTransport(&s.srv.ContainerAppsBuildsByContainerAppServer) + }) + resp, err = s.trContainerAppsBuildsByContainerAppServer.Do(req) + case "ContainerAppsBuildsClient": + initServer(s, &s.trContainerAppsBuildsServer, func() *ContainerAppsBuildsServerTransport { + return NewContainerAppsBuildsServerTransport(&s.srv.ContainerAppsBuildsServer) + }) + resp, err = s.trContainerAppsBuildsServer.Do(req) case "ContainerAppsClient": initServer(s, &s.trContainerAppsServer, func() *ContainerAppsServerTransport { return NewContainerAppsServerTransport(&s.srv.ContainerAppsServer) @@ -194,6 +212,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewContainerAppsDiagnosticsServerTransport(&s.srv.ContainerAppsDiagnosticsServer) }) resp, err = s.trContainerAppsDiagnosticsServer.Do(req) + case "ContainerAppsPatchesClient": + initServer(s, &s.trContainerAppsPatchesServer, func() *ContainerAppsPatchesServerTransport { + return NewContainerAppsPatchesServerTransport(&s.srv.ContainerAppsPatchesServer) + }) + resp, err = s.trContainerAppsPatchesServer.Do(req) case "ContainerAppsRevisionReplicasClient": initServer(s, &s.trContainerAppsRevisionReplicasServer, func() *ContainerAppsRevisionReplicasServerTransport { return NewContainerAppsRevisionReplicasServerTransport(&s.srv.ContainerAppsRevisionReplicasServer) @@ -229,6 +252,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewDotNetComponentsServerTransport(&s.srv.DotNetComponentsServer) }) resp, err = s.trDotNetComponentsServer.Do(req) + case "FunctionsExtensionClient": + initServer(s, &s.trFunctionsExtensionServer, func() *FunctionsExtensionServerTransport { + return NewFunctionsExtensionServerTransport(&s.srv.FunctionsExtensionServer) + }) + resp, err = s.trFunctionsExtensionServer.Do(req) case "JavaComponentsClient": initServer(s, &s.trJavaComponentsServer, func() *JavaComponentsServerTransport { return NewJavaComponentsServerTransport(&s.srv.JavaComponentsServer) diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/functionsextension_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/functionsextension_client.go new file mode 100644 index 000000000000..ff89a0e82ec2 --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/functionsextension_client.go @@ -0,0 +1,119 @@ +//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 armappcontainers + +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" +) + +// FunctionsExtensionClient contains the methods for the FunctionsExtension group. +// Don't use this type directly, use NewFunctionsExtensionClient() instead. +type FunctionsExtensionClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFunctionsExtensionClient creates a new instance of FunctionsExtensionClient 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 NewFunctionsExtensionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FunctionsExtensionClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FunctionsExtensionClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// InvokeFunctionsHost - Proxies a Functions host call to the function app backed by the container app. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-02-02-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - revisionName - Name of the Container App Revision, the parent resource. +// - functionAppName - Name of the Function App, the extension resource. +// - options - FunctionsExtensionClientInvokeFunctionsHostOptions contains the optional parameters for the FunctionsExtensionClient.InvokeFunctionsHost +// method. +func (client *FunctionsExtensionClient) InvokeFunctionsHost(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, functionAppName string, options *FunctionsExtensionClientInvokeFunctionsHostOptions) (FunctionsExtensionClientInvokeFunctionsHostResponse, error) { + var err error + const operationName = "FunctionsExtensionClient.InvokeFunctionsHost" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.invokeFunctionsHostCreateRequest(ctx, resourceGroupName, containerAppName, revisionName, functionAppName, options) + if err != nil { + return FunctionsExtensionClientInvokeFunctionsHostResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FunctionsExtensionClientInvokeFunctionsHostResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FunctionsExtensionClientInvokeFunctionsHostResponse{}, err + } + resp, err := client.invokeFunctionsHostHandleResponse(httpResp) + return resp, err +} + +// invokeFunctionsHostCreateRequest creates the InvokeFunctionsHost request. +func (client *FunctionsExtensionClient) invokeFunctionsHostCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, functionAppName string, options *FunctionsExtensionClientInvokeFunctionsHostOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/providers/Microsoft.App/functions/{functionAppName}/invoke" + 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 containerAppName == "" { + return nil, errors.New("parameter containerAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(containerAppName)) + if revisionName == "" { + return nil, errors.New("parameter revisionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{revisionName}", url.PathEscape(revisionName)) + if functionAppName == "" { + return nil, errors.New("parameter functionAppName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{functionAppName}", url.PathEscape(functionAppName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-02-02-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// invokeFunctionsHostHandleResponse handles the InvokeFunctionsHost response. +func (client *FunctionsExtensionClient) invokeFunctionsHostHandleResponse(resp *http.Response) (FunctionsExtensionClientInvokeFunctionsHostResponse, error) { + result := FunctionsExtensionClientInvokeFunctionsHostResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { + return FunctionsExtensionClientInvokeFunctionsHostResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/go.mod b/sdk/resourcemanager/appcontainers/armappcontainers/go.mod index 4639c7b285f3..55d8aa191de6 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/go.mod +++ b/sdk/resourcemanager/appcontainers/armappcontainers/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armap go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect - github.com/golang-jwt/jwt/v5 v5.2.0 // indirect - github.com/google/uuid v1.5.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.19.0 // indirect golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect ) diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/go.sum b/sdk/resourcemanager/appcontainers/armappcontainers/go.sum index a4a966ae2630..8e1b70aaca5f 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/go.sum +++ b/sdk/resourcemanager/appcontainers/armappcontainers/go.sum @@ -1,31 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 h1:c4k2FIYIh4xtwqrQwV0Ct1v5+ehlNXj5NI/MWVsiTkQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2/go.mod h1:5FDJtLEO/GxwNgUxbwrY3LP0pEoThTQJtk2oysdXHxM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 h1:LqbJ/WzJUwBf8UiaSzgX7aMclParm9/5Vgp+TY51uBQ= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2/go.mod h1:yInRyqWXAuaPrgI7p70+lDDgh3mlBohis29jGMISnmc= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= -github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= -github.com/google/uuid v1.5.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.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/interfaces.go b/sdk/resourcemanager/appcontainers/armappcontainers/interfaces.go new file mode 100644 index 000000000000..a213bf253d1f --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/interfaces.go @@ -0,0 +1,18 @@ +//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 armappcontainers + +// JavaComponentPropertiesClassification provides polymorphic access to related types. +// Call the interface's GetJavaComponentProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *JavaComponentProperties, *NacosComponent, *SpringBootAdminComponent, *SpringCloudConfigComponent, *SpringCloudEurekaComponent +type JavaComponentPropertiesClassification interface { + // GetJavaComponentProperties returns the JavaComponentProperties content of the underlying type. + GetJavaComponentProperties() *JavaComponentProperties +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client.go index 13624f355cf1..2c3ee0d1d10d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client.go @@ -46,7 +46,7 @@ func NewJavaComponentsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates a Java Component in a Managed Environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - name - Name of the Java Component. @@ -74,7 +74,7 @@ func (client *JavaComponentsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates a Java Component in a Managed Environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *JavaComponentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, name string, javaComponentEnvelope JavaComponent, options *JavaComponentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "JavaComponentsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *JavaComponentsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, javaComponentEnvelope); err != nil { @@ -132,7 +132,7 @@ func (client *JavaComponentsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Delete a Java Component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - name - Name of the Java Component. @@ -159,7 +159,7 @@ func (client *JavaComponentsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Delete a Java Component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *JavaComponentsClient) deleteOperation(ctx context.Context, resourceGroupName string, environmentName string, name string, options *JavaComponentsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "JavaComponentsClient.BeginDelete" @@ -205,7 +205,7 @@ func (client *JavaComponentsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *JavaComponentsClient) deleteCreateRequest(ctx context.Context, res // Get - Get a Java Component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - name - Name of the Java Component. @@ -265,7 +265,7 @@ func (client *JavaComponentsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *JavaComponentsClient) getHandleResponse(resp *http.Response) (Java // NewListPager - Get the Java Components for a managed environment. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - options - JavaComponentsClientListOptions contains the optional parameters for the JavaComponentsClient.NewListPager method. @@ -329,7 +329,7 @@ func (client *JavaComponentsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +347,7 @@ func (client *JavaComponentsClient) listHandleResponse(resp *http.Response) (Jav // BeginUpdate - Patches a Java Component using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - name - Name of the Java Component. @@ -374,7 +374,7 @@ func (client *JavaComponentsClient) BeginUpdate(ctx context.Context, resourceGro // Update - Patches a Java Component using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *JavaComponentsClient) update(ctx context.Context, resourceGroupName string, environmentName string, name string, javaComponentEnvelope JavaComponent, options *JavaComponentsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "JavaComponentsClient.BeginUpdate" @@ -420,7 +420,7 @@ func (client *JavaComponentsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, javaComponentEnvelope); err != nil { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client_example_test.go deleted file mode 100644 index 12d753047fbe..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client_example_test.go +++ /dev/null @@ -1,491 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_List.json -func ExampleJavaComponentsClient_NewListPager_listJavaComponents() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJavaComponentsClient().NewListPager("examplerg", "myenvironment", 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.JavaComponentsCollection = armappcontainers.JavaComponentsCollection{ - // Value: []*armappcontainers.JavaComponent{ - // { - // Name: to.Ptr("blueshark"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/javaComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/blueshark"), - // Properties: &armappcontainers.JavaComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringBootAdmin), - // Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("spring.boot.admin.ui.enable-toasts"), - // Value: to.Ptr("true"), - // }, - // { - // PropertyName: to.Ptr("spring.boot.admin.monitor.status-interval"), - // Value: to.Ptr("10000ms"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.JavaComponentProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("yellowcat"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/javaComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat"), - // Properties: &armappcontainers.JavaComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringCloudEureka), - // Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("spring.cloud.config.server.git.uri"), - // Value: to.Ptr(""), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.JavaComponentProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_List_ServiceBind.json -func ExampleJavaComponentsClient_NewListPager_listJavaComponentsWithServiceBinds() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJavaComponentsClient().NewListPager("examplerg", "myenvironment", 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.JavaComponentsCollection = armappcontainers.JavaComponentsCollection{ - // Value: []*armappcontainers.JavaComponent{ - // { - // Name: to.Ptr("blueshark"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/javaComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/blueshark"), - // Properties: &armappcontainers.JavaComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringBootAdmin), - // Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("spring.boot.admin.ui.enable-toasts"), - // Value: to.Ptr("true"), - // }, - // { - // PropertyName: to.Ptr("spring.boot.admin.monitor.status-interval"), - // Value: to.Ptr("10000ms"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.JavaComponentProvisioningStateSucceeded), - // ServiceBinds: []*armappcontainers.JavaComponentServiceBind{ - // { - // Name: to.Ptr("yellowcat"), - // ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("yellowcat"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/javaComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat"), - // Properties: &armappcontainers.JavaComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringCloudEureka), - // Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("spring.cloud.config.server.git.uri"), - // Value: to.Ptr(""), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.JavaComponentProvisioningStateSucceeded), - // ServiceBinds: []*armappcontainers.JavaComponentServiceBind{ - // { - // Name: to.Ptr("blueshark"), - // ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/blueshark"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Get.json -func ExampleJavaComponentsClient_Get_getJavaComponent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJavaComponentsClient().Get(ctx, "examplerg", "myenvironment", "myjavacomponent", 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.JavaComponent = armappcontainers.JavaComponent{ - // Name: to.Ptr("myjavacomponent"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/javaComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/myjavacomponent"), - // Properties: &armappcontainers.JavaComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringBootAdmin), - // Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("spring.boot.admin.ui.enable-toasts"), - // Value: to.Ptr("true"), - // }, - // { - // PropertyName: to.Ptr("spring.boot.admin.monitor.status-interval"), - // Value: to.Ptr("10000ms"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.JavaComponentProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Get_ServiceBind.json -func ExampleJavaComponentsClient_Get_getJavaComponentWithServiceBinds() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJavaComponentsClient().Get(ctx, "examplerg", "myenvironment", "myjavacomponent", 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.JavaComponent = armappcontainers.JavaComponent{ - // Name: to.Ptr("myjavacomponent"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/javaComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/myjavacomponent"), - // Properties: &armappcontainers.JavaComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringBootAdmin), - // Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("spring.boot.admin.ui.enable-toasts"), - // Value: to.Ptr("true"), - // }, - // { - // PropertyName: to.Ptr("spring.boot.admin.monitor.status-interval"), - // Value: to.Ptr("10000ms"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.JavaComponentProvisioningStateSucceeded), - // ServiceBinds: []*armappcontainers.JavaComponentServiceBind{ - // { - // Name: to.Ptr("yellowcat"), - // ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_CreateOrUpdate.json -func ExampleJavaComponentsClient_BeginCreateOrUpdate_createOrUpdateJavaComponent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJavaComponentsClient().BeginCreateOrUpdate(ctx, "examplerg", "myenvironment", "myjavacomponent", armappcontainers.JavaComponent{ - Properties: &armappcontainers.JavaComponentProperties{ - ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringBootAdmin), - Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - { - PropertyName: to.Ptr("spring.boot.admin.ui.enable-toasts"), - Value: to.Ptr("true"), - }, - { - PropertyName: to.Ptr("spring.boot.admin.monitor.status-interval"), - Value: to.Ptr("10000ms"), - }}, - }, - }, 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.JavaComponent = armappcontainers.JavaComponent{ - // Name: to.Ptr("myjavacomponent"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/javaComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/myjavacomponent"), - // Properties: &armappcontainers.JavaComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringBootAdmin), - // Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("spring.boot.admin.ui.enable-toasts"), - // Value: to.Ptr("true"), - // }, - // { - // PropertyName: to.Ptr("spring.boot.admin.monitor.status-interval"), - // Value: to.Ptr("10000ms"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.JavaComponentProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_CreateOrUpdate_ServiceBind.json -func ExampleJavaComponentsClient_BeginCreateOrUpdate_createOrUpdateJavaComponentWithServiceBinds() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJavaComponentsClient().BeginCreateOrUpdate(ctx, "examplerg", "myenvironment", "myjavacomponent", armappcontainers.JavaComponent{ - Properties: &armappcontainers.JavaComponentProperties{ - ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringBootAdmin), - Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - { - PropertyName: to.Ptr("spring.boot.admin.ui.enable-toasts"), - Value: to.Ptr("true"), - }, - { - PropertyName: to.Ptr("spring.boot.admin.monitor.status-interval"), - Value: to.Ptr("10000ms"), - }}, - ServiceBinds: []*armappcontainers.JavaComponentServiceBind{ - { - Name: to.Ptr("yellowcat"), - ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat"), - }}, - }, - }, 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.JavaComponent = armappcontainers.JavaComponent{ - // Name: to.Ptr("myjavacomponent"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/javaComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/myjavacomponent"), - // Properties: &armappcontainers.JavaComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringBootAdmin), - // Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("spring.boot.admin.ui.enable-toasts"), - // Value: to.Ptr("true"), - // }, - // { - // PropertyName: to.Ptr("spring.boot.admin.monitor.status-interval"), - // Value: to.Ptr("10000ms"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.JavaComponentProvisioningStateSucceeded), - // ServiceBinds: []*armappcontainers.JavaComponentServiceBind{ - // { - // Name: to.Ptr("yellowcat"), - // ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Patch.json -func ExampleJavaComponentsClient_BeginUpdate_patchJavaComponent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJavaComponentsClient().BeginUpdate(ctx, "examplerg", "myenvironment", "myjavacomponent", armappcontainers.JavaComponent{ - Properties: &armappcontainers.JavaComponentProperties{ - ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringBootAdmin), - Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - { - PropertyName: to.Ptr("spring.boot.admin.ui.enable-toasts"), - Value: to.Ptr("true"), - }, - { - PropertyName: to.Ptr("spring.boot.admin.monitor.status-interval"), - Value: to.Ptr("10000ms"), - }}, - }, - }, 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.JavaComponent = armappcontainers.JavaComponent{ - // Name: to.Ptr("myjavacomponent"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/javaComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/myjavacomponent"), - // Properties: &armappcontainers.JavaComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringBootAdmin), - // Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("spring.boot.admin.ui.enable-toasts"), - // Value: to.Ptr("true"), - // }, - // { - // PropertyName: to.Ptr("spring.boot.admin.monitor.status-interval"), - // Value: to.Ptr("10000ms"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.JavaComponentProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Patch_ServiceBind.json -func ExampleJavaComponentsClient_BeginUpdate_patchJavaComponentWithServiceBinds() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJavaComponentsClient().BeginUpdate(ctx, "examplerg", "myenvironment", "myjavacomponent", armappcontainers.JavaComponent{ - Properties: &armappcontainers.JavaComponentProperties{ - ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringBootAdmin), - Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - { - PropertyName: to.Ptr("spring.boot.admin.ui.enable-toasts"), - Value: to.Ptr("true"), - }, - { - PropertyName: to.Ptr("spring.boot.admin.monitor.status-interval"), - Value: to.Ptr("10000ms"), - }}, - ServiceBinds: []*armappcontainers.JavaComponentServiceBind{ - { - Name: to.Ptr("yellowcat"), - ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat"), - }}, - }, - }, 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.JavaComponent = armappcontainers.JavaComponent{ - // Name: to.Ptr("myjavacomponent"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/javaComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/myjavacomponent"), - // Properties: &armappcontainers.JavaComponentProperties{ - // ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringBootAdmin), - // Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("spring.boot.admin.ui.enable-toasts"), - // Value: to.Ptr("true"), - // }, - // { - // PropertyName: to.Ptr("spring.boot.admin.monitor.status-interval"), - // Value: to.Ptr("10000ms"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.JavaComponentProvisioningStateSucceeded), - // ServiceBinds: []*armappcontainers.JavaComponentServiceBind{ - // { - // Name: to.Ptr("yellowcat"), - // ServiceID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/JavaComponents_Delete.json -func ExampleJavaComponentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJavaComponentsClient().BeginDelete(ctx, "examplerg", "myenvironment", "myjavacomponent", 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/appcontainers/armappcontainers/jobs_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client.go index d19cd55c99e2..888bbee51d8c 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client.go @@ -46,7 +46,7 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // BeginCreateOrUpdate - Create or Update a Container Apps Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - jobEnvelope - Properties used to create a container apps job @@ -73,7 +73,7 @@ func (client *JobsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroup // CreateOrUpdate - Create or Update a Container Apps Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *JobsClient) createOrUpdate(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope Job, options *JobsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "JobsClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *JobsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, jobEnvelope); err != nil { @@ -127,7 +127,7 @@ func (client *JobsClient) createOrUpdateCreateRequest(ctx context.Context, resou // BeginDelete - Delete a Container Apps Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - options - JobsClientBeginDeleteOptions contains the optional parameters for the JobsClient.BeginDelete method. @@ -152,7 +152,7 @@ func (client *JobsClient) BeginDelete(ctx context.Context, resourceGroupName str // Delete - Delete a Container Apps Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *JobsClient) deleteOperation(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "JobsClient.BeginDelete" @@ -194,7 +194,7 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +203,7 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Get the properties of a Container Apps Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. @@ -249,7 +249,7 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +267,7 @@ func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetR // GetDetector - Get the diagnostics data for a Container App Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - detectorName - Name of the Container App Job detector. @@ -318,7 +318,7 @@ func (client *JobsClient) getDetectorCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,7 +335,7 @@ func (client *JobsClient) getDetectorHandleResponse(resp *http.Response) (JobsCl // NewListByResourceGroupPager - Get the Container Apps Jobs in a given resource group. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - JobsClientListByResourceGroupOptions contains the optional parameters for the JobsClient.NewListByResourceGroupPager // method. @@ -378,7 +378,7 @@ func (client *JobsClient) listByResourceGroupCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -395,7 +395,7 @@ func (client *JobsClient) listByResourceGroupHandleResponse(resp *http.Response) // NewListBySubscriptionPager - Get the Container Apps Jobs in a given subscription. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - options - JobsClientListBySubscriptionOptions contains the optional parameters for the JobsClient.NewListBySubscriptionPager // method. func (client *JobsClient) NewListBySubscriptionPager(options *JobsClientListBySubscriptionOptions) *runtime.Pager[JobsClientListBySubscriptionResponse] { @@ -433,7 +433,7 @@ func (client *JobsClient) listBySubscriptionCreateRequest(ctx context.Context, o return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -451,7 +451,7 @@ func (client *JobsClient) listBySubscriptionHandleResponse(resp *http.Response) // ListDetectors - Get the list of diagnostics for a Container App Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - options - JobsClientListDetectorsOptions contains the optional parameters for the JobsClient.ListDetectors method. @@ -497,7 +497,7 @@ func (client *JobsClient) listDetectorsCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -515,7 +515,7 @@ func (client *JobsClient) listDetectorsHandleResponse(resp *http.Response) (Jobs // ListSecrets - List secrets for a container apps job // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - options - JobsClientListSecretsOptions contains the optional parameters for the JobsClient.ListSecrets method. @@ -561,7 +561,7 @@ func (client *JobsClient) listSecretsCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -579,7 +579,7 @@ func (client *JobsClient) listSecretsHandleResponse(resp *http.Response) (JobsCl // ProxyGet - Get the properties of a Container App Job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - options - JobsClientProxyGetOptions contains the optional parameters for the JobsClient.ProxyGet method. @@ -626,7 +626,7 @@ func (client *JobsClient) proxyGetCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -644,7 +644,7 @@ func (client *JobsClient) proxyGetHandleResponse(resp *http.Response) (JobsClien // BeginStart - Start a Container Apps Job // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - options - JobsClientBeginStartOptions contains the optional parameters for the JobsClient.BeginStart method. @@ -669,7 +669,7 @@ func (client *JobsClient) BeginStart(ctx context.Context, resourceGroupName stri // Start - Start a Container Apps Job // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *JobsClient) start(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "JobsClient.BeginStart" @@ -711,7 +711,7 @@ func (client *JobsClient) startCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Template != nil { @@ -726,7 +726,7 @@ func (client *JobsClient) startCreateRequest(ctx context.Context, resourceGroupN // BeginStopExecution - Terminates execution of a running container apps job // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - jobExecutionName - Job execution name. @@ -752,7 +752,7 @@ func (client *JobsClient) BeginStopExecution(ctx context.Context, resourceGroupN // StopExecution - Terminates execution of a running container apps job // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *JobsClient) stopExecution(ctx context.Context, resourceGroupName string, jobName string, jobExecutionName string, options *JobsClientBeginStopExecutionOptions) (*http.Response, error) { var err error const operationName = "JobsClient.BeginStopExecution" @@ -798,7 +798,7 @@ func (client *JobsClient) stopExecutionCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -807,7 +807,7 @@ func (client *JobsClient) stopExecutionCreateRequest(ctx context.Context, resour // BeginStopMultipleExecutions - Terminates execution of a running container apps job // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - options - JobsClientBeginStopMultipleExecutionsOptions contains the optional parameters for the JobsClient.BeginStopMultipleExecutions @@ -833,7 +833,7 @@ func (client *JobsClient) BeginStopMultipleExecutions(ctx context.Context, resou // StopMultipleExecutions - Terminates execution of a running container apps job // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *JobsClient) stopMultipleExecutions(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginStopMultipleExecutionsOptions) (*http.Response, error) { var err error const operationName = "JobsClient.BeginStopMultipleExecutions" @@ -875,7 +875,7 @@ func (client *JobsClient) stopMultipleExecutionsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -884,7 +884,7 @@ func (client *JobsClient) stopMultipleExecutionsCreateRequest(ctx context.Contex // BeginUpdate - Patches a Container Apps Job using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - jobEnvelope - Properties used to create a container apps job @@ -909,7 +909,7 @@ func (client *JobsClient) BeginUpdate(ctx context.Context, resourceGroupName str // Update - Patches a Container Apps Job using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *JobsClient) update(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope JobPatchProperties, options *JobsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "JobsClient.BeginUpdate" @@ -951,7 +951,7 @@ func (client *JobsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, jobEnvelope); err != nil { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client_example_test.go deleted file mode 100644 index 10a105eaef9a..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client_example_test.go +++ /dev/null @@ -1,1215 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_ListDetectors.json -func ExampleJobsClient_ListDetectors() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().ListDetectors(ctx, "mikono-workerapp-test-rg", "mikonojob1", 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.DiagnosticsCollection = armappcontainers.DiagnosticsCollection{ - // Value: []*armappcontainers.Diagnostics{ - // { - // Name: to.Ptr("cappjobContainerAppAvailabilityMetrics"), - // Type: to.Ptr("Microsoft.App/containerapps/detectors"), - // ID: to.Ptr("/subscriptions/f07f3711-b45e-40fe-a941-4e6d93f851e6/resourceGroups/mikono-workerapp-test-rg/providers/Microsoft.App/jobs/mikonojob1/detectors/cappjobContainerAppAvailabilityMetrics"), - // Properties: &armappcontainers.DiagnosticsProperties{ - // Dataset: []*armappcontainers.DiagnosticsDataAPIResponse{ - // }, - // Metadata: &armappcontainers.DiagnosticsDefinition{ - // Name: to.Ptr("Availability Metrics for Container App Jobs"), - // Type: to.Ptr("Analysis"), - // Author: to.Ptr(""), - // Category: to.Ptr("Availability and Performance"), - // ID: to.Ptr("cappjobContainerAppAvailabilityMetrics"), - // Score: to.Ptr[float32](0), - // SupportTopicList: []*armappcontainers.DiagnosticSupportTopic{ - // }, - // }, - // Status: &armappcontainers.DiagnosticsStatus{ - // StatusID: to.Ptr[int32](4), - // }, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_GetDetector.json -func ExampleJobsClient_GetDetector() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().GetDetector(ctx, "mikono-workerapp-test-rg", "mikonojob1", "containerappjobnetworkIO", 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.Diagnostics = armappcontainers.Diagnostics{ - // Name: to.Ptr("containerappjobnetworkIO"), - // Type: to.Ptr("Microsoft.App/jobs/detectors"), - // ID: to.Ptr("/subscriptions/f07f3711-b45e-40fe-a941-4e6d93f851e6/resourceGroups/mikono-workerapp-test-rg/providers/Microsoft.App/jobs/mikonojob1/detectors/containerappjobnetworkIO"), - // Properties: &armappcontainers.DiagnosticsProperties{ - // Dataset: []*armappcontainers.DiagnosticsDataAPIResponse{ - // { - // RenderingProperties: &armappcontainers.DiagnosticRendering{ - // Type: to.Ptr[int32](8), - // Description: to.Ptr(""), - // IsVisible: to.Ptr(true), - // Title: to.Ptr("Container App Job Network Inbound "), - // }, - // Table: &armappcontainers.DiagnosticDataTableResponseObject{ - // Columns: []*armappcontainers.DiagnosticDataTableResponseColumn{ - // { - // ColumnName: to.Ptr("TimeStamp"), - // DataType: to.Ptr("DateTime"), - // }, - // { - // ColumnName: to.Ptr("Metric"), - // DataType: to.Ptr("String"), - // }, - // { - // ColumnName: to.Ptr("Average"), - // DataType: to.Ptr("Double"), - // }}, - // Rows: []any{ - // []any{ - // "2022-03-15T21:35:00", - // "RxBytes", - // float64(0), - // }}, - // TableName: to.Ptr(""), - // }, - // }}, - // Metadata: &armappcontainers.DiagnosticsDefinition{ - // Name: to.Ptr("Container App Job Network Inbound and Outbound"), - // Type: to.Ptr("Detector"), - // Description: to.Ptr("This detector shows the Container App Job Network Inbound and Outbound."), - // Author: to.Ptr(""), - // Category: to.Ptr("Availability and Performance"), - // ID: to.Ptr("containerappjobnetworkIO"), - // Score: to.Ptr[float32](0), - // SupportTopicList: []*armappcontainers.DiagnosticSupportTopic{ - // }, - // }, - // Status: &armappcontainers.DiagnosticsStatus{ - // StatusID: to.Ptr[int32](3), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_ProxyGet.json -func ExampleJobsClient_ProxyGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().ProxyGet(ctx, "rg", "testcontainerAppsJob0", 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.Job = armappcontainers.Job{ - // Name: to.Ptr("testcontainerAppsJob0"), - // Type: to.Ptr("Microsoft.App/jobs"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0/detectorproperties/rootApi"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.JobProperties{ - // Configuration: &armappcontainers.JobConfiguration{ - // ManualTriggerConfig: &armappcontainers.JobConfigurationManualTriggerConfig{ - // Parallelism: to.Ptr[int32](4), - // ReplicaCompletionCount: to.Ptr[int32](1), - // }, - // ReplicaRetryLimit: to.Ptr[int32](10), - // ReplicaTimeout: to.Ptr[int32](10), - // TriggerType: to.Ptr(armappcontainers.TriggerTypeManual), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.JobProvisioningStateSucceeded), - // Template: &armappcontainers.JobTemplate{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Jobs_ListBySubscription.json -func ExampleJobsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobsClient().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.JobsCollection = armappcontainers.JobsCollection{ - // Value: []*armappcontainers.Job{ - // { - // Name: to.Ptr("testcontainerAppsJob0"), - // Type: to.Ptr("Microsoft.App/jobs"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.JobProperties{ - // Configuration: &armappcontainers.JobConfiguration{ - // ManualTriggerConfig: &armappcontainers.JobConfigurationManualTriggerConfig{ - // Parallelism: to.Ptr[int32](4), - // ReplicaCompletionCount: to.Ptr[int32](1), - // }, - // ReplicaRetryLimit: to.Ptr[int32](10), - // ReplicaTimeout: to.Ptr[int32](10), - // TriggerType: to.Ptr(armappcontainers.TriggerTypeManual), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.JobProvisioningStateSucceeded), - // Template: &armappcontainers.JobTemplate{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("testcontainerAppsJob1"), - // Type: to.Ptr("Microsoft.App/jobs"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob1"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.JobProperties{ - // Configuration: &armappcontainers.JobConfiguration{ - // ReplicaRetryLimit: to.Ptr[int32](10), - // ReplicaTimeout: to.Ptr[int32](10), - // ScheduleTriggerConfig: &armappcontainers.JobConfigurationScheduleTriggerConfig{ - // CronExpression: to.Ptr("* * * * 5"), - // Parallelism: to.Ptr[int32](5), - // ReplicaCompletionCount: to.Ptr[int32](1), - // }, - // TriggerType: to.Ptr(armappcontainers.TriggerType("Scheduled")), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.JobProvisioningStateSucceeded), - // Template: &armappcontainers.JobTemplate{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerAppsJob1"), - // Image: to.Ptr("repo/testcontainerAppsJob1:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerAppsJob1"), - // Image: to.Ptr("repo/testcontainerAppsJob1:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Jobs_ListByResourceGroup.json -func ExampleJobsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobsClient().NewListByResourceGroupPager("rg", 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.JobsCollection = armappcontainers.JobsCollection{ - // Value: []*armappcontainers.Job{ - // { - // Name: to.Ptr("testcontainerAppsJob0"), - // Type: to.Ptr("Microsoft.App/jobs"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.JobProperties{ - // Configuration: &armappcontainers.JobConfiguration{ - // ManualTriggerConfig: &armappcontainers.JobConfigurationManualTriggerConfig{ - // Parallelism: to.Ptr[int32](4), - // ReplicaCompletionCount: to.Ptr[int32](1), - // }, - // ReplicaRetryLimit: to.Ptr[int32](10), - // ReplicaTimeout: to.Ptr[int32](10), - // TriggerType: to.Ptr(armappcontainers.TriggerTypeManual), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.JobProvisioningStateSucceeded), - // Template: &armappcontainers.JobTemplate{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("testcontainerAppsJob1"), - // Type: to.Ptr("Microsoft.App/jobs"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob1"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.JobProperties{ - // Configuration: &armappcontainers.JobConfiguration{ - // ReplicaRetryLimit: to.Ptr[int32](10), - // ReplicaTimeout: to.Ptr[int32](10), - // ScheduleTriggerConfig: &armappcontainers.JobConfigurationScheduleTriggerConfig{ - // CronExpression: to.Ptr("* * * * 5"), - // Parallelism: to.Ptr[int32](4), - // ReplicaCompletionCount: to.Ptr[int32](1), - // }, - // TriggerType: to.Ptr(armappcontainers.TriggerType("Scheduled")), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.JobProvisioningStateSucceeded), - // Template: &armappcontainers.JobTemplate{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("repo/testcontainerAppsJob1:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerApp0"), - // Image: to.Ptr("repo/testinitcontainerAppsJob1:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Get.json -func ExampleJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().Get(ctx, "rg", "testcontainerAppsJob0", 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.Job = armappcontainers.Job{ - // Name: to.Ptr("testcontainerAppsJob0"), - // Type: to.Ptr("Microsoft.App/jobs"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.JobProperties{ - // Configuration: &armappcontainers.JobConfiguration{ - // ManualTriggerConfig: &armappcontainers.JobConfigurationManualTriggerConfig{ - // Parallelism: to.Ptr[int32](4), - // ReplicaCompletionCount: to.Ptr[int32](1), - // }, - // ReplicaRetryLimit: to.Ptr[int32](10), - // ReplicaTimeout: to.Ptr[int32](10), - // TriggerType: to.Ptr(armappcontainers.TriggerTypeManual), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.JobProvisioningStateSucceeded), - // Template: &armappcontainers.JobTemplate{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // VolumeMounts: []*armappcontainers.VolumeMount{ - // { - // MountPath: to.Ptr("/mnt/path1"), - // SubPath: to.Ptr("subPath1"), - // VolumeName: to.Ptr("azurefile"), - // }, - // { - // MountPath: to.Ptr("/mnt/path2"), - // SubPath: to.Ptr("subPath2"), - // VolumeName: to.Ptr("nfsazurefile"), - // }}, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Volumes: []*armappcontainers.Volume{ - // { - // Name: to.Ptr("azurefile"), - // StorageName: to.Ptr("storage"), - // StorageType: to.Ptr(armappcontainers.StorageTypeAzureFile), - // }, - // { - // Name: to.Ptr("nfsazurefile"), - // StorageName: to.Ptr("nfsStorage"), - // StorageType: to.Ptr(armappcontainers.StorageTypeNfsAzureFile), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_CreateorUpdate.json -func ExampleJobsClient_BeginCreateOrUpdate_createOrUpdateContainerAppsJob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerAppsJob0", armappcontainers.Job{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.JobProperties{ - Configuration: &armappcontainers.JobConfiguration{ - ManualTriggerConfig: &armappcontainers.JobConfigurationManualTriggerConfig{ - Parallelism: to.Ptr[int32](4), - ReplicaCompletionCount: to.Ptr[int32](1), - }, - ReplicaRetryLimit: to.Ptr[int32](10), - ReplicaTimeout: to.Ptr[int32](10), - TriggerType: to.Ptr(armappcontainers.TriggerTypeManual), - }, - EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - Template: &armappcontainers.JobTemplate{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerAppsJob0"), - Image: to.Ptr("repo/testcontainerAppsJob0:v1"), - VolumeMounts: []*armappcontainers.VolumeMount{ - { - MountPath: to.Ptr("/mnt/path1"), - SubPath: to.Ptr("subPath1"), - VolumeName: to.Ptr("azurefile"), - }, - { - MountPath: to.Ptr("/mnt/path2"), - SubPath: to.Ptr("subPath2"), - VolumeName: to.Ptr("nfsazurefile"), - }}, - Probes: []*armappcontainers.ContainerAppProbe{ - { - Type: to.Ptr(armappcontainers.TypeLiveness), - HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{ - Path: to.Ptr("/health"), - HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{ - { - Name: to.Ptr("Custom-Header"), - Value: to.Ptr("Awesome"), - }}, - Port: to.Ptr[int32](8080), - }, - InitialDelaySeconds: to.Ptr[int32](5), - PeriodSeconds: to.Ptr[int32](3), - }}, - }}, - InitContainers: []*armappcontainers.InitContainer{ - { - Name: to.Ptr("testinitcontainerAppsJob0"), - Args: []*string{ - to.Ptr("-c"), - to.Ptr("while true; do echo hello; sleep 10;done")}, - Command: []*string{ - to.Ptr("/bin/sh")}, - Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - Resources: &armappcontainers.ContainerResources{ - CPU: to.Ptr[float64](0.2), - Memory: to.Ptr("100Mi"), - }, - }}, - }, - }, - }, 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.Job = armappcontainers.Job{ - // Name: to.Ptr("testcontainerAppsJob0"), - // Type: to.Ptr("Microsoft.App/jobs"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.JobProperties{ - // Configuration: &armappcontainers.JobConfiguration{ - // ManualTriggerConfig: &armappcontainers.JobConfigurationManualTriggerConfig{ - // Parallelism: to.Ptr[int32](4), - // ReplicaCompletionCount: to.Ptr[int32](1), - // }, - // ReplicaRetryLimit: to.Ptr[int32](10), - // ReplicaTimeout: to.Ptr[int32](10), - // TriggerType: to.Ptr(armappcontainers.TriggerTypeManual), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // ProvisioningState: to.Ptr(armappcontainers.JobProvisioningStateSucceeded), - // Template: &armappcontainers.JobTemplate{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // VolumeMounts: []*armappcontainers.VolumeMount{ - // { - // MountPath: to.Ptr("/mnt/path1"), - // SubPath: to.Ptr("subPath1"), - // VolumeName: to.Ptr("azurefile"), - // }, - // { - // MountPath: to.Ptr("/mnt/path2"), - // SubPath: to.Ptr("subPath2"), - // VolumeName: to.Ptr("nfsazurefile"), - // }}, - // Probes: []*armappcontainers.ContainerAppProbe{ - // { - // Type: to.Ptr(armappcontainers.TypeLiveness), - // HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{ - // Path: to.Ptr("/health"), - // HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{ - // { - // Name: to.Ptr("Custom-Header"), - // Value: to.Ptr("Awesome"), - // }}, - // Port: to.Ptr[int32](8080), - // }, - // InitialDelaySeconds: to.Ptr[int32](3), - // PeriodSeconds: to.Ptr[int32](3), - // }}, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerAppsJob0"), - // Args: []*string{ - // to.Ptr("-c"), - // to.Ptr("while true; do echo hello; sleep 10;done")}, - // Command: []*string{ - // to.Ptr("/bin/sh")}, - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Volumes: []*armappcontainers.Volume{ - // { - // Name: to.Ptr("azurefile"), - // StorageName: to.Ptr("storage"), - // StorageType: to.Ptr(armappcontainers.StorageTypeAzureFile), - // }, - // { - // Name: to.Ptr("nfsazurefile"), - // StorageName: to.Ptr("nfsStorage"), - // StorageType: to.Ptr(armappcontainers.StorageTypeNfsAzureFile), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_CreateorUpdate_ConnectedEnvironment.json -func ExampleJobsClient_BeginCreateOrUpdate_createOrUpdateContainerAppsJobOnAConnectedEnvironment() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerAppsJob0", armappcontainers.Job{ - Location: to.Ptr("East US"), - ExtendedLocation: &armappcontainers.ExtendedLocation{ - Name: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"), - Type: to.Ptr(armappcontainers.ExtendedLocationTypesCustomLocation), - }, - Properties: &armappcontainers.JobProperties{ - Configuration: &armappcontainers.JobConfiguration{ - ManualTriggerConfig: &armappcontainers.JobConfigurationManualTriggerConfig{ - Parallelism: to.Ptr[int32](4), - ReplicaCompletionCount: to.Ptr[int32](1), - }, - ReplicaRetryLimit: to.Ptr[int32](10), - ReplicaTimeout: to.Ptr[int32](10), - TriggerType: to.Ptr(armappcontainers.TriggerTypeManual), - }, - EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube"), - Template: &armappcontainers.JobTemplate{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerAppsJob0"), - Image: to.Ptr("repo/testcontainerAppsJob0:v1"), - Probes: []*armappcontainers.ContainerAppProbe{ - { - Type: to.Ptr(armappcontainers.TypeLiveness), - HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{ - Path: to.Ptr("/health"), - HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{ - { - Name: to.Ptr("Custom-Header"), - Value: to.Ptr("Awesome"), - }}, - Port: to.Ptr[int32](8080), - }, - InitialDelaySeconds: to.Ptr[int32](5), - PeriodSeconds: to.Ptr[int32](3), - }}, - }}, - InitContainers: []*armappcontainers.InitContainer{ - { - Name: to.Ptr("testinitcontainerAppsJob0"), - Args: []*string{ - to.Ptr("-c"), - to.Ptr("while true; do echo hello; sleep 10;done")}, - Command: []*string{ - to.Ptr("/bin/sh")}, - Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - Resources: &armappcontainers.ContainerResources{ - CPU: to.Ptr[float64](0.2), - Memory: to.Ptr("100Mi"), - }, - }}, - }, - }, - }, 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.Job = armappcontainers.Job{ - // Name: to.Ptr("testcontainerAppsJob0"), - // Type: to.Ptr("Microsoft.App/jobs"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0"), - // Location: to.Ptr("East US"), - // ExtendedLocation: &armappcontainers.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation"), - // Type: to.Ptr(armappcontainers.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armappcontainers.JobProperties{ - // Configuration: &armappcontainers.JobConfiguration{ - // ManualTriggerConfig: &armappcontainers.JobConfigurationManualTriggerConfig{ - // Parallelism: to.Ptr[int32](4), - // ReplicaCompletionCount: to.Ptr[int32](1), - // }, - // ReplicaRetryLimit: to.Ptr[int32](10), - // ReplicaTimeout: to.Ptr[int32](10), - // TriggerType: to.Ptr(armappcontainers.TriggerTypeManual), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // ProvisioningState: to.Ptr(armappcontainers.JobProvisioningStateSucceeded), - // Template: &armappcontainers.JobTemplate{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // Probes: []*armappcontainers.ContainerAppProbe{ - // { - // Type: to.Ptr(armappcontainers.TypeLiveness), - // HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{ - // Path: to.Ptr("/health"), - // HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{ - // { - // Name: to.Ptr("Custom-Header"), - // Value: to.Ptr("Awesome"), - // }}, - // Port: to.Ptr[int32](8080), - // }, - // InitialDelaySeconds: to.Ptr[int32](3), - // PeriodSeconds: to.Ptr[int32](3), - // }}, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerAppsJob0"), - // Args: []*string{ - // to.Ptr("-c"), - // to.Ptr("while true; do echo hello; sleep 10;done")}, - // Command: []*string{ - // to.Ptr("/bin/sh")}, - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_CreateorUpdate_EventTrigger.json -func ExampleJobsClient_BeginCreateOrUpdate_createOrUpdateContainerAppsJobWithEventDrivenTrigger() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginCreateOrUpdate(ctx, "rg", "testcontainerAppsJob0", armappcontainers.Job{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.JobProperties{ - Configuration: &armappcontainers.JobConfiguration{ - EventTriggerConfig: &armappcontainers.JobConfigurationEventTriggerConfig{ - Parallelism: to.Ptr[int32](4), - ReplicaCompletionCount: to.Ptr[int32](1), - Scale: &armappcontainers.JobScale{ - MaxExecutions: to.Ptr[int32](5), - MinExecutions: to.Ptr[int32](1), - PollingInterval: to.Ptr[int32](40), - Rules: []*armappcontainers.JobScaleRule{ - { - Name: to.Ptr("servicebuscalingrule"), - Type: to.Ptr("azure-servicebus"), - Metadata: map[string]any{ - "topicName": "my-topic", - }, - }}, - }, - }, - ReplicaRetryLimit: to.Ptr[int32](10), - ReplicaTimeout: to.Ptr[int32](10), - TriggerType: to.Ptr(armappcontainers.TriggerTypeEvent), - }, - EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - Template: &armappcontainers.JobTemplate{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerAppsJob0"), - Image: to.Ptr("repo/testcontainerAppsJob0:v1"), - }}, - InitContainers: []*armappcontainers.InitContainer{ - { - Name: to.Ptr("testinitcontainerAppsJob0"), - Args: []*string{ - to.Ptr("-c"), - to.Ptr("while true; do echo hello; sleep 10;done")}, - Command: []*string{ - to.Ptr("/bin/sh")}, - Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - Resources: &armappcontainers.ContainerResources{ - CPU: to.Ptr[float64](0.2), - Memory: to.Ptr("100Mi"), - }, - }}, - }, - }, - }, 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.Job = armappcontainers.Job{ - // Name: to.Ptr("testcontainerAppsJob0"), - // Type: to.Ptr("Microsoft.App/jobs"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.JobProperties{ - // Configuration: &armappcontainers.JobConfiguration{ - // EventTriggerConfig: &armappcontainers.JobConfigurationEventTriggerConfig{ - // Parallelism: to.Ptr[int32](4), - // ReplicaCompletionCount: to.Ptr[int32](1), - // Scale: &armappcontainers.JobScale{ - // MaxExecutions: to.Ptr[int32](5), - // MinExecutions: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](20), - // Rules: []*armappcontainers.JobScaleRule{ - // { - // Name: to.Ptr("githubscalingrule"), - // Type: to.Ptr("github-runner"), - // Metadata: map[string]any{ - // "githubAPIURL": "https://api.github.com", - // }, - // }}, - // }, - // }, - // ReplicaRetryLimit: to.Ptr[int32](10), - // ReplicaTimeout: to.Ptr[int32](10), - // TriggerType: to.Ptr(armappcontainers.TriggerTypeEvent), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // ProvisioningState: to.Ptr(armappcontainers.JobProvisioningStateSucceeded), - // Template: &armappcontainers.JobTemplate{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerAppsJob0"), - // Args: []*string{ - // to.Ptr("-c"), - // to.Ptr("while true; do echo hello; sleep 10;done")}, - // Command: []*string{ - // to.Ptr("/bin/sh")}, - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Delete.json -func ExampleJobsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginDelete(ctx, "rg", "testWorkerContainerAppsJob0", 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/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Patch.json -func ExampleJobsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginUpdate(ctx, "rg", "testcontainerAppsJob0", armappcontainers.JobPatchProperties{ - Properties: &armappcontainers.JobPatchPropertiesProperties{ - Configuration: &armappcontainers.JobConfiguration{ - ManualTriggerConfig: &armappcontainers.JobConfigurationManualTriggerConfig{ - Parallelism: to.Ptr[int32](4), - ReplicaCompletionCount: to.Ptr[int32](1), - }, - ReplicaRetryLimit: to.Ptr[int32](10), - ReplicaTimeout: to.Ptr[int32](10), - TriggerType: to.Ptr(armappcontainers.TriggerTypeManual), - }, - Template: &armappcontainers.JobTemplate{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerAppsJob0"), - Image: to.Ptr("repo/testcontainerAppsJob0:v1"), - Probes: []*armappcontainers.ContainerAppProbe{ - { - Type: to.Ptr(armappcontainers.TypeLiveness), - HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{ - Path: to.Ptr("/health"), - HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{ - { - Name: to.Ptr("Custom-Header"), - Value: to.Ptr("Awesome"), - }}, - Port: to.Ptr[int32](8080), - }, - InitialDelaySeconds: to.Ptr[int32](3), - PeriodSeconds: to.Ptr[int32](3), - }}, - }}, - InitContainers: []*armappcontainers.InitContainer{ - { - Name: to.Ptr("testinitcontainerAppsJob0"), - Args: []*string{ - to.Ptr("-c"), - to.Ptr("while true; do echo hello; sleep 10;done")}, - Command: []*string{ - to.Ptr("/bin/sh")}, - Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - Resources: &armappcontainers.ContainerResources{ - CPU: to.Ptr[float64](0.2), - Memory: to.Ptr("100Mi"), - }, - }}, - }, - }, - }, 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.Job = armappcontainers.Job{ - // Name: to.Ptr("testcontainerAppsJob0"), - // Type: to.Ptr("Microsoft.App/jobs"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.JobProperties{ - // Configuration: &armappcontainers.JobConfiguration{ - // ManualTriggerConfig: &armappcontainers.JobConfigurationManualTriggerConfig{ - // Parallelism: to.Ptr[int32](4), - // ReplicaCompletionCount: to.Ptr[int32](1), - // }, - // ReplicaRetryLimit: to.Ptr[int32](10), - // ReplicaTimeout: to.Ptr[int32](10), - // TriggerType: to.Ptr(armappcontainers.TriggerTypeManual), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // ProvisioningState: to.Ptr(armappcontainers.JobProvisioningStateSucceeded), - // Template: &armappcontainers.JobTemplate{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testinitcontainerAppsJob0"), - // Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Start.json -func ExampleJobsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginStart(ctx, "rg", "testcontainerAppsJob0", &armappcontainers.JobsClientBeginStartOptions{Template: &armappcontainers.JobExecutionTemplate{ - Containers: []*armappcontainers.JobExecutionContainer{ - { - Name: to.Ptr("testcontainerAppsJob0"), - Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - Resources: &armappcontainers.ContainerResources{ - CPU: to.Ptr[float64](0.2), - Memory: to.Ptr("100Mi"), - }, - }}, - InitContainers: []*armappcontainers.JobExecutionContainer{ - { - Name: to.Ptr("testinitcontainerAppsJob0"), - Args: []*string{ - to.Ptr("-c"), - to.Ptr("while true; do echo hello; sleep 10;done")}, - Command: []*string{ - to.Ptr("/bin/sh")}, - Image: to.Ptr("repo/testcontainerAppsJob0:v4"), - Resources: &armappcontainers.ContainerResources{ - CPU: to.Ptr[float64](0.2), - Memory: to.Ptr("100Mi"), - }, - }}, - }, - }) - 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.JobExecutionBase = armappcontainers.JobExecutionBase{ - // Name: to.Ptr("testcontainerAppsJob0-pjxhsye"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/{containerAppsJobName}/executions/{jobExecutionName}"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Stop_Execution.json -func ExampleJobsClient_BeginStopExecution() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginStopExecution(ctx, "rg", "testcontainerAppsJob0", "jobExecution1", 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/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Stop_Multiple.json -func ExampleJobsClient_BeginStopMultipleExecutions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewJobsClient().BeginStopMultipleExecutions(ctx, "rg", "testcontainerAppsJob0", 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.ContainerAppJobExecutions = armappcontainers.ContainerAppJobExecutions{ - // Value: []*armappcontainers.JobExecution{ - // { - // Name: to.Ptr("jobExecution-27944453"), - // Properties: &armappcontainers.JobExecutionProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-13T20:47:30.000Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-13T20:37:30.000Z"); return t}()), - // Status: to.Ptr(armappcontainers.JobExecutionRunningStateRunning), - // }, - // }, - // { - // Name: to.Ptr("jobExecution-27944452"), - // Properties: &armappcontainers.JobExecutionProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-13T21:47:30.000Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-13T21:37:30.000Z"); return t}()), - // Status: to.Ptr(armappcontainers.JobExecutionRunningStateRunning), - // }, - // }, - // { - // Name: to.Ptr("jobExecution-27944453"), - // Properties: &armappcontainers.JobExecutionProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-13T22:47:30.000Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-13T22:37:30.000Z"); return t}()), - // Status: to.Ptr(armappcontainers.JobExecutionRunningStateRunning), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_ListSecrets.json -func ExampleJobsClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobsClient().ListSecrets(ctx, "rg", "testcontainerAppsJob0", 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.JobSecretsCollection = armappcontainers.JobSecretsCollection{ - // Value: []*armappcontainers.Secret{ - // { - // Name: to.Ptr("secret1"), - // }, - // { - // Name: to.Ptr("secret2"), - // }}, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client.go index 1e48b16673a5..320a2ba331de 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client.go @@ -45,7 +45,7 @@ func NewJobsExecutionsClient(subscriptionID string, credential azcore.TokenCrede // NewListPager - Get a Container Apps Job's executions // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - options - JobsExecutionsClientListOptions contains the optional parameters for the JobsExecutionsClient.NewListPager method. @@ -95,7 +95,7 @@ func (client *JobsExecutionsClient) listCreateRequest(ctx context.Context, resou if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client_example_test.go deleted file mode 100644 index 2699f365e65e..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client_example_test.go +++ /dev/null @@ -1,79 +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 armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Job_Executions_Get.json -func ExampleJobsExecutionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJobsExecutionsClient().NewListPager("rg", "testcontainerAppsJob0", &armappcontainers.JobsExecutionsClientListOptions{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.ContainerAppJobExecutions = armappcontainers.ContainerAppJobExecutions{ - // Value: []*armappcontainers.JobExecution{ - // { - // Name: to.Ptr("testcontainerAppJob-27944454"), - // Properties: &armappcontainers.JobExecutionProperties{ - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-13T20:47:30.000Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-02-13T20:37:30.000Z"); return t}()), - // Status: to.Ptr(armappcontainers.JobExecutionRunningStateRunning), - // Template: &armappcontainers.JobExecutionTemplate{ - // Containers: []*armappcontainers.JobExecutionContainer{ - // { - // Name: to.Ptr("testcontainerappsjob0"), - // Image: to.Ptr("repo/testcontainerappsjob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.5), - // Memory: to.Ptr("1Gi"), - // }, - // }}, - // InitContainers: []*armappcontainers.JobExecutionContainer{ - // { - // Name: to.Ptr("testinitcontainerAppsJob0"), - // Args: []*string{ - // to.Ptr("-c"), - // to.Ptr("while true; do echo hello; sleep 10;done")}, - // Command: []*string{ - // to.Ptr("/bin/sh")}, - // Image: to.Ptr("repo/testcontainerappsjob0:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.5), - // Memory: to.Ptr("1Gi"), - // }, - // }}, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go index eb731ee82afd..855387bcacba 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go @@ -46,7 +46,7 @@ func NewManagedCertificatesClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Create or Update a Managed Certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - managedCertificateName - Name of the Managed Certificate. @@ -73,7 +73,7 @@ func (client *ManagedCertificatesClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Create or Update a Managed Certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ManagedCertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, options *ManagedCertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ManagedCertificatesClient.BeginCreateOrUpdate" @@ -119,7 +119,7 @@ func (client *ManagedCertificatesClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ManagedCertificateEnvelope != nil { @@ -134,7 +134,7 @@ func (client *ManagedCertificatesClient) createOrUpdateCreateRequest(ctx context // Delete - Deletes the specified Managed Certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - managedCertificateName - Name of the Managed Certificate. @@ -185,7 +185,7 @@ func (client *ManagedCertificatesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +194,7 @@ func (client *ManagedCertificatesClient) deleteCreateRequest(ctx context.Context // Get - Get the specified Managed Certificate. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - managedCertificateName - Name of the Managed Certificate. @@ -245,7 +245,7 @@ func (client *ManagedCertificatesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *ManagedCertificatesClient) getHandleResponse(resp *http.Response) // NewListPager - Get the Managed Certificates in a given managed environment. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - options - ManagedCertificatesClientListOptions contains the optional parameters for the ManagedCertificatesClient.NewListPager @@ -310,7 +310,7 @@ func (client *ManagedCertificatesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *ManagedCertificatesClient) listHandleResponse(resp *http.Response) // Update - Patches a managed certificate. Oly patching of tags is supported // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - managedCertificateName - Name of the Managed Certificate. @@ -381,7 +381,7 @@ func (client *ManagedCertificatesClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, managedCertificateEnvelope); err != nil { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client_example_test.go deleted file mode 100644 index a3a5bd40b14a..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificate_Get.json -func ExampleManagedCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedCertificatesClient().Get(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", 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.ManagedCertificate = armappcontainers.ManagedCertificate{ - // Type: to.Ptr("Microsoft.App/ManagedEnvironments/managedCertificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ManagedCertificateProperties{ - // DomainControlValidation: to.Ptr(armappcontainers.ManagedCertificateDomainControlValidationCNAME), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectName: to.Ptr("CN=my-subject-name.company.country.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificate_CreateOrUpdate.json -func ExampleManagedCertificatesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedCertificatesClient().BeginCreateOrUpdate(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", &armappcontainers.ManagedCertificatesClientBeginCreateOrUpdateOptions{ManagedCertificateEnvelope: &armappcontainers.ManagedCertificate{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.ManagedCertificateProperties{ - DomainControlValidation: to.Ptr(armappcontainers.ManagedCertificateDomainControlValidationCNAME), - SubjectName: to.Ptr("my-subject-name.company.country.net"), - }, - }, - }) - 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.ManagedCertificate = armappcontainers.ManagedCertificate{ - // Type: to.Ptr("Microsoft.App/ManagedEnvironments/managedCertificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ManagedCertificateProperties{ - // DomainControlValidation: to.Ptr(armappcontainers.ManagedCertificateDomainControlValidationCNAME), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectName: to.Ptr("CN=my-subject-name.company.country.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificate_Delete.json -func ExampleManagedCertificatesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagedCertificatesClient().Delete(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", 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/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificates_Patch.json -func ExampleManagedCertificatesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedCertificatesClient().Update(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", armappcontainers.ManagedCertificatePatch{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.ManagedCertificate = armappcontainers.ManagedCertificate{ - // Type: to.Ptr("Microsoft.App/ManagedEnvironments/managedCertificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ManagedCertificateProperties{ - // DomainControlValidation: to.Ptr(armappcontainers.ManagedCertificateDomainControlValidationCNAME), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectName: to.Ptr("CN=my-subject-name.company.country.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedCertificates_ListByManagedEnvironment.json -func ExampleManagedCertificatesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedCertificatesClient().NewListPager("examplerg", "testcontainerenv", 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.ManagedCertificateCollection = armappcontainers.ManagedCertificateCollection{ - // Value: []*armappcontainers.ManagedCertificate{ - // { - // Type: to.Ptr("Microsoft.App/ManagedEnvironments/managedCertificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates/certificate-firendly-name"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ManagedCertificateProperties{ - // DomainControlValidation: to.Ptr(armappcontainers.ManagedCertificateDomainControlValidationCNAME), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectName: to.Ptr("CN=my-subject-name.company.country.net"), - // }, - // }, - // { - // Type: to.Ptr("Microsoft.App/ManagedEnvironments/managedCertificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates/certificate-firendly-name-root"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ManagedCertificateProperties{ - // DomainControlValidation: to.Ptr(armappcontainers.ManagedCertificateDomainControlValidationHTTP), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectName: to.Ptr("CN=company.country.net"), - // }, - // }, - // { - // Type: to.Ptr("Microsoft.App/ManagedEnvironments/managedCertificates"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv/managedCertificates/certificate-firendly-name-txt"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ManagedCertificateProperties{ - // DomainControlValidation: to.Ptr(armappcontainers.ManagedCertificateDomainControlValidationTXT), - // ProvisioningState: to.Ptr(armappcontainers.CertificateProvisioningStateSucceeded), - // SubjectName: to.Ptr("CN=txt.company.country.net"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client.go index d1a0a72d3117..e30846c61424 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client.go @@ -46,7 +46,7 @@ func NewManagedEnvironmentDiagnosticsClient(subscriptionID string, credential az // GetDetector - Get the diagnostics data for a Managed Environment used to host container apps. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - detectorName - Name of the Managed Environment detector. @@ -98,7 +98,7 @@ func (client *ManagedEnvironmentDiagnosticsClient) getDetectorCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *ManagedEnvironmentDiagnosticsClient) getDetectorHandleResponse(res // ListDetectors - Get the list of diagnostics for a Managed Environment used to host container apps. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - options - ManagedEnvironmentDiagnosticsClientListDetectorsOptions contains the optional parameters for the ManagedEnvironmentDiagnosticsClient.ListDetectors @@ -163,7 +163,7 @@ func (client *ManagedEnvironmentDiagnosticsClient) listDetectorsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client_example_test.go deleted file mode 100644 index bdc09fa39434..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client_example_test.go +++ /dev/null @@ -1,135 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentDiagnostics_List.json -func ExampleManagedEnvironmentDiagnosticsClient_ListDetectors() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedEnvironmentDiagnosticsClient().ListDetectors(ctx, "mikono-workerapp-test-rg", "mikonokubeenv", 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.DiagnosticsCollection = armappcontainers.DiagnosticsCollection{ - // Value: []*armappcontainers.Diagnostics{ - // { - // Name: to.Ptr("ManagedEnvAvailabilityMetrics"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/detectors"), - // ID: to.Ptr("/subscriptions/f07f3711-b45e-40fe-a941-4e6d93f851e6/resourceGroups/mikono-workerapp-test-rg/providers/Microsoft.App/managedEnvironments/mikonokubeenv/detectors/ManagedEnvAvailabilityMetrics"), - // Properties: &armappcontainers.DiagnosticsProperties{ - // Dataset: []*armappcontainers.DiagnosticsDataAPIResponse{ - // }, - // Metadata: &armappcontainers.DiagnosticsDefinition{ - // Name: to.Ptr("Availability Metrics for Managed Environments"), - // Type: to.Ptr("Analysis"), - // Author: to.Ptr(""), - // Category: to.Ptr("Availability and Performance"), - // ID: to.Ptr("ManagedEnvAvailabilityMetrics"), - // Score: to.Ptr[float32](0), - // SupportTopicList: []*armappcontainers.DiagnosticSupportTopic{ - // }, - // }, - // Status: &armappcontainers.DiagnosticsStatus{ - // StatusID: to.Ptr[int32](4), - // }, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentDiagnostics_Get.json -func ExampleManagedEnvironmentDiagnosticsClient_GetDetector() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedEnvironmentDiagnosticsClient().GetDetector(ctx, "mikono-workerapp-test-rg", "mikonokubeenv", "ManagedEnvAvailabilityMetrics", 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.Diagnostics = armappcontainers.Diagnostics{ - // Name: to.Ptr("ManagedEnvAvailabilityMetrics"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/detectors"), - // ID: to.Ptr("/subscriptions/f07f3711-b45e-40fe-a941-4e6d93f851e6/resourceGroups/mikono-workerapp-test-rg/providers/Microsoft.App/managedEnvironments/mikonokubeenv/detectors/ManagedEnvAvailabilityMetrics"), - // Properties: &armappcontainers.DiagnosticsProperties{ - // Dataset: []*armappcontainers.DiagnosticsDataAPIResponse{ - // { - // RenderingProperties: &armappcontainers.DiagnosticRendering{ - // Type: to.Ptr[int32](8), - // Description: to.Ptr(""), - // IsVisible: to.Ptr(true), - // Title: to.Ptr("Managed Environment Network Inbound "), - // }, - // Table: &armappcontainers.DiagnosticDataTableResponseObject{ - // Columns: []*armappcontainers.DiagnosticDataTableResponseColumn{ - // { - // ColumnName: to.Ptr("TimeStamp"), - // DataType: to.Ptr("DateTime"), - // }, - // { - // ColumnName: to.Ptr("Metric"), - // DataType: to.Ptr("String"), - // }, - // { - // ColumnName: to.Ptr("Average"), - // DataType: to.Ptr("Double"), - // }}, - // Rows: []any{ - // []any{ - // "2022-03-15T21:35:00", - // "RxBytes", - // float64(0), - // }}, - // TableName: to.Ptr(""), - // }, - // }}, - // Metadata: &armappcontainers.DiagnosticsDefinition{ - // Name: to.Ptr("Managed Env Netowrk Inbound and Outbound"), - // Type: to.Ptr("Detector"), - // Description: to.Ptr("This detector shows the Managed Environment Network Inbound and Outbound."), - // Author: to.Ptr(""), - // Category: to.Ptr("Availability and Performance"), - // ID: to.Ptr("ManagedEnvAvailabilityMetrics"), - // Score: to.Ptr[float32](0), - // SupportTopicList: []*armappcontainers.DiagnosticSupportTopic{ - // }, - // }, - // Status: &armappcontainers.DiagnosticsStatus{ - // StatusID: to.Ptr[int32](3), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go index 21397910bc2b..c706ac986fdc 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go @@ -46,7 +46,7 @@ func NewManagedEnvironmentsClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates a Managed Environment used to host container apps. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - environmentEnvelope - Configuration details of the Environment. @@ -72,7 +72,7 @@ func (client *ManagedEnvironmentsClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates a Managed Environment used to host container apps. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ManagedEnvironmentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, environmentEnvelope ManagedEnvironment, options *ManagedEnvironmentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ManagedEnvironmentsClient.BeginCreateOrUpdate" @@ -114,7 +114,7 @@ func (client *ManagedEnvironmentsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, environmentEnvelope); err != nil { @@ -126,7 +126,7 @@ func (client *ManagedEnvironmentsClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete a Managed Environment if it does not have any container apps. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - options - ManagedEnvironmentsClientBeginDeleteOptions contains the optional parameters for the ManagedEnvironmentsClient.BeginDelete @@ -151,7 +151,7 @@ func (client *ManagedEnvironmentsClient) BeginDelete(ctx context.Context, resour // Delete - Delete a Managed Environment if it does not have any container apps. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ManagedEnvironmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ManagedEnvironmentsClient.BeginDelete" @@ -193,7 +193,7 @@ func (client *ManagedEnvironmentsClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +202,7 @@ func (client *ManagedEnvironmentsClient) deleteCreateRequest(ctx context.Context // Get - Get the properties of a Managed Environment used to host container apps. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - options - ManagedEnvironmentsClientGetOptions contains the optional parameters for the ManagedEnvironmentsClient.Get method. @@ -248,7 +248,7 @@ func (client *ManagedEnvironmentsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +266,7 @@ func (client *ManagedEnvironmentsClient) getHandleResponse(resp *http.Response) // GetAuthToken - Checks if resource name is available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - options - ManagedEnvironmentsClientGetAuthTokenOptions contains the optional parameters for the ManagedEnvironmentsClient.GetAuthToken @@ -313,7 +313,7 @@ func (client *ManagedEnvironmentsClient) getAuthTokenCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *ManagedEnvironmentsClient) getAuthTokenHandleResponse(resp *http.R // NewListByResourceGroupPager - Get all the Managed Environments in a resource group. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ManagedEnvironmentsClientListByResourceGroupOptions contains the optional parameters for the ManagedEnvironmentsClient.NewListByResourceGroupPager // method. @@ -373,7 +373,7 @@ func (client *ManagedEnvironmentsClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,7 +390,7 @@ func (client *ManagedEnvironmentsClient) listByResourceGroupHandleResponse(resp // NewListBySubscriptionPager - Get all Managed Environments for a subscription. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - options - ManagedEnvironmentsClientListBySubscriptionOptions contains the optional parameters for the ManagedEnvironmentsClient.NewListBySubscriptionPager // method. func (client *ManagedEnvironmentsClient) NewListBySubscriptionPager(options *ManagedEnvironmentsClientListBySubscriptionOptions) *runtime.Pager[ManagedEnvironmentsClientListBySubscriptionResponse] { @@ -428,7 +428,7 @@ func (client *ManagedEnvironmentsClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -445,7 +445,7 @@ func (client *ManagedEnvironmentsClient) listBySubscriptionHandleResponse(resp * // NewListWorkloadProfileStatesPager - Get all workload Profile States for a Managed Environment. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - options - ManagedEnvironmentsClientListWorkloadProfileStatesOptions contains the optional parameters for the ManagedEnvironmentsClient.NewListWorkloadProfileStatesPager @@ -493,7 +493,7 @@ func (client *ManagedEnvironmentsClient) listWorkloadProfileStatesCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -511,7 +511,7 @@ func (client *ManagedEnvironmentsClient) listWorkloadProfileStatesHandleResponse // BeginUpdate - Patches a Managed Environment using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - environmentEnvelope - Configuration details of the Environment. @@ -537,7 +537,7 @@ func (client *ManagedEnvironmentsClient) BeginUpdate(ctx context.Context, resour // Update - Patches a Managed Environment using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview func (client *ManagedEnvironmentsClient) update(ctx context.Context, resourceGroupName string, environmentName string, environmentEnvelope ManagedEnvironment, options *ManagedEnvironmentsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ManagedEnvironmentsClient.BeginUpdate" @@ -579,7 +579,7 @@ func (client *ManagedEnvironmentsClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, environmentEnvelope); err != nil { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client_example_test.go deleted file mode 100644 index d51c832fb33b..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client_example_test.go +++ /dev/null @@ -1,814 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_ListBySubscription.json -func ExampleManagedEnvironmentsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedEnvironmentsClient().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.ManagedEnvironmentsCollection = armappcontainers.ManagedEnvironmentsCollection{ - // Value: []*armappcontainers.ManagedEnvironment{ - // { - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1"), - // Location: to.Ptr("North Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armappcontainers.ManagedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("jlaw-demo1.k4apps.io"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // InfrastructureResourceGroup: to.Ptr("capp-svc-jlaw-demo1-northcentralus"), - // ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("20.42.33.145"), - // VnetConfiguration: &armappcontainers.VnetConfiguration{ - // InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"), - // }, - // WorkloadProfiles: []*armappcontainers.WorkloadProfile{ - // { - // Name: to.Ptr("My-GP-01"), - // MaximumCount: to.Ptr[int32](12), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("GeneralPurpose"), - // }, - // { - // Name: to.Ptr("My-MO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("MemoryOptimized"), - // }, - // { - // Name: to.Ptr("My-CO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("ComputeOptimized"), - // }, - // { - // Name: to.Ptr("My-consumption-01"), - // WorkloadProfileType: to.Ptr("Consumption"), - // }}, - // ZoneRedundant: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/DemoRG/providers/Microsoft.App/managedEnvironments/demo1"), - // Location: to.Ptr("North Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armappcontainers.ManagedEnvironmentProperties{ - // AppLogsConfiguration: &armappcontainers.AppLogsConfiguration{ - // Destination: to.Ptr("log-analytics"), - // LogAnalyticsConfiguration: &armappcontainers.LogAnalyticsConfiguration{ - // CustomerID: to.Ptr("9ccccd4a-268f-4a9a-8d03-9bfe77c3fbd2"), - // DynamicJSONColumns: to.Ptr(true), - // }, - // }, - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name2.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name2.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("demo1.k4apps.io"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // InfrastructureResourceGroup: to.Ptr("capp-svc-demo1-northcentralus"), - // ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("52.142.21.61"), - // VnetConfiguration: &armappcontainers.VnetConfiguration{ - // InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"), - // }, - // ZoneRedundant: to.Ptr(true), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_ListByResourceGroup.json -func ExampleManagedEnvironmentsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedEnvironmentsClient().NewListByResourceGroupPager("examplerg", 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.ManagedEnvironmentsCollection = armappcontainers.ManagedEnvironmentsCollection{ - // Value: []*armappcontainers.ManagedEnvironment{ - // { - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1"), - // Location: to.Ptr("North Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armappcontainers.ManagedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("jlaw-demo1.k4apps.io"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // InfrastructureResourceGroup: to.Ptr("capp-svc-jlaw-demo1-northcentralus"), - // ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("20.42.33.145"), - // VnetConfiguration: &armappcontainers.VnetConfiguration{ - // InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"), - // }, - // WorkloadProfiles: []*armappcontainers.WorkloadProfile{ - // { - // Name: to.Ptr("My-GP-01"), - // MaximumCount: to.Ptr[int32](12), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("GeneralPurpose"), - // }, - // { - // Name: to.Ptr("My-MO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("MemoryOptimized"), - // }, - // { - // Name: to.Ptr("My-CO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("ComputeOptimized"), - // }, - // { - // Name: to.Ptr("My-consumption-01"), - // WorkloadProfileType: to.Ptr("Consumption"), - // }}, - // ZoneRedundant: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/demo1"), - // Location: to.Ptr("North Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armappcontainers.ManagedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name2.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name2.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("demo1.k4apps.io"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // InfrastructureResourceGroup: to.Ptr("capp-svc-demo1-northcentralus"), - // ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("52.142.21.61"), - // VnetConfiguration: &armappcontainers.VnetConfiguration{ - // InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"), - // }, - // ZoneRedundant: to.Ptr(true), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_Get.json -func ExampleManagedEnvironmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedEnvironmentsClient().Get(ctx, "examplerg", "jlaw-demo1", 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.ManagedEnvironment = armappcontainers.ManagedEnvironment{ - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1"), - // Location: to.Ptr("North Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armappcontainers.ManagedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DaprConfiguration: &armappcontainers.DaprConfiguration{ - // Version: to.Ptr("1.9"), - // }, - // DefaultDomain: to.Ptr("jlaw-demo1.k4apps.io"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // InfrastructureResourceGroup: to.Ptr("capp-svc-jlaw-demo1-northcentralus"), - // KedaConfiguration: &armappcontainers.KedaConfiguration{ - // Version: to.Ptr("2.8.1"), - // }, - // PeerAuthentication: &armappcontainers.ManagedEnvironmentPropertiesPeerAuthentication{ - // Mtls: &armappcontainers.Mtls{ - // Enabled: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("20.42.33.145"), - // VnetConfiguration: &armappcontainers.VnetConfiguration{ - // InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"), - // }, - // WorkloadProfiles: []*armappcontainers.WorkloadProfile{ - // { - // Name: to.Ptr("My-GP-01"), - // MaximumCount: to.Ptr[int32](12), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("GeneralPurpose"), - // }, - // { - // Name: to.Ptr("My-MO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("MemoryOptimized"), - // }, - // { - // Name: to.Ptr("My-CO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("ComputeOptimized"), - // }, - // { - // Name: to.Ptr("My-consumption-01"), - // WorkloadProfileType: to.Ptr("Consumption"), - // }}, - // ZoneRedundant: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json -func ExampleManagedEnvironmentsClient_BeginCreateOrUpdate_createEnvironmentWithCustomInfrastructureResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedEnvironmentsClient().BeginCreateOrUpdate(ctx, "examplerg", "testcontainerenv", armappcontainers.ManagedEnvironment{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.ManagedEnvironmentProperties{ - AppLogsConfiguration: &armappcontainers.AppLogsConfiguration{ - LogAnalyticsConfiguration: &armappcontainers.LogAnalyticsConfiguration{ - CustomerID: to.Ptr("string"), - SharedKey: to.Ptr("string"), - }, - }, - CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - CertificatePassword: to.Ptr("1234"), - CertificateValue: []byte("Y2VydA=="), - DNSSuffix: to.Ptr("www.my-name.com"), - }, - DaprAIConnectionString: to.Ptr("InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/"), - InfrastructureResourceGroup: to.Ptr("myInfrastructureRgName"), - VnetConfiguration: &armappcontainers.VnetConfiguration{ - InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"), - }, - WorkloadProfiles: []*armappcontainers.WorkloadProfile{ - { - Name: to.Ptr("My-GP-01"), - MaximumCount: to.Ptr[int32](12), - MinimumCount: to.Ptr[int32](3), - WorkloadProfileType: to.Ptr("GeneralPurpose"), - }, - { - Name: to.Ptr("My-MO-01"), - MaximumCount: to.Ptr[int32](6), - MinimumCount: to.Ptr[int32](3), - WorkloadProfileType: to.Ptr("MemoryOptimized"), - }, - { - Name: to.Ptr("My-CO-01"), - MaximumCount: to.Ptr[int32](6), - MinimumCount: to.Ptr[int32](3), - WorkloadProfileType: to.Ptr("ComputeOptimized"), - }, - { - Name: to.Ptr("My-consumption-01"), - WorkloadProfileType: to.Ptr("Consumption"), - }}, - ZoneRedundant: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedEnvironment = armappcontainers.ManagedEnvironment{ - // Name: to.Ptr("testcontainerenv"), - // Type: to.Ptr("Microsoft.App/managedEnvironments"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ManagedEnvironmentProperties{ - // AppLogsConfiguration: &armappcontainers.AppLogsConfiguration{ - // LogAnalyticsConfiguration: &armappcontainers.LogAnalyticsConfiguration{ - // CustomerID: to.Ptr("string"), - // }, - // }, - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("testcontainerenv.k4apps.io"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // InfrastructureResourceGroup: to.Ptr("myInfrastructureRgName"), - // ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("1.2.3.4"), - // VnetConfiguration: &armappcontainers.VnetConfiguration{ - // InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"), - // }, - // WorkloadProfiles: []*armappcontainers.WorkloadProfile{ - // { - // Name: to.Ptr("My-GP-01"), - // MaximumCount: to.Ptr[int32](12), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("GeneralPurpose"), - // }, - // { - // Name: to.Ptr("My-MO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("MemoryOptimized"), - // }, - // { - // Name: to.Ptr("My-CO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("ComputeOptimized"), - // }, - // { - // Name: to.Ptr("My-consumption-01"), - // WorkloadProfileType: to.Ptr("Consumption"), - // }}, - // ZoneRedundant: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_CreateOrUpdate.json -func ExampleManagedEnvironmentsClient_BeginCreateOrUpdate_createEnvironments() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedEnvironmentsClient().BeginCreateOrUpdate(ctx, "examplerg", "testcontainerenv", armappcontainers.ManagedEnvironment{ - Location: to.Ptr("East US"), - Identity: &armappcontainers.ManagedServiceIdentity{ - Type: to.Ptr(armappcontainers.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), - UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {}, - }, - }, - Properties: &armappcontainers.ManagedEnvironmentProperties{ - AppInsightsConfiguration: &armappcontainers.AppInsightsConfiguration{ - ConnectionString: to.Ptr("InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/"), - }, - AppLogsConfiguration: &armappcontainers.AppLogsConfiguration{ - LogAnalyticsConfiguration: &armappcontainers.LogAnalyticsConfiguration{ - CustomerID: to.Ptr("string"), - DynamicJSONColumns: to.Ptr(true), - SharedKey: to.Ptr("string"), - }, - }, - CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - CertificatePassword: to.Ptr("1234"), - CertificateValue: []byte("Y2VydA=="), - DNSSuffix: to.Ptr("www.my-name.com"), - }, - DaprAIConnectionString: to.Ptr("InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/"), - OpenTelemetryConfiguration: &armappcontainers.OpenTelemetryConfiguration{ - DestinationsConfiguration: &armappcontainers.DestinationsConfiguration{ - DataDogConfiguration: &armappcontainers.DataDogConfiguration{ - Key: to.Ptr("000000000000000000000000"), - Site: to.Ptr("string"), - }, - OtlpConfigurations: []*armappcontainers.OtlpConfiguration{ - { - Name: to.Ptr("dashboard"), - Endpoint: to.Ptr("dashboard.k8s.region.azurecontainerapps.io:80"), - Headers: []*armappcontainers.Header{ - { - Key: to.Ptr("api-key"), - Value: to.Ptr("xxxxxxxxxxx"), - }}, - Insecure: to.Ptr(true), - }}, - }, - LogsConfiguration: &armappcontainers.LogsConfiguration{ - Destinations: []*string{ - to.Ptr("appInsights")}, - }, - MetricsConfiguration: &armappcontainers.MetricsConfiguration{ - Destinations: []*string{ - to.Ptr("dataDog")}, - }, - TracesConfiguration: &armappcontainers.TracesConfiguration{ - Destinations: []*string{ - to.Ptr("appInsights")}, - }, - }, - PeerAuthentication: &armappcontainers.ManagedEnvironmentPropertiesPeerAuthentication{ - Mtls: &armappcontainers.Mtls{ - Enabled: to.Ptr(true), - }, - }, - VnetConfiguration: &armappcontainers.VnetConfiguration{ - InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"), - }, - WorkloadProfiles: []*armappcontainers.WorkloadProfile{ - { - Name: to.Ptr("My-GP-01"), - MaximumCount: to.Ptr[int32](12), - MinimumCount: to.Ptr[int32](3), - WorkloadProfileType: to.Ptr("GeneralPurpose"), - }, - { - Name: to.Ptr("My-MO-01"), - MaximumCount: to.Ptr[int32](6), - MinimumCount: to.Ptr[int32](3), - WorkloadProfileType: to.Ptr("MemoryOptimized"), - }, - { - Name: to.Ptr("My-CO-01"), - MaximumCount: to.Ptr[int32](6), - MinimumCount: to.Ptr[int32](3), - WorkloadProfileType: to.Ptr("ComputeOptimized"), - }, - { - Name: to.Ptr("My-consumption-01"), - WorkloadProfileType: to.Ptr("Consumption"), - }}, - ZoneRedundant: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ManagedEnvironment = armappcontainers.ManagedEnvironment{ - // Name: to.Ptr("testcontainerenv"), - // Type: to.Ptr("Microsoft.App/managedEnvironments"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/testcontainerenv"), - // Location: to.Ptr("East US"), - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityType("SystemAssigned, UserAssigned")), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armappcontainers.ManagedEnvironmentProperties{ - // AppLogsConfiguration: &armappcontainers.AppLogsConfiguration{ - // LogAnalyticsConfiguration: &armappcontainers.LogAnalyticsConfiguration{ - // CustomerID: to.Ptr("string"), - // DynamicJSONColumns: to.Ptr(true), - // }, - // }, - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("testcontainerenv.k4apps.io"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // InfrastructureResourceGroup: to.Ptr("capp-svc-testcontainerenv-eastus"), - // OpenTelemetryConfiguration: &armappcontainers.OpenTelemetryConfiguration{ - // DestinationsConfiguration: &armappcontainers.DestinationsConfiguration{ - // DataDogConfiguration: &armappcontainers.DataDogConfiguration{ - // Site: to.Ptr("datadoghq.com"), - // }, - // OtlpConfigurations: []*armappcontainers.OtlpConfiguration{ - // { - // Name: to.Ptr("dashboard"), - // Endpoint: to.Ptr("dashboard.k8s.region.azurecontainerapps.io:80"), - // Insecure: to.Ptr(true), - // }}, - // }, - // LogsConfiguration: &armappcontainers.LogsConfiguration{ - // Destinations: []*string{ - // to.Ptr("appInsights")}, - // }, - // MetricsConfiguration: &armappcontainers.MetricsConfiguration{ - // Destinations: []*string{ - // to.Ptr("dataDog")}, - // }, - // TracesConfiguration: &armappcontainers.TracesConfiguration{ - // Destinations: []*string{ - // to.Ptr("appInsights")}, - // }, - // }, - // PeerAuthentication: &armappcontainers.ManagedEnvironmentPropertiesPeerAuthentication{ - // Mtls: &armappcontainers.Mtls{ - // Enabled: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("1.2.3.4"), - // VnetConfiguration: &armappcontainers.VnetConfiguration{ - // InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"), - // }, - // WorkloadProfiles: []*armappcontainers.WorkloadProfile{ - // { - // Name: to.Ptr("My-GP-01"), - // MaximumCount: to.Ptr[int32](12), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("GeneralPurpose"), - // }, - // { - // Name: to.Ptr("My-MO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("MemoryOptimized"), - // }, - // { - // Name: to.Ptr("My-CO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("ComputeOptimized"), - // }, - // { - // Name: to.Ptr("My-consumption-01"), - // WorkloadProfileType: to.Ptr("Consumption"), - // }}, - // ZoneRedundant: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_Delete.json -func ExampleManagedEnvironmentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedEnvironmentsClient().BeginDelete(ctx, "examplerg", "examplekenv", 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/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_Patch.json -func ExampleManagedEnvironmentsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewManagedEnvironmentsClient().BeginUpdate(ctx, "examplerg", "testcontainerenv", armappcontainers.ManagedEnvironment{ - Location: to.Ptr("East US"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, 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.ManagedEnvironment = armappcontainers.ManagedEnvironment{ - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1"), - // Location: to.Ptr("North Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armappcontainers.ManagedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DefaultDomain: to.Ptr("jlaw-demo1.k4apps.io"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // InfrastructureResourceGroup: to.Ptr("capp-svc-jlaw-demo1-northcentralus"), - // ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("20.42.33.145"), - // WorkloadProfiles: []*armappcontainers.WorkloadProfile{ - // { - // Name: to.Ptr("My-GP-01"), - // MaximumCount: to.Ptr[int32](12), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("GeneralPurpose"), - // }, - // { - // Name: to.Ptr("My-MO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("MemoryOptimized"), - // }, - // { - // Name: to.Ptr("My-CO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("ComputeOptimized"), - // }, - // { - // Name: to.Ptr("My-consumption-01"), - // WorkloadProfileType: to.Ptr("Consumption"), - // }}, - // ZoneRedundant: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_GetAuthToken.json -func ExampleManagedEnvironmentsClient_GetAuthToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedEnvironmentsClient().GetAuthToken(ctx, "rg", "testenv", 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.EnvironmentAuthToken = armappcontainers.EnvironmentAuthToken{ - // Name: to.Ptr("testenv"), - // Type: to.Ptr("Microsoft.App/environments/accesstoken"), - // ID: to.Ptr("/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testenv"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.EnvironmentAuthTokenProperties{ - // Expires: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-14T19:22:50.308Z"); return t}()), - // Token: to.Ptr("testToken"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_ListWorkloadProfileStates.json -func ExampleManagedEnvironmentsClient_NewListWorkloadProfileStatesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedEnvironmentsClient().NewListWorkloadProfileStatesPager("examplerg", "jlaw-demo1", 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.WorkloadProfileStatesCollection = armappcontainers.WorkloadProfileStatesCollection{ - // Value: []*armappcontainers.WorkloadProfileStates{ - // { - // Name: to.Ptr("GP1"), - // Type: to.Ptr("/providers/Microsoft.App/workloadProfileStates"), - // ID: to.Ptr("/subscriptions/55f240e3-3d66-44f6-8358-4e4f3d7a2e51/providers/Microsoft.App/workloadProfileStates/GP1"), - // Properties: &armappcontainers.WorkloadProfileStatesProperties{ - // CurrentCount: to.Ptr[int32](3), - // MaximumCount: to.Ptr[int32](10), - // MinimumCount: to.Ptr[int32](3), - // }, - // }, - // { - // Name: to.Ptr("MO3"), - // Type: to.Ptr("/providers/Microsoft.App/workloadProfileStates"), - // ID: to.Ptr("/subscriptions/55f240e3-3d66-44f6-8358-4e4f3d7a2e51/providers/Microsoft.App/workloadProfileStates/MO3"), - // Properties: &armappcontainers.WorkloadProfileStatesProperties{ - // CurrentCount: to.Ptr[int32](0), - // MaximumCount: to.Ptr[int32](2), - // MinimumCount: to.Ptr[int32](0), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client.go index f7c0c322abf3..2ea7b709c677 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client.go @@ -46,7 +46,7 @@ func NewManagedEnvironmentsDiagnosticsClient(subscriptionID string, credential a // GetRoot - Get the properties of a Managed Environment used to host container apps. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - options - ManagedEnvironmentsDiagnosticsClientGetRootOptions contains the optional parameters for the ManagedEnvironmentsDiagnosticsClient.GetRoot @@ -93,7 +93,7 @@ func (client *ManagedEnvironmentsDiagnosticsClient) getRootCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client_example_test.go deleted file mode 100644 index b00c01482d1e..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client_example_test.go +++ /dev/null @@ -1,98 +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 armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironments_Get.json -func ExampleManagedEnvironmentsDiagnosticsClient_GetRoot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedEnvironmentsDiagnosticsClient().GetRoot(ctx, "examplerg", "jlaw-demo1", 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.ManagedEnvironment = armappcontainers.ManagedEnvironment{ - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/jlaw-demo1"), - // Location: to.Ptr("North Central US"), - // Tags: map[string]*string{ - // }, - // Properties: &armappcontainers.ManagedEnvironmentProperties{ - // CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - // CustomDomainVerificationID: to.Ptr("custom domain verification id"), - // DNSSuffix: to.Ptr("www.my-name.com"), - // ExpirationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-06T04:00:00.000Z"); return t}()), - // SubjectName: to.Ptr("CN=www.my-name.com"), - // Thumbprint: to.Ptr("CERTIFICATE_THUMBPRINT"), - // }, - // DaprConfiguration: &armappcontainers.DaprConfiguration{ - // Version: to.Ptr("1.9"), - // }, - // DefaultDomain: to.Ptr("jlaw-demo1.k4apps.io"), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // InfrastructureResourceGroup: to.Ptr("capp-svc-jlaw-demo1-northcentralus"), - // KedaConfiguration: &armappcontainers.KedaConfiguration{ - // Version: to.Ptr("2.8.1"), - // }, - // PeerAuthentication: &armappcontainers.ManagedEnvironmentPropertiesPeerAuthentication{ - // Mtls: &armappcontainers.Mtls{ - // Enabled: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr(armappcontainers.EnvironmentProvisioningStateSucceeded), - // StaticIP: to.Ptr("20.42.33.145"), - // VnetConfiguration: &armappcontainers.VnetConfiguration{ - // InfrastructureSubnetID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/RGName/providers/Microsoft.Network/virtualNetworks/VNetName/subnets/subnetName1"), - // }, - // WorkloadProfiles: []*armappcontainers.WorkloadProfile{ - // { - // Name: to.Ptr("My-GP-01"), - // MaximumCount: to.Ptr[int32](12), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("GeneralPurpose"), - // }, - // { - // Name: to.Ptr("My-MO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("MemoryOptimized"), - // }, - // { - // Name: to.Ptr("My-CO-01"), - // MaximumCount: to.Ptr[int32](6), - // MinimumCount: to.Ptr[int32](3), - // WorkloadProfileType: to.Ptr("ComputeOptimized"), - // }, - // { - // Name: to.Ptr("My-consumption-01"), - // WorkloadProfileType: to.Ptr("Consumption"), - // }}, - // ZoneRedundant: to.Ptr(true), - // }, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client.go index bd98fc5f24ca..11c52ea29a87 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client.go @@ -46,7 +46,7 @@ func NewManagedEnvironmentsStoragesClient(subscriptionID string, credential azco // CreateOrUpdate - Create or update storage for a managedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - storageName - Name of the storage. @@ -99,7 +99,7 @@ func (client *ManagedEnvironmentsStoragesClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, storageEnvelope); err != nil { @@ -120,7 +120,7 @@ func (client *ManagedEnvironmentsStoragesClient) createOrUpdateHandleResponse(re // Delete - Delete storage for a managedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - storageName - Name of the storage. @@ -171,7 +171,7 @@ func (client *ManagedEnvironmentsStoragesClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *ManagedEnvironmentsStoragesClient) deleteCreateRequest(ctx context // Get - Get storage for a managedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - storageName - Name of the storage. @@ -232,7 +232,7 @@ func (client *ManagedEnvironmentsStoragesClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +250,7 @@ func (client *ManagedEnvironmentsStoragesClient) getHandleResponse(resp *http.Re // List - Get all storages for a managedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - options - ManagedEnvironmentsStoragesClientListOptions contains the optional parameters for the ManagedEnvironmentsStoragesClient.List @@ -297,7 +297,7 @@ func (client *ManagedEnvironmentsStoragesClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client_example_test.go deleted file mode 100644 index b41b4f177282..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client_example_test.go +++ /dev/null @@ -1,228 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentsStorages_List.json -func ExampleManagedEnvironmentsStoragesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedEnvironmentsStoragesClient().List(ctx, "examplerg", "managedEnv", 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.ManagedEnvironmentStoragesCollection = armappcontainers.ManagedEnvironmentStoragesCollection{ - // Value: []*armappcontainers.ManagedEnvironmentStorage{ - // { - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/storages"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/managedEnv/storages/jlaw-demo1"), - // Properties: &armappcontainers.ManagedEnvironmentStorageProperties{ - // AzureFile: &armappcontainers.AzureFileProperties{ - // AccessMode: to.Ptr(armappcontainers.AccessModeReadOnly), - // AccountName: to.Ptr("account1"), - // ShareName: to.Ptr("share1"), - // }, - // }, - // }, - // { - // Name: to.Ptr("jlaw-demo2"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/storages"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/managedEnv/storages/jlaw-demo2"), - // Properties: &armappcontainers.ManagedEnvironmentStorageProperties{ - // NfsAzureFile: &armappcontainers.NfsAzureFileProperties{ - // AccessMode: to.Ptr(armappcontainers.AccessModeReadOnly), - // Server: to.Ptr("server1"), - // ShareName: to.Ptr("share1"), - // }, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentsStorages_Get.json -func ExampleManagedEnvironmentsStoragesClient_Get_getAEnvironmentsStorage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedEnvironmentsStoragesClient().Get(ctx, "examplerg", "managedEnv", "jlaw-demo1", 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.ManagedEnvironmentStorage = armappcontainers.ManagedEnvironmentStorage{ - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/storages"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/managedEnv/storages/jlaw-demo1"), - // Properties: &armappcontainers.ManagedEnvironmentStorageProperties{ - // AzureFile: &armappcontainers.AzureFileProperties{ - // AccessMode: to.Ptr(armappcontainers.AccessModeReadOnly), - // AccountName: to.Ptr("account1"), - // ShareName: to.Ptr("share1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentsStorages_Get_NfsAzureFile.json -func ExampleManagedEnvironmentsStoragesClient_Get_getAEnvironmentsStorageForNfsAzureFile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedEnvironmentsStoragesClient().Get(ctx, "examplerg", "managedEnv", "jlaw-demo1", 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.ManagedEnvironmentStorage = armappcontainers.ManagedEnvironmentStorage{ - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/storages"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/managedEnv/storages/jlaw-demo1"), - // Properties: &armappcontainers.ManagedEnvironmentStorageProperties{ - // NfsAzureFile: &armappcontainers.NfsAzureFileProperties{ - // AccessMode: to.Ptr(armappcontainers.AccessModeReadOnly), - // Server: to.Ptr("server1"), - // ShareName: to.Ptr("share1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json -func ExampleManagedEnvironmentsStoragesClient_CreateOrUpdate_createOrUpdateEnvironmentsStorage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedEnvironmentsStoragesClient().CreateOrUpdate(ctx, "examplerg", "managedEnv", "jlaw-demo1", armappcontainers.ManagedEnvironmentStorage{ - Properties: &armappcontainers.ManagedEnvironmentStorageProperties{ - AzureFile: &armappcontainers.AzureFileProperties{ - AccessMode: to.Ptr(armappcontainers.AccessModeReadOnly), - AccountKey: to.Ptr("key"), - AccountName: to.Ptr("account1"), - ShareName: to.Ptr("share1"), - }, - }, - }, 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.ManagedEnvironmentStorage = armappcontainers.ManagedEnvironmentStorage{ - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/storages"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/managedEnv/storages/jlaw-demo1"), - // Properties: &armappcontainers.ManagedEnvironmentStorageProperties{ - // AzureFile: &armappcontainers.AzureFileProperties{ - // AccessMode: to.Ptr(armappcontainers.AccessModeReadOnly), - // AccountName: to.Ptr("account1"), - // ShareName: to.Ptr("share1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json -func ExampleManagedEnvironmentsStoragesClient_CreateOrUpdate_createOrUpdateEnvironmentsStorageForNfsAzureFile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagedEnvironmentsStoragesClient().CreateOrUpdate(ctx, "examplerg", "managedEnv", "jlaw-demo1", armappcontainers.ManagedEnvironmentStorage{ - Properties: &armappcontainers.ManagedEnvironmentStorageProperties{ - NfsAzureFile: &armappcontainers.NfsAzureFileProperties{ - AccessMode: to.Ptr(armappcontainers.AccessModeReadOnly), - Server: to.Ptr("server1"), - ShareName: to.Ptr("share1"), - }, - }, - }, 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.ManagedEnvironmentStorage = armappcontainers.ManagedEnvironmentStorage{ - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/storages"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/managedEnv/storages/jlaw-demo1"), - // Properties: &armappcontainers.ManagedEnvironmentStorageProperties{ - // NfsAzureFile: &armappcontainers.NfsAzureFileProperties{ - // AccessMode: to.Ptr(armappcontainers.AccessModeReadOnly), - // Server: to.Ptr("server1"), - // ShareName: to.Ptr("share1"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentsStorages_Delete.json -func ExampleManagedEnvironmentsStoragesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewManagedEnvironmentsStoragesClient().Delete(ctx, "examplerg", "managedEnv", "jlaw-demo1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentusages_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentusages_client.go index 0d37788d9208..0103a9c0c073 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentusages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentusages_client.go @@ -45,7 +45,7 @@ func NewManagedEnvironmentUsagesClient(subscriptionID string, credential azcore. // NewListPager - Gets the current usage information as well as the limits for environment. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - options - ManagedEnvironmentUsagesClientListOptions contains the optional parameters for the ManagedEnvironmentUsagesClient.NewListPager @@ -93,7 +93,7 @@ func (client *ManagedEnvironmentUsagesClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentusages_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentusages_client_example_test.go deleted file mode 100644 index 3d95b957889f..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentusages_client_example_test.go +++ /dev/null @@ -1,55 +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 armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ManagedEnvironmentUsages_List.json -func ExampleManagedEnvironmentUsagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewManagedEnvironmentUsagesClient().NewListPager("examplerg", "jlaw-demo1", 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.ListUsagesResult = armappcontainers.ListUsagesResult{ - // Value: []*armappcontainers.Usage{ - // { - // Name: &armappcontainers.UsageName{ - // LocalizedValue: to.Ptr("Managed Environment Consumption Cores"), - // Value: to.Ptr("ManagedEnvironmentConsumptionCores"), - // }, - // CurrentValue: to.Ptr[float32](0.5), - // Limit: to.Ptr[float32](10), - // Unit: to.Ptr("Count"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/models.go b/sdk/resourcemanager/appcontainers/armappcontainers/models.go index 984c14842930..8c8e333ddda7 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/models.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/models.go @@ -374,6 +374,10 @@ type BaseContainer struct { // Container image tag. Image *string + // The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to update image + // through image field. Set to ContainerImage for user provided image. + ImageType *ImageType + // Custom container name. Name *string @@ -725,6 +729,9 @@ type Configuration struct { // Collection of private container registry credentials for containers used by the Container app Registries []*RegistryCredentials + // App runtime configuration for the Container App. + Runtime *Runtime + // Collection of secrets used by a Container app Secrets []*Secret @@ -833,6 +840,10 @@ type Container struct { // Container image tag. Image *string + // The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to update image + // through image field. Set to ContainerImage for user provided image. + ImageType *ImageType + // Custom container name. Name *string @@ -1023,6 +1034,9 @@ type ContainerAppProperties struct { // Deprecated. Resource ID of the Container App's environment. ManagedEnvironmentID *string + // Container App auto patch configuration. + PatchingConfiguration *ContainerAppPropertiesPatchingConfiguration + // Container App versioned application definition. Template *Template @@ -1051,6 +1065,14 @@ type ContainerAppProperties struct { ProvisioningState *ContainerAppProvisioningState } +// ContainerAppPropertiesPatchingConfiguration - Container App auto patch configuration. +type ContainerAppPropertiesPatchingConfiguration struct { + // Patching mode for the container app. Null or default in this field will be interpreted as Automatic by RP. Automatic mode + // will automatically apply available patches. Manual mode will require the user + // to manually apply patches. Disabled mode will stop patch detection and auto patching. + PatchingMode *PatchingMode +} + // ContainerAppSecret - Container App Secret. type ContainerAppSecret struct { // READ-ONLY; Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned identity. @@ -1066,6 +1088,87 @@ type ContainerAppSecret struct { Value *string } +// ContainerAppsBuildCollection - The response of a Container Apps Build Resource list operation. +type ContainerAppsBuildCollection struct { + // REQUIRED; The Container Apps Build Resource items on this page + Value []*ContainerAppsBuildResource + + // The link to the next page of items + NextLink *string +} + +// ContainerAppsBuildConfiguration - Configuration of the build. +type ContainerAppsBuildConfiguration struct { + // READ-ONLY; Base OS used to build and run the app. + BaseOs *string + + // READ-ONLY; List of environment variables to be passed to the build, secrets should not be used in environment variable. + EnvironmentVariables []*EnvironmentVariable + + // READ-ONLY; Platform to be used to build and run the app. + Platform *string + + // READ-ONLY; Platform version to be used to build and run the app. + PlatformVersion *string + + // READ-ONLY; List of steps to perform before the build. + PreBuildSteps []*PreBuildStepAutoGenerated +} + +// ContainerAppsBuildProperties - The ContainerAppBuild properties. +type ContainerAppsBuildProperties struct { + // READ-ONLY; Status of the build once it has been provisioned. + BuildStatus *BuildStatus + + // READ-ONLY; Configuration of the build. + Configuration *ContainerAppsBuildConfiguration + + // READ-ONLY; Container registry that the final image will be uploaded to. + DestinationContainerRegistry *ContainerRegistryWithCustomImageAutoGenerated + + // READ-ONLY; Endpoint from which the build logs can be streamed. + LogStreamEndpoint *string + + // READ-ONLY; Build provisioning state. + ProvisioningState *BuildProvisioningState +} + +// ContainerAppsBuildResource - Information pertaining to an individual build. +type ContainerAppsBuildResource struct { + // The resource-specific properties for this resource. + Properties *ContainerAppsBuildProperties + + // 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 +} + +// ContainerAppsPatchResource - Container App Patch +type ContainerAppsPatchResource struct { + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Properties that describes current states of the patch resource. + Properties *PatchProperties + + // 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 +} + // ContainerRegistry - Model representing a mapping from a container registry to the identity used to connect to it. type ContainerRegistry struct { // REQUIRED; Login server of the container registry. @@ -1085,6 +1188,15 @@ type ContainerRegistryWithCustomImage struct { Image *string } +// ContainerRegistryWithCustomImageAutoGenerated - Container registry that the final image will be uploaded to. +type ContainerRegistryWithCustomImageAutoGenerated struct { + // READ-ONLY; Login server of the container registry that the final image should be uploaded to. + Server *string + + // READ-ONLY; Full name that the final image should be uploaded as, including both image name and tag. + Image *string +} + // ContainerResources - Container App container resource requirements. type ContainerResources struct { // Required CPU in cores, e.g. 0.5 @@ -1935,6 +2047,24 @@ type ErrorDetail struct { Target *string } +// ErrorDetailAutoGenerated - The error detail. +type ErrorDetailAutoGenerated struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetailAutoGenerated + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + // ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. // (This also follows the OData error response format.). type ErrorResponse struct { @@ -1942,6 +2072,43 @@ type ErrorResponse struct { Error *ErrorDetail } +// ErrorResponseAutoGenerated - Common error response for all Azure Resource Manager APIs to return error details for failed +// operations. (This also follows the OData error response format.). +type ErrorResponseAutoGenerated struct { + // The error object. + Error *ErrorDetailAutoGenerated +} + +// ExecutionContainerStatus - Container Apps Job execution. +type ExecutionContainerStatus struct { + // Exit code + Code *int32 + + // Container Name. + Name *string + + // Container reason + Reason *string + + // Status of the container + Status *string +} + +// ExecutionJobStatus - Container Apps Job execution. +type ExecutionJobStatus struct { + // Pods in the execution. + Pods []*ExecutionPodStatus +} + +// ExecutionPodStatus - Container Apps Job execution. +type ExecutionPodStatus struct { + // Containers in the execution + Containers []*ExecutionContainerStatus + + // Pod Name. + Name *string +} + // ExtendedLocation - The complex type of the extended location. type ExtendedLocation struct { // The name of the extended location. @@ -2073,6 +2240,18 @@ type HTTPGet struct { Headers []*string } +// HTTPGetAutoGenerated - Model representing a http get request. +type HTTPGetAutoGenerated struct { + // READ-ONLY; URL to make HTTP GET request against. + URL *string + + // READ-ONLY; Name of the file that the request should be saved to. + FileName *string + + // READ-ONLY; List of headers to send with the request. + Headers []*string +} + // HTTPRetryPolicy - Policy that defines http request retry conditions type HTTPRetryPolicy struct { // Conditions that must be met for a request to be retried @@ -2291,6 +2470,10 @@ type InitContainer struct { // Container image tag. Image *string + // The type of the image. Set to CloudBuild to let the system manages the image, where user will not be able to update image + // through image field. Set to ContainerImage for user provided image. + ImageType *ImageType + // Custom container name. Name *string @@ -2304,7 +2487,7 @@ type InitContainer struct { // JavaComponent - Java Component. type JavaComponent struct { // Java Component resource specific properties - Properties *JavaComponentProperties + Properties JavaComponentPropertiesClassification // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string @@ -2328,9 +2511,15 @@ type JavaComponentConfigurationProperty struct { Value *string } -// JavaComponentProperties - Java Component resource specific properties +// JavaComponentIngress - Container App Ingress configuration. +type JavaComponentIngress struct { + // READ-ONLY; Hostname of the Java Component endpoint + Fqdn *string +} + +// JavaComponentProperties - Java Component common properties. type JavaComponentProperties struct { - // Type of the Java Component. + // REQUIRED; Type of the Java Component. ComponentType *JavaComponentType // List of Java Components configuration properties @@ -2343,6 +2532,9 @@ type JavaComponentProperties struct { ProvisioningState *JavaComponentProvisioningState } +// GetJavaComponentProperties implements the JavaComponentPropertiesClassification interface for type JavaComponentProperties. +func (j *JavaComponentProperties) GetJavaComponentProperties() *JavaComponentProperties { return j } + // JavaComponentServiceBind - Configuration to bind a Java Component to another Java Component type JavaComponentServiceBind struct { // Name of the service bind @@ -2509,6 +2701,9 @@ type JobExecutionNamesCollection struct { // JobExecutionProperties - Container Apps Job execution specific properties. type JobExecutionProperties struct { + // Detailed status of the job execution. + DetailedStatus *ExecutionJobStatus + // Job execution end time. EndTime *time.Time @@ -2680,6 +2875,15 @@ type LogAnalyticsConfiguration struct { SharedKey *string } +// LogLevelSetting - Log level settings for java workloads. +type LogLevelSetting struct { + // REQUIRED; The specified logger's log level. + Level *string + + // REQUIRED; Logger name. + Logger *string +} + // Login - The configuration settings of the login flow of users using ContainerApp Service Authentication/Authorization. type Login struct { // External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part @@ -2844,6 +3048,9 @@ type ManagedEnvironmentProperties struct { // Peer authentication settings for the Managed Environment PeerAuthentication *ManagedEnvironmentPropertiesPeerAuthentication + // Peer traffic settings for the Managed Environment + PeerTrafficConfiguration *ManagedEnvironmentPropertiesPeerTrafficConfiguration + // Vnet configuration for the environment VnetConfiguration *VnetConfiguration @@ -2875,6 +3082,18 @@ type ManagedEnvironmentPropertiesPeerAuthentication struct { Mtls *Mtls } +// ManagedEnvironmentPropertiesPeerTrafficConfiguration - Peer traffic settings for the Managed Environment +type ManagedEnvironmentPropertiesPeerTrafficConfiguration struct { + // Peer traffic encryption settings for the Managed Environment + Encryption *ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption +} + +// ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption - Peer traffic encryption settings for the Managed Environment +type ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption struct { + // Boolean indicating whether the peer traffic encryption is enabled + Enabled *bool +} + // ManagedEnvironmentStorage - Storage resource for managedEnvironment. type ManagedEnvironmentStorage struct { // Storage properties @@ -2949,6 +3168,34 @@ type Mtls struct { Enabled *bool } +// NacosComponent - Nacos properties. +type NacosComponent struct { + // REQUIRED; Type of the Java Component. + ComponentType *JavaComponentType + + // List of Java Components configuration properties + Configurations []*JavaComponentConfigurationProperty + + // Java Component Ingress configurations. + Ingress *JavaComponentIngress + + // List of Java Components that are bound to the Java component + ServiceBinds []*JavaComponentServiceBind + + // READ-ONLY; Provisioning state of the Java Component. + ProvisioningState *JavaComponentProvisioningState +} + +// GetJavaComponentProperties implements the JavaComponentPropertiesClassification interface for type NacosComponent. +func (n *NacosComponent) GetJavaComponentProperties() *JavaComponentProperties { + return &JavaComponentProperties{ + ComponentType: n.ComponentType, + Configurations: n.Configurations, + ProvisioningState: n.ProvisioningState, + ServiceBinds: n.ServiceBinds, + } +} + // NfsAzureFileProperties - NFS Azure File Properties. type NfsAzureFileProperties struct { // Access mode for storage @@ -3078,6 +3325,96 @@ type OtlpConfiguration struct { Name *string } +// PatchCollection - Container App patch collection +type PatchCollection struct { + // REQUIRED; Collection of patch resources. + Value []*ContainerAppsPatchResource + + // the link to the next page of items + NextLink *string +} + +// PatchDetails - The detailed info of patch operation performing when applying a patch. +type PatchDetails struct { + // READ-ONLY; The status of the patch detection. + DetectionStatus *DetectionStatus + + // READ-ONLY; The UTC timestamp that describes the latest detection was done. + LastDetectionTime *time.Time + + // READ-ONLY; The name of the target container for the patch. + TargetContainerName *string + + // READ-ONLY; The name of the target image for the patch. + TargetImage *string + + // READ-ONLY; The name of the new image created by the patch. + NewImageName *string + + // READ-ONLY; New layer update details in the target image. + NewLayer *PatchDetailsNewLayer + + // READ-ONLY; The old layer details in the target image. + OldLayer *PatchDetailsOldLayer + + // READ-ONLY; The type for the patch. + PatchType *PatchType +} + +// PatchDetailsNewLayer - New layer update details in the target image. +type PatchDetailsNewLayer struct { + // The framework and its version in the new run image for the target image. + FrameworkAndVersion *string + + // The details of the new layer for the target image. + Name *string + + // The OS name and its version in the new run image for the target image. + OSAndVersion *string +} + +// PatchDetailsOldLayer - The old layer details in the target image. +type PatchDetailsOldLayer struct { + // The framework and its version in the old run image for the target image. + FrameworkAndVersion *string + + // The details of the old layer for the target image. + Name *string + + // The OS name and its version in the old run image for the target image. + OSAndVersion *string +} + +// PatchProperties - Top level properties that describes current states of the patch resource +type PatchProperties struct { + // The Azure resource id of the target container app for the patch. + TargetContainerAppID *string + + // The Azure resource id of the target environment for the patch. + TargetEnvironmentID *string + + // The Azure resource id of the target revision for the patch. + TargetRevisionID *string + + // READ-ONLY; The UTC timestamp that describes when the patch object was created. + CreatedAt *time.Time + + // READ-ONLY; The UTC timestamp that describes when the patch object was last updated. + LastModifiedAt *time.Time + + // READ-ONLY; The status of the patch operation. + PatchApplyStatus *PatchApplyStatus + + // READ-ONLY; Detailed info describes the patch operation for the target container app. + PatchDetails []*PatchDetails +} + +// PatchSkipConfig - The configuration for patcher to skip a patch or not. +type PatchSkipConfig struct { + // The flag to indicate whether to skip the patch or not. + Skip *bool +} + // PreBuildStep - Model representing a pre-build step. type PreBuildStep struct { // Description of the pre-build step. @@ -3090,6 +3427,18 @@ type PreBuildStep struct { Scripts []*string } +// PreBuildStepAutoGenerated - Model representing a pre-build step. +type PreBuildStepAutoGenerated struct { + // Http get request to send before the build. + HTTPGet *HTTPGetAutoGenerated + + // READ-ONLY; Description of the pre-build step. + Description *string + + // READ-ONLY; List of custom commands to run. + Scripts []*string +} + // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { @@ -3106,6 +3455,22 @@ type ProxyResource struct { Type *string } +// ProxyResourceAutoGenerated - The resource model definition for a Azure Resource Manager proxy resource. It will not have +// tags and a location +type ProxyResourceAutoGenerated struct { + // 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 +} + // QueueScaleRule - Container App container Azure Queue based scaling rule. type QueueScaleRule struct { // Authentication secrets for the queue scale rule. @@ -3233,6 +3598,21 @@ type Resource struct { Type *string } +// ResourceAutoGenerated - Common fields that are returned in the response for all Azure Resource Manager resources +type ResourceAutoGenerated struct { + // 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 +} + // Revision - Container App Revision. type Revision struct { // Revision resource specific properties @@ -3297,6 +3677,39 @@ type RevisionProperties struct { TrafficWeight *int32 } +// Runtime - Container App Runtime configuration. +type Runtime struct { + // .NET app configuration + Dotnet *RuntimeDotnet + + // Java app configuration + Java *RuntimeJava +} + +// RuntimeDotnet - .NET app configuration +type RuntimeDotnet struct { + // Auto configure the ASP.NET Core Data Protection feature + AutoConfigureDataProtection *bool +} + +// RuntimeJava - Java app configuration +type RuntimeJava struct { + // Enable jmx core metrics for the java app + EnableMetrics *bool + + // Diagnostic capabilities achieved by java agent + JavaAgent *RuntimeJavaAgent +} + +// RuntimeJavaAgent - Diagnostic capabilities achieved by java agent +type RuntimeJavaAgent struct { + // Enable java agent injection for the java app. + Enabled *bool + + // Settings of the log level for the java app. + LogLevelSettings []*LogLevelSetting +} + // Scale - Container App scaling configurations. type Scale struct { // Optional. Maximum number of container replicas. Defaults to 10 if not set. @@ -3430,6 +3843,87 @@ type SourceControlProperties struct { OperationState *SourceControlOperationState } +// SpringBootAdminComponent - Spring Boot Admin properties. +type SpringBootAdminComponent struct { + // REQUIRED; Type of the Java Component. + ComponentType *JavaComponentType + + // List of Java Components configuration properties + Configurations []*JavaComponentConfigurationProperty + + // Java Component Ingress configurations. + Ingress *JavaComponentIngress + + // List of Java Components that are bound to the Java component + ServiceBinds []*JavaComponentServiceBind + + // READ-ONLY; Provisioning state of the Java Component. + ProvisioningState *JavaComponentProvisioningState +} + +// GetJavaComponentProperties implements the JavaComponentPropertiesClassification interface for type SpringBootAdminComponent. +func (s *SpringBootAdminComponent) GetJavaComponentProperties() *JavaComponentProperties { + return &JavaComponentProperties{ + ComponentType: s.ComponentType, + Configurations: s.Configurations, + ProvisioningState: s.ProvisioningState, + ServiceBinds: s.ServiceBinds, + } +} + +// SpringCloudConfigComponent - Spring Cloud Config properties. +type SpringCloudConfigComponent struct { + // REQUIRED; Type of the Java Component. + ComponentType *JavaComponentType + + // List of Java Components configuration properties + Configurations []*JavaComponentConfigurationProperty + + // List of Java Components that are bound to the Java component + ServiceBinds []*JavaComponentServiceBind + + // READ-ONLY; Provisioning state of the Java Component. + ProvisioningState *JavaComponentProvisioningState +} + +// GetJavaComponentProperties implements the JavaComponentPropertiesClassification interface for type SpringCloudConfigComponent. +func (s *SpringCloudConfigComponent) GetJavaComponentProperties() *JavaComponentProperties { + return &JavaComponentProperties{ + ComponentType: s.ComponentType, + Configurations: s.Configurations, + ProvisioningState: s.ProvisioningState, + ServiceBinds: s.ServiceBinds, + } +} + +// SpringCloudEurekaComponent - Spring Cloud Eureka properties. +type SpringCloudEurekaComponent struct { + // REQUIRED; Type of the Java Component. + ComponentType *JavaComponentType + + // List of Java Components configuration properties + Configurations []*JavaComponentConfigurationProperty + + // Java Component Ingress configurations. + Ingress *JavaComponentIngress + + // List of Java Components that are bound to the Java component + ServiceBinds []*JavaComponentServiceBind + + // READ-ONLY; Provisioning state of the Java Component. + ProvisioningState *JavaComponentProvisioningState +} + +// GetJavaComponentProperties implements the JavaComponentPropertiesClassification interface for type SpringCloudEurekaComponent. +func (s *SpringCloudEurekaComponent) GetJavaComponentProperties() *JavaComponentProperties { + return &JavaComponentProperties{ + ComponentType: s.ComponentType, + Configurations: s.Configurations, + ProvisioningState: s.ProvisioningState, + ServiceBinds: s.ServiceBinds, + } +} + // 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/appcontainers/armappcontainers/models_serde.go b/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go index 8c4a7c579076..094a8f8d21e8 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go @@ -961,6 +961,7 @@ func (b BaseContainer) MarshalJSON() ([]byte, error) { populate(objectMap, "command", b.Command) populate(objectMap, "env", b.Env) populate(objectMap, "image", b.Image) + populate(objectMap, "imageType", b.ImageType) populate(objectMap, "name", b.Name) populate(objectMap, "resources", b.Resources) populate(objectMap, "volumeMounts", b.VolumeMounts) @@ -988,6 +989,9 @@ func (b *BaseContainer) UnmarshalJSON(data []byte) error { case "image": err = unpopulate(val, "Image", &b.Image) delete(rawMsg, key) + case "imageType": + err = unpopulate(val, "ImageType", &b.ImageType) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) @@ -1882,6 +1886,7 @@ func (c Configuration) MarshalJSON() ([]byte, error) { populate(objectMap, "ingress", c.Ingress) populate(objectMap, "maxInactiveRevisions", c.MaxInactiveRevisions) populate(objectMap, "registries", c.Registries) + populate(objectMap, "runtime", c.Runtime) populate(objectMap, "secrets", c.Secrets) populate(objectMap, "service", c.Service) return json.Marshal(objectMap) @@ -1911,6 +1916,9 @@ func (c *Configuration) UnmarshalJSON(data []byte) error { case "registries": err = unpopulate(val, "Registries", &c.Registries) delete(rawMsg, key) + case "runtime": + err = unpopulate(val, "Runtime", &c.Runtime) + delete(rawMsg, key) case "secrets": err = unpopulate(val, "Secrets", &c.Secrets) delete(rawMsg, key) @@ -2162,6 +2170,7 @@ func (c Container) MarshalJSON() ([]byte, error) { populate(objectMap, "command", c.Command) populate(objectMap, "env", c.Env) populate(objectMap, "image", c.Image) + populate(objectMap, "imageType", c.ImageType) populate(objectMap, "name", c.Name) populate(objectMap, "probes", c.Probes) populate(objectMap, "resources", c.Resources) @@ -2190,6 +2199,9 @@ func (c *Container) UnmarshalJSON(data []byte) error { case "image": err = unpopulate(val, "Image", &c.Image) delete(rawMsg, key) + case "imageType": + err = unpopulate(val, "ImageType", &c.ImageType) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) @@ -2593,6 +2605,7 @@ func (c ContainerAppProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "latestRevisionName", c.LatestRevisionName) populate(objectMap, "managedEnvironmentId", c.ManagedEnvironmentID) populate(objectMap, "outboundIpAddresses", c.OutboundIPAddresses) + populate(objectMap, "patchingConfiguration", c.PatchingConfiguration) populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "template", c.Template) populate(objectMap, "workloadProfileName", c.WorkloadProfileName) @@ -2635,6 +2648,9 @@ func (c *ContainerAppProperties) UnmarshalJSON(data []byte) error { case "outboundIpAddresses": err = unpopulate(val, "OutboundIPAddresses", &c.OutboundIPAddresses) delete(rawMsg, key) + case "patchingConfiguration": + err = unpopulate(val, "PatchingConfiguration", &c.PatchingConfiguration) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) @@ -2652,6 +2668,33 @@ func (c *ContainerAppProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ContainerAppPropertiesPatchingConfiguration. +func (c ContainerAppPropertiesPatchingConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "patchingMode", c.PatchingMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppPropertiesPatchingConfiguration. +func (c *ContainerAppPropertiesPatchingConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "patchingMode": + err = unpopulate(val, "PatchingMode", &c.PatchingMode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ContainerAppSecret. func (c ContainerAppSecret) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2691,6 +2734,209 @@ func (c *ContainerAppSecret) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ContainerAppsBuildCollection. +func (c ContainerAppsBuildCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppsBuildCollection. +func (c *ContainerAppsBuildCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerAppsBuildConfiguration. +func (c ContainerAppsBuildConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "baseOs", c.BaseOs) + populate(objectMap, "environmentVariables", c.EnvironmentVariables) + populate(objectMap, "platform", c.Platform) + populate(objectMap, "platformVersion", c.PlatformVersion) + populate(objectMap, "preBuildSteps", c.PreBuildSteps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppsBuildConfiguration. +func (c *ContainerAppsBuildConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "baseOs": + err = unpopulate(val, "BaseOs", &c.BaseOs) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &c.EnvironmentVariables) + delete(rawMsg, key) + case "platform": + err = unpopulate(val, "Platform", &c.Platform) + delete(rawMsg, key) + case "platformVersion": + err = unpopulate(val, "PlatformVersion", &c.PlatformVersion) + delete(rawMsg, key) + case "preBuildSteps": + err = unpopulate(val, "PreBuildSteps", &c.PreBuildSteps) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerAppsBuildProperties. +func (c ContainerAppsBuildProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "buildStatus", c.BuildStatus) + populate(objectMap, "configuration", c.Configuration) + populate(objectMap, "destinationContainerRegistry", c.DestinationContainerRegistry) + populate(objectMap, "logStreamEndpoint", c.LogStreamEndpoint) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppsBuildProperties. +func (c *ContainerAppsBuildProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "buildStatus": + err = unpopulate(val, "BuildStatus", &c.BuildStatus) + delete(rawMsg, key) + case "configuration": + err = unpopulate(val, "Configuration", &c.Configuration) + delete(rawMsg, key) + case "destinationContainerRegistry": + err = unpopulate(val, "DestinationContainerRegistry", &c.DestinationContainerRegistry) + delete(rawMsg, key) + case "logStreamEndpoint": + err = unpopulate(val, "LogStreamEndpoint", &c.LogStreamEndpoint) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerAppsBuildResource. +func (c ContainerAppsBuildResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppsBuildResource. +func (c *ContainerAppsBuildResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerAppsPatchResource. +func (c ContainerAppsPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppsPatchResource. +func (c *ContainerAppsPatchResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ContainerRegistry. func (c ContainerRegistry) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2753,6 +2999,37 @@ func (c *ContainerRegistryWithCustomImage) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryWithCustomImageAutoGenerated. +func (c ContainerRegistryWithCustomImageAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "image", c.Image) + populate(objectMap, "server", c.Server) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerRegistryWithCustomImageAutoGenerated. +func (c *ContainerRegistryWithCustomImageAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "image": + err = unpopulate(val, "Image", &c.Image) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &c.Server) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ContainerResources. func (c ContainerResources) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5097,15 +5374,19 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorDetailAutoGenerated. +func (e ErrorDetailAutoGenerated) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetailAutoGenerated. +func (e *ErrorDetailAutoGenerated) 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", e, err) @@ -5113,8 +5394,20 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &e.Error) + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) delete(rawMsg, key) } if err != nil { @@ -5124,16 +5417,15 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation. -func (e ExtendedLocation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", e.Name) - populate(objectMap, "type", e.Type) + populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation. -func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) 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", e, err) @@ -5141,7 +5433,159 @@ func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated. +func (e ErrorResponseAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated. +func (e *ErrorResponseAutoGenerated) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExecutionContainerStatus. +func (e ExecutionContainerStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "name", e.Name) + populate(objectMap, "reason", e.Reason) + populate(objectMap, "status", e.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutionContainerStatus. +func (e *ExecutionContainerStatus) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExecutionJobStatus. +func (e ExecutionJobStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "pods", e.Pods) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutionJobStatus. +func (e *ExecutionJobStatus) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "pods": + err = unpopulate(val, "Pods", &e.Pods) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExecutionPodStatus. +func (e ExecutionPodStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containers", e.Containers) + populate(objectMap, "name", e.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutionPodStatus. +func (e *ExecutionPodStatus) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "containers": + err = unpopulate(val, "Containers", &e.Containers) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation. +func (e ExtendedLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", e.Name) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation. +func (e *ExtendedLocation) 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", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) case "type": @@ -5467,6 +5911,41 @@ func (h *HTTPGet) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type HTTPGetAutoGenerated. +func (h HTTPGetAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fileName", h.FileName) + populate(objectMap, "headers", h.Headers) + populate(objectMap, "url", h.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPGetAutoGenerated. +func (h *HTTPGetAutoGenerated) 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", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fileName": + err = unpopulate(val, "FileName", &h.FileName) + delete(rawMsg, key) + case "headers": + err = unpopulate(val, "Headers", &h.Headers) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &h.URL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type HTTPRetryPolicy. func (h HTTPRetryPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -6004,6 +6483,7 @@ func (i InitContainer) MarshalJSON() ([]byte, error) { populate(objectMap, "command", i.Command) populate(objectMap, "env", i.Env) populate(objectMap, "image", i.Image) + populate(objectMap, "imageType", i.ImageType) populate(objectMap, "name", i.Name) populate(objectMap, "resources", i.Resources) populate(objectMap, "volumeMounts", i.VolumeMounts) @@ -6031,6 +6511,9 @@ func (i *InitContainer) UnmarshalJSON(data []byte) error { case "image": err = unpopulate(val, "Image", &i.Image) delete(rawMsg, key) + case "imageType": + err = unpopulate(val, "ImageType", &i.ImageType) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) @@ -6075,7 +6558,7 @@ func (j *JavaComponent) UnmarshalJSON(data []byte) error { err = unpopulate(val, "Name", &j.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &j.Properties) + j.Properties, err = unmarshalJavaComponentPropertiesClassification(val) delete(rawMsg, key) case "systemData": err = unpopulate(val, "SystemData", &j.SystemData) @@ -6122,10 +6605,37 @@ func (j *JavaComponentConfigurationProperty) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type JavaComponentIngress. +func (j JavaComponentIngress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fqdn", j.Fqdn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JavaComponentIngress. +func (j *JavaComponentIngress) 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", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fqdn": + err = unpopulate(val, "Fqdn", &j.Fqdn) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type JavaComponentProperties. func (j JavaComponentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "componentType", j.ComponentType) + objectMap["componentType"] = j.ComponentType populate(objectMap, "configurations", j.Configurations) populate(objectMap, "provisioningState", j.ProvisioningState) populate(objectMap, "serviceBinds", j.ServiceBinds) @@ -6585,6 +7095,7 @@ func (j *JobExecutionNamesCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JobExecutionProperties. func (j JobExecutionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "detailedStatus", j.DetailedStatus) populateDateTimeRFC3339(objectMap, "endTime", j.EndTime) populateDateTimeRFC3339(objectMap, "startTime", j.StartTime) populate(objectMap, "status", j.Status) @@ -6601,6 +7112,9 @@ func (j *JobExecutionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "detailedStatus": + err = unpopulate(val, "DetailedStatus", &j.DetailedStatus) + delete(rawMsg, key) case "endTime": err = unpopulateDateTimeRFC3339(val, "EndTime", &j.EndTime) delete(rawMsg, key) @@ -7080,6 +7594,37 @@ func (l *LogAnalyticsConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LogLevelSetting. +func (l LogLevelSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "level", l.Level) + populate(objectMap, "logger", l.Logger) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogLevelSetting. +func (l *LogLevelSetting) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "level": + err = unpopulate(val, "Level", &l.Level) + delete(rawMsg, key) + case "logger": + err = unpopulate(val, "Logger", &l.Logger) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Login. func (l Login) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -7435,6 +7980,7 @@ func (m ManagedEnvironmentProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "kedaConfiguration", m.KedaConfiguration) populate(objectMap, "openTelemetryConfiguration", m.OpenTelemetryConfiguration) populate(objectMap, "peerAuthentication", m.PeerAuthentication) + populate(objectMap, "peerTrafficConfiguration", m.PeerTrafficConfiguration) populate(objectMap, "provisioningState", m.ProvisioningState) populate(objectMap, "staticIp", m.StaticIP) populate(objectMap, "vnetConfiguration", m.VnetConfiguration) @@ -7491,6 +8037,9 @@ func (m *ManagedEnvironmentProperties) UnmarshalJSON(data []byte) error { case "peerAuthentication": err = unpopulate(val, "PeerAuthentication", &m.PeerAuthentication) delete(rawMsg, key) + case "peerTrafficConfiguration": + err = unpopulate(val, "PeerTrafficConfiguration", &m.PeerTrafficConfiguration) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) delete(rawMsg, key) @@ -7541,6 +8090,60 @@ func (m *ManagedEnvironmentPropertiesPeerAuthentication) UnmarshalJSON(data []by return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentPropertiesPeerTrafficConfiguration. +func (m ManagedEnvironmentPropertiesPeerTrafficConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encryption", m.Encryption) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentPropertiesPeerTrafficConfiguration. +func (m *ManagedEnvironmentPropertiesPeerTrafficConfiguration) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encryption": + err = unpopulate(val, "Encryption", &m.Encryption) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption. +func (m ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", m.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption. +func (m *ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentStorage. func (m ManagedEnvironmentStorage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -7766,17 +8369,19 @@ func (m *Mtls) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type NfsAzureFileProperties. -func (n NfsAzureFileProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NacosComponent. +func (n NacosComponent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "accessMode", n.AccessMode) - populate(objectMap, "server", n.Server) - populate(objectMap, "shareName", n.ShareName) + objectMap["componentType"] = JavaComponentTypeNacos + populate(objectMap, "configurations", n.Configurations) + populate(objectMap, "ingress", n.Ingress) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "serviceBinds", n.ServiceBinds) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NfsAzureFileProperties. -func (n *NfsAzureFileProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type NacosComponent. +func (n *NacosComponent) 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", n, err) @@ -7784,7 +8389,48 @@ func (n *NfsAzureFileProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "accessMode": + case "componentType": + err = unpopulate(val, "ComponentType", &n.ComponentType) + delete(rawMsg, key) + case "configurations": + err = unpopulate(val, "Configurations", &n.Configurations) + delete(rawMsg, key) + case "ingress": + err = unpopulate(val, "Ingress", &n.Ingress) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "serviceBinds": + err = unpopulate(val, "ServiceBinds", &n.ServiceBinds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NfsAzureFileProperties. +func (n NfsAzureFileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessMode", n.AccessMode) + populate(objectMap, "server", n.Server) + populate(objectMap, "shareName", n.ShareName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NfsAzureFileProperties. +func (n *NfsAzureFileProperties) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessMode": err = unpopulate(val, "AccessMode", &n.AccessMode) delete(rawMsg, key) case "server": @@ -8128,6 +8774,240 @@ func (o *OtlpConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PatchCollection. +func (p PatchCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchCollection. +func (p *PatchCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PatchDetails. +func (p PatchDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "detectionStatus", p.DetectionStatus) + populateDateTimeRFC3339(objectMap, "lastDetectionTime", p.LastDetectionTime) + populate(objectMap, "newImageName", p.NewImageName) + populate(objectMap, "newLayer", p.NewLayer) + populate(objectMap, "oldLayer", p.OldLayer) + populate(objectMap, "patchType", p.PatchType) + populate(objectMap, "targetContainerName", p.TargetContainerName) + populate(objectMap, "targetImage", p.TargetImage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchDetails. +func (p *PatchDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "detectionStatus": + err = unpopulate(val, "DetectionStatus", &p.DetectionStatus) + delete(rawMsg, key) + case "lastDetectionTime": + err = unpopulateDateTimeRFC3339(val, "LastDetectionTime", &p.LastDetectionTime) + delete(rawMsg, key) + case "newImageName": + err = unpopulate(val, "NewImageName", &p.NewImageName) + delete(rawMsg, key) + case "newLayer": + err = unpopulate(val, "NewLayer", &p.NewLayer) + delete(rawMsg, key) + case "oldLayer": + err = unpopulate(val, "OldLayer", &p.OldLayer) + delete(rawMsg, key) + case "patchType": + err = unpopulate(val, "PatchType", &p.PatchType) + delete(rawMsg, key) + case "targetContainerName": + err = unpopulate(val, "TargetContainerName", &p.TargetContainerName) + delete(rawMsg, key) + case "targetImage": + err = unpopulate(val, "TargetImage", &p.TargetImage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PatchDetailsNewLayer. +func (p PatchDetailsNewLayer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "frameworkAndVersion", p.FrameworkAndVersion) + populate(objectMap, "name", p.Name) + populate(objectMap, "osAndVersion", p.OSAndVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchDetailsNewLayer. +func (p *PatchDetailsNewLayer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "frameworkAndVersion": + err = unpopulate(val, "FrameworkAndVersion", &p.FrameworkAndVersion) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "osAndVersion": + err = unpopulate(val, "OSAndVersion", &p.OSAndVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PatchDetailsOldLayer. +func (p PatchDetailsOldLayer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "frameworkAndVersion", p.FrameworkAndVersion) + populate(objectMap, "name", p.Name) + populate(objectMap, "osAndVersion", p.OSAndVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchDetailsOldLayer. +func (p *PatchDetailsOldLayer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "frameworkAndVersion": + err = unpopulate(val, "FrameworkAndVersion", &p.FrameworkAndVersion) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "osAndVersion": + err = unpopulate(val, "OSAndVersion", &p.OSAndVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PatchProperties. +func (p PatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "createdAt", p.CreatedAt) + populateDateTimeRFC3339(objectMap, "lastModifiedAt", p.LastModifiedAt) + populate(objectMap, "patchApplyStatus", p.PatchApplyStatus) + populate(objectMap, "patchDetails", p.PatchDetails) + populate(objectMap, "targetContainerAppId", p.TargetContainerAppID) + populate(objectMap, "targetEnvironmentId", p.TargetEnvironmentID) + populate(objectMap, "targetRevisionId", p.TargetRevisionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchProperties. +func (p *PatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &p.CreatedAt) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &p.LastModifiedAt) + delete(rawMsg, key) + case "patchApplyStatus": + err = unpopulate(val, "PatchApplyStatus", &p.PatchApplyStatus) + delete(rawMsg, key) + case "patchDetails": + err = unpopulate(val, "PatchDetails", &p.PatchDetails) + delete(rawMsg, key) + case "targetContainerAppId": + err = unpopulate(val, "TargetContainerAppID", &p.TargetContainerAppID) + delete(rawMsg, key) + case "targetEnvironmentId": + err = unpopulate(val, "TargetEnvironmentID", &p.TargetEnvironmentID) + delete(rawMsg, key) + case "targetRevisionId": + err = unpopulate(val, "TargetRevisionID", &p.TargetRevisionID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PatchSkipConfig. +func (p PatchSkipConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "skip", p.Skip) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PatchSkipConfig. +func (p *PatchSkipConfig) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "skip": + err = unpopulate(val, "Skip", &p.Skip) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PreBuildStep. func (p PreBuildStep) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -8163,6 +9043,41 @@ func (p *PreBuildStep) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PreBuildStepAutoGenerated. +func (p PreBuildStepAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", p.Description) + populate(objectMap, "httpGet", p.HTTPGet) + populate(objectMap, "scripts", p.Scripts) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PreBuildStepAutoGenerated. +func (p *PreBuildStepAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "httpGet": + err = unpopulate(val, "HTTPGet", &p.HTTPGet) + delete(rawMsg, key) + case "scripts": + err = unpopulate(val, "Scripts", &p.Scripts) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ProxyResource. func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -8202,6 +9117,45 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ProxyResourceAutoGenerated. +func (p ProxyResourceAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResourceAutoGenerated. +func (p *ProxyResourceAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type QueueScaleRule. func (q QueueScaleRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -8522,6 +9476,45 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated. +func (r ResourceAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated. +func (r *ResourceAutoGenerated) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Revision. func (r Revision) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -8663,6 +9656,126 @@ func (r *RevisionProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Runtime. +func (r Runtime) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dotnet", r.Dotnet) + populate(objectMap, "java", r.Java) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Runtime. +func (r *Runtime) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dotnet": + err = unpopulate(val, "Dotnet", &r.Dotnet) + delete(rawMsg, key) + case "java": + err = unpopulate(val, "Java", &r.Java) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RuntimeDotnet. +func (r RuntimeDotnet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoConfigureDataProtection", r.AutoConfigureDataProtection) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuntimeDotnet. +func (r *RuntimeDotnet) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "autoConfigureDataProtection": + err = unpopulate(val, "AutoConfigureDataProtection", &r.AutoConfigureDataProtection) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RuntimeJava. +func (r RuntimeJava) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enableMetrics", r.EnableMetrics) + populate(objectMap, "javaAgent", r.JavaAgent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuntimeJava. +func (r *RuntimeJava) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enableMetrics": + err = unpopulate(val, "EnableMetrics", &r.EnableMetrics) + delete(rawMsg, key) + case "javaAgent": + err = unpopulate(val, "JavaAgent", &r.JavaAgent) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RuntimeJavaAgent. +func (r RuntimeJavaAgent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", r.Enabled) + populate(objectMap, "logLevelSettings", r.LogLevelSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RuntimeJavaAgent. +func (r *RuntimeJavaAgent) 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", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) + delete(rawMsg, key) + case "logLevelSettings": + err = unpopulate(val, "LogLevelSettings", &r.LogLevelSettings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Scale. func (s Scale) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -9048,6 +10161,131 @@ func (s *SourceControlProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SpringBootAdminComponent. +func (s SpringBootAdminComponent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["componentType"] = JavaComponentTypeSpringBootAdmin + populate(objectMap, "configurations", s.Configurations) + populate(objectMap, "ingress", s.Ingress) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "serviceBinds", s.ServiceBinds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SpringBootAdminComponent. +func (s *SpringBootAdminComponent) 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 "componentType": + err = unpopulate(val, "ComponentType", &s.ComponentType) + delete(rawMsg, key) + case "configurations": + err = unpopulate(val, "Configurations", &s.Configurations) + delete(rawMsg, key) + case "ingress": + err = unpopulate(val, "Ingress", &s.Ingress) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "serviceBinds": + err = unpopulate(val, "ServiceBinds", &s.ServiceBinds) + 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 SpringCloudConfigComponent. +func (s SpringCloudConfigComponent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["componentType"] = JavaComponentTypeSpringCloudConfig + populate(objectMap, "configurations", s.Configurations) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "serviceBinds", s.ServiceBinds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SpringCloudConfigComponent. +func (s *SpringCloudConfigComponent) 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 "componentType": + err = unpopulate(val, "ComponentType", &s.ComponentType) + delete(rawMsg, key) + case "configurations": + err = unpopulate(val, "Configurations", &s.Configurations) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "serviceBinds": + err = unpopulate(val, "ServiceBinds", &s.ServiceBinds) + 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 SpringCloudEurekaComponent. +func (s SpringCloudEurekaComponent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["componentType"] = JavaComponentTypeSpringCloudEureka + populate(objectMap, "configurations", s.Configurations) + populate(objectMap, "ingress", s.Ingress) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "serviceBinds", s.ServiceBinds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SpringCloudEurekaComponent. +func (s *SpringCloudEurekaComponent) 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 "componentType": + err = unpopulate(val, "ComponentType", &s.ComponentType) + delete(rawMsg, key) + case "configurations": + err = unpopulate(val, "Configurations", &s.Configurations) + delete(rawMsg, key) + case "ingress": + err = unpopulate(val, "Ingress", &s.Ingress) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "serviceBinds": + err = unpopulate(val, "ServiceBinds", &s.ServiceBinds) + 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/appcontainers/armappcontainers/namespaces_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go index a6536750c583..fc899ae339a0 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go @@ -46,7 +46,7 @@ func NewNamespacesClient(subscriptionID string, credential azcore.TokenCredentia // CheckNameAvailability - Checks if resource name is available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - checkNameAvailabilityRequest - The check name availability request. @@ -94,7 +94,7 @@ func (client *NamespacesClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkNameAvailabilityRequest); err != nil { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client_example_test.go deleted file mode 100644 index a869882211a7..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client_example_test.go +++ /dev/null @@ -1,75 +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 armappcontainers_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/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Certificates_CheckNameAvailability.json -func ExampleNamespacesClient_CheckNameAvailability_certificatesCheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().CheckNameAvailability(ctx, "examplerg", "testcontainerenv", armappcontainers.CheckNameAvailabilityRequest{ - Name: to.Ptr("testcertificatename"), - Type: to.Ptr("Microsoft.App/managedEnvironments/certificates"), - }, 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 = armappcontainers.CheckNameAvailabilityResponse{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(armappcontainers.CheckNameAvailabilityReason("None")), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/ContainerApps_CheckNameAvailability.json -func ExampleNamespacesClient_CheckNameAvailability_containerAppsCheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNamespacesClient().CheckNameAvailability(ctx, "examplerg", "testcontainerenv", armappcontainers.CheckNameAvailabilityRequest{ - Name: to.Ptr("testcappname"), - Type: to.Ptr("Microsoft.App/containerApps"), - }, 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 = armappcontainers.CheckNameAvailabilityResponse{ - // Message: to.Ptr(""), - // NameAvailable: to.Ptr(true), - // Reason: to.Ptr(armappcontainers.CheckNameAvailabilityReason("None")), - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/operations_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/operations_client.go index f89a1409bec9..48dc7bd51eae 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/operations_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available RP operations. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-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", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/operations_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/operations_client_example_test.go deleted file mode 100644 index 23f97cd7f493..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/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 armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/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 := armappcontainers.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.AvailableOperations = armappcontainers.AvailableOperations{ - // Value: []*armappcontainers.OperationDetail{ - // { - // Name: to.Ptr("Microsoft.App/containerApps/Read"), - // Display: &armappcontainers.OperationDisplay{ - // Description: to.Ptr("Get the properties of a Container App"), - // Operation: to.Ptr("Get Container App"), - // Provider: to.Ptr("Microsoft Apps"), - // Resource: to.Ptr("Container App"), - // }, - // Origin: to.Ptr("user,system"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/options.go b/sdk/resourcemanager/appcontainers/armappcontainers/options.go index e253c7025204..d314db000b51 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/options.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/options.go @@ -295,6 +295,24 @@ type ContainerAppsAuthConfigsClientListByContainerAppOptions struct { // placeholder for future optional parameters } +// ContainerAppsBuildsByContainerAppClientListOptions contains the optional parameters for the ContainerAppsBuildsByContainerAppClient.NewListPager +// method. +type ContainerAppsBuildsByContainerAppClientListOptions struct { + // placeholder for future optional parameters +} + +// ContainerAppsBuildsClientBeginDeleteOptions contains the optional parameters for the ContainerAppsBuildsClient.BeginDelete +// method. +type ContainerAppsBuildsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ContainerAppsBuildsClientGetOptions contains the optional parameters for the ContainerAppsBuildsClient.Get method. +type ContainerAppsBuildsClientGetOptions struct { + // placeholder for future optional parameters +} + // ContainerAppsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerAppsClient.BeginCreateOrUpdate // method. type ContainerAppsClientBeginCreateOrUpdateOptions struct { @@ -391,6 +409,39 @@ type ContainerAppsDiagnosticsClientListRevisionsOptions struct { Filter *string } +// ContainerAppsPatchesClientBeginApplyOptions contains the optional parameters for the ContainerAppsPatchesClient.BeginApply +// method. +type ContainerAppsPatchesClientBeginApplyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ContainerAppsPatchesClientBeginDeleteOptions contains the optional parameters for the ContainerAppsPatchesClient.BeginDelete +// method. +type ContainerAppsPatchesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ContainerAppsPatchesClientBeginSkipConfigureOptions contains the optional parameters for the ContainerAppsPatchesClient.BeginSkipConfigure +// method. +type ContainerAppsPatchesClientBeginSkipConfigureOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ContainerAppsPatchesClientGetOptions contains the optional parameters for the ContainerAppsPatchesClient.Get method. +type ContainerAppsPatchesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ContainerAppsPatchesClientListByContainerAppOptions contains the optional parameters for the ContainerAppsPatchesClient.NewListByContainerAppPager +// method. +type ContainerAppsPatchesClientListByContainerAppOptions struct { + // The filter to apply on the operation. For example, $filter=properties/patchApplyStatus eq 'Succeeded' + Filter *string +} + // ContainerAppsRevisionReplicasClientGetReplicaOptions contains the optional parameters for the ContainerAppsRevisionReplicasClient.GetReplica // method. type ContainerAppsRevisionReplicasClientGetReplicaOptions struct { @@ -560,6 +611,12 @@ type DotNetComponentsClientListOptions struct { // placeholder for future optional parameters } +// FunctionsExtensionClientInvokeFunctionsHostOptions contains the optional parameters for the FunctionsExtensionClient.InvokeFunctionsHost +// method. +type FunctionsExtensionClientInvokeFunctionsHostOptions struct { + // placeholder for future optional parameters +} + // JavaComponentsClientBeginCreateOrUpdateOptions contains the optional parameters for the JavaComponentsClient.BeginCreateOrUpdate // method. type JavaComponentsClientBeginCreateOrUpdateOptions struct { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/polymorphic_helpers.go b/sdk/resourcemanager/appcontainers/armappcontainers/polymorphic_helpers.go new file mode 100644 index 000000000000..6f3773bc4139 --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/polymorphic_helpers.go @@ -0,0 +1,38 @@ +//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 armappcontainers + +import "encoding/json" + +func unmarshalJavaComponentPropertiesClassification(rawMsg json.RawMessage) (JavaComponentPropertiesClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b JavaComponentPropertiesClassification + switch m["componentType"] { + case string(JavaComponentTypeNacos): + b = &NacosComponent{} + case string(JavaComponentTypeSpringBootAdmin): + b = &SpringBootAdminComponent{} + case string(JavaComponentTypeSpringCloudConfig): + b = &SpringCloudConfigComponent{} + case string(JavaComponentTypeSpringCloudEureka): + b = &SpringCloudEurekaComponent{} + default: + b = &JavaComponentProperties{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/responses.go b/sdk/resourcemanager/appcontainers/armappcontainers/responses.go index cb1d443a118b..3e10ea5a10a1 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/responses.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/responses.go @@ -299,6 +299,23 @@ type ContainerAppsAuthConfigsClientListByContainerAppResponse struct { AuthConfigCollection } +// ContainerAppsBuildsByContainerAppClientListResponse contains the response from method ContainerAppsBuildsByContainerAppClient.NewListPager. +type ContainerAppsBuildsByContainerAppClientListResponse struct { + // The response of a Container Apps Build Resource list operation. + ContainerAppsBuildCollection +} + +// ContainerAppsBuildsClientDeleteResponse contains the response from method ContainerAppsBuildsClient.BeginDelete. +type ContainerAppsBuildsClientDeleteResponse struct { + // placeholder for future response values +} + +// ContainerAppsBuildsClientGetResponse contains the response from method ContainerAppsBuildsClient.Get. +type ContainerAppsBuildsClientGetResponse struct { + // Information pertaining to an individual build. + ContainerAppsBuildResource +} + // ContainerAppsClientCreateOrUpdateResponse contains the response from method ContainerAppsClient.BeginCreateOrUpdate. type ContainerAppsClientCreateOrUpdateResponse struct { // Container App. @@ -394,6 +411,34 @@ type ContainerAppsDiagnosticsClientListRevisionsResponse struct { RevisionCollection } +// ContainerAppsPatchesClientApplyResponse contains the response from method ContainerAppsPatchesClient.BeginApply. +type ContainerAppsPatchesClientApplyResponse struct { + // Container App Patch + ContainerAppsPatchResource +} + +// ContainerAppsPatchesClientDeleteResponse contains the response from method ContainerAppsPatchesClient.BeginDelete. +type ContainerAppsPatchesClientDeleteResponse struct { + // placeholder for future response values +} + +// ContainerAppsPatchesClientGetResponse contains the response from method ContainerAppsPatchesClient.Get. +type ContainerAppsPatchesClientGetResponse struct { + // Container App Patch + ContainerAppsPatchResource +} + +// ContainerAppsPatchesClientListByContainerAppResponse contains the response from method ContainerAppsPatchesClient.NewListByContainerAppPager. +type ContainerAppsPatchesClientListByContainerAppResponse struct { + // Container App patch collection + PatchCollection +} + +// ContainerAppsPatchesClientSkipConfigureResponse contains the response from method ContainerAppsPatchesClient.BeginSkipConfigure. +type ContainerAppsPatchesClientSkipConfigureResponse struct { + // placeholder for future response values +} + // ContainerAppsRevisionReplicasClientGetReplicaResponse contains the response from method ContainerAppsRevisionReplicasClient.GetReplica. type ContainerAppsRevisionReplicasClientGetReplicaResponse struct { // Container App Revision Replica. @@ -560,6 +605,11 @@ type DotNetComponentsClientUpdateResponse struct { DotNetComponent } +// FunctionsExtensionClientInvokeFunctionsHostResponse contains the response from method FunctionsExtensionClient.InvokeFunctionsHost. +type FunctionsExtensionClientInvokeFunctionsHostResponse struct { + Value *string +} + // JavaComponentsClientCreateOrUpdateResponse contains the response from method JavaComponentsClient.BeginCreateOrUpdate. type JavaComponentsClientCreateOrUpdateResponse struct { // Java Component. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/usages_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/usages_client.go index 19505aaf3441..4ae0c1ac7a75 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/usages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/usages_client.go @@ -46,7 +46,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListPager - Gets, for the specified location, the current resource usage information as well as the limits under the // subscription. // -// Generated from API version 2023-11-02-preview +// Generated from API version 2024-02-02-preview // - location - The location for which resource usage is queried. // - options - UsagesClientListOptions contains the optional parameters for the UsagesClient.NewListPager method. func (client *UsagesClient) NewListPager(location string, options *UsagesClientListOptions) *runtime.Pager[UsagesClientListResponse] { @@ -88,7 +88,7 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, location stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-02-preview") + reqQP.Set("api-version", "2024-02-02-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/usages_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/usages_client_example_test.go deleted file mode 100644 index ea61f01cbe55..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/usages_client_example_test.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappcontainers_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appcontainers/armappcontainers/v3" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d74afb775446d7f0bc1810fdc5a128c56289e854/specification/app/resource-manager/Microsoft.App/preview/2023-11-02-preview/examples/Usages_List.json -func ExampleUsagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappcontainers.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsagesClient().NewListPager("westus", 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.ListUsagesResult = armappcontainers.ListUsagesResult{ - // Value: []*armappcontainers.Usage{ - // { - // Name: &armappcontainers.UsageName{ - // LocalizedValue: to.Ptr("ManagedEnvironmentCount"), - // Value: to.Ptr("ManagedEnvironmentCount"), - // }, - // CurrentValue: to.Ptr[float32](5), - // Limit: to.Ptr[float32](10), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armappcontainers.UsageName{ - // LocalizedValue: to.Ptr("ManagedEnvironmentCores"), - // Value: to.Ptr("ManagedEnvironmentCores"), - // }, - // CurrentValue: to.Ptr[float32](3), - // Limit: to.Ptr[float32](20), - // Unit: to.Ptr("Count"), - // }}, - // } - } -}