From ea07f7fa0ad318f8a1842b165415743334d61f9b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 25 Dec 2024 02:51:17 +0000 Subject: [PATCH] CodeGen from PR 31957 in Azure/azure-rest-api-specs Merge 3d597e09665e1cbdeda9e379060f4d20210cded0 into 31768b1c81856200396ad0a29822b009b071272a --- .../armappcontainers/CHANGELOG.md | 21 + .../appcontainers/armappcontainers/README.md | 2 +- .../armappcontainers/appresiliency_client.go | 384 - .../appresiliency_client_example_test.go | 382 - .../armappcontainers/autorest.md | 7 +- .../availableworkloadprofiles_client.go | 13 +- ...bleworkloadprofiles_client_example_test.go | 190 - .../armappcontainers/billingmeters_client.go | 13 +- .../billingmeters_client_example_test.go | 107 - .../armappcontainers/buildauthtoken_client.go | 114 - .../buildauthtoken_client_example_test.go | 42 - .../armappcontainers/builders_client.go | 461 - .../builders_client_example_test.go | 478 - .../armappcontainers/builds_client.go | 281 - .../builds_client_example_test.go | 303 - .../buildsbybuilderresource_client.go | 110 - ...dsbybuilderresource_client_example_test.go | 174 - .../armappcontainers/certificates_client.go | 29 +- .../certificates_client_example_test.go | 280 - .../armappcontainers/client_factory.go | 138 +- .../connectedenvironments_client.go | 41 +- ...nnectedenvironments_client_example_test.go | 357 - ...onnectedenvironmentscertificates_client.go | 29 +- ...onmentscertificates_client_example_test.go | 223 - ...nectedenvironmentsdaprcomponents_client.go | 29 +- ...mentsdaprcomponents_client_example_test.go | 308 - .../connectedenvironmentsstorages_client.go | 25 +- ...nvironmentsstorages_client_example_test.go | 144 - .../armappcontainers/constants.go | 551 +- .../armappcontainers/containerapps_client.go | 63 +- .../containerapps_client_example_test.go | 2782 ----- .../containerappsapi_client.go | 17 +- .../containerappsapi_client_example_test.go | 92 - .../containerappsauthconfigs_client.go | 25 +- ...inerappsauthconfigs_client_example_test.go | 200 - .../containerappsbuilds_client.go | 196 - ...containerappsbuilds_client_example_test.go | 121 - ...ontainerappsbuildsbycontainerapp_client.go | 110 - ...uildsbycontainerapp_client_example_test.go | 170 - .../containerappsdiagnostics_client.go | 29 +- ...inerappsdiagnostics_client_example_test.go | 472 - .../containerappspatches_client.go | 433 - ...ontainerappspatches_client_example_test.go | 281 - .../containerappsrevisionreplicas_client.go | 17 +- ...ppsrevisionreplicas_client_example_test.go | 111 - .../containerappsrevisions_client.go | 29 +- ...tainerappsrevisions_client_example_test.go | 192 - .../containerappssessionpools_client.go | 464 - ...nerappssessionpools_client_example_test.go | 462 - .../containerappssourcecontrols_client.go | 42 +- ...rappssourcecontrols_client_example_test.go | 227 - .../daprcomponentresiliencypolicies_client.go | 334 - ...tresiliencypolicies_client_example_test.go | 392 - .../armappcontainers/daprcomponents_client.go | 29 +- .../daprcomponents_client_example_test.go | 547 - .../daprsubscriptions_client.go | 313 - .../daprsubscriptions_client_example_test.go | 409 - .../dotnetcomponents_client.go | 432 - .../dotnetcomponents_client_example_test.go | 443 - .../fake/appresiliency_server.go | 294 - .../fake/availableworkloadprofiles_server.go | 7 +- .../fake/billingmeters_server.go | 7 +- .../fake/buildauthtoken_server.go | 105 - .../armappcontainers/fake/builders_server.go | 354 - .../armappcontainers/fake/builds_server.go | 223 - .../fake/buildsbybuilderresource_server.go | 113 - .../fake/certificates_server.go | 9 +- .../fake/connectedenvironments_server.go | 7 +- ...onnectedenvironmentscertificates_server.go | 9 +- ...nectedenvironmentsdaprcomponents_server.go | 7 +- .../connectedenvironmentsstorages_server.go | 7 +- .../fake/containerapps_server.go | 7 +- .../fake/containerappsapi_server.go | 7 +- .../fake/containerappsauthconfigs_server.go | 7 +- .../fake/containerappsbuilds_server.go | 163 - ...ontainerappsbuildsbycontainerapp_server.go | 113 - .../fake/containerappsdiagnostics_server.go | 7 +- .../fake/containerappspatches_server.go | 341 - .../containerappsrevisionreplicas_server.go | 7 +- .../fake/containerappsrevisions_server.go | 7 +- .../fake/containerappssessionpools_server.go | 354 - .../containerappssourcecontrols_server.go | 45 +- .../daprcomponentresiliencypolicies_server.go | 263 - .../fake/daprcomponents_server.go | 7 +- .../fake/daprsubscriptions_server.go | 247 - .../fake/dotnetcomponents_server.go | 333 - .../fake/functionsextension_server.go | 109 - .../armappcontainers/fake/internal.go | 22 +- .../fake/javacomponents_server.go | 333 - .../armappcontainers/fake/jobs_server.go | 113 +- .../fake/jobsexecutions_server.go | 7 +- .../armappcontainers/fake/logicapps_server.go | 438 - .../fake/managedcertificates_server.go | 9 +- .../managedenvironmentdiagnostics_server.go | 7 +- ...onmentprivateendpointconnections_server.go | 273 - ...denvironmentprivatelinkresources_server.go | 113 - .../fake/managedenvironments_server.go | 7 +- .../managedenvironmentsdiagnostics_server.go | 7 +- .../managedenvironmentsstorages_server.go | 7 +- .../fake/managedenvironmentusages_server.go | 7 +- .../fake/namespaces_server.go | 7 +- .../fake/operations_server.go | 3 +- .../armappcontainers/fake/server_factory.go | 224 +- .../armappcontainers/fake/time_rfc3339.go | 3 +- .../armappcontainers/fake/usages_server.go | 7 +- .../functionsextension_client.go | 120 - .../functionsextension_client_example_test.go | 39 - .../appcontainers/armappcontainers/go.mod | 12 +- .../appcontainers/armappcontainers/go.sum | 23 - .../armappcontainers/interfaces.go | 19 - .../armappcontainers/javacomponents_client.go | 431 - .../javacomponents_client_example_test.go | 593 - .../armappcontainers/jobs_client.go | 225 +- .../jobs_client_example_test.go | 1482 --- .../armappcontainers/jobsexecutions_client.go | 13 +- .../jobsexecutions_client_example_test.go | 98 - .../armappcontainers/logicapps_client.go | 600 - .../logicapps_client_example_test.go | 384 - .../managedcertificates_client.go | 31 +- ...managedcertificates_client_example_test.go | 200 - .../managedenvironmentdiagnostics_client.go | 17 +- ...ironmentdiagnostics_client_example_test.go | 135 - ...onmentprivateendpointconnections_client.go | 346 - ...endpointconnections_client_example_test.go | 187 - ...denvironmentprivatelinkresources_client.go | 110 - ...rivatelinkresources_client_example_test.go | 58 - .../managedenvironments_client.go | 47 +- ...managedenvironments_client_example_test.go | 834 -- .../managedenvironmentsdiagnostics_client.go | 13 +- ...ronmentsdiagnostics_client_example_test.go | 104 - .../managedenvironmentsstorages_client.go | 25 +- ...nvironmentsstorages_client_example_test.go | 228 - .../managedenvironmentusages_client.go | 13 +- ...edenvironmentusages_client_example_test.go | 55 - .../appcontainers/armappcontainers/models.go | 1769 +-- .../armappcontainers/models_serde.go | 10030 +++++----------- .../armappcontainers/namespaces_client.go | 13 +- .../namespaces_client_example_test.go | 75 - .../armappcontainers/operations_client.go | 7 +- .../operations_client_example_test.go | 56 - .../appcontainers/armappcontainers/options.go | 386 - .../armappcontainers/polymorphic_helpers.go | 40 - .../armappcontainers/responses.go | 369 - .../armappcontainers/time_rfc3339.go | 3 +- .../armappcontainers/usages_client.go | 13 +- .../usages_client_example_test.go | 64 - 146 files changed, 3339 insertions(+), 35344 deletions(-) delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/appresiliency_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/appresiliency_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/buildauthtoken_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/buildauthtoken_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/builders_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/builders_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/builds_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/builds_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/buildsbybuilderresource_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/buildsbybuilderresource_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/certificates_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappsapi_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuilds_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuilds_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuildsbycontainerapp_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuildsbycontainerapp_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappspatches_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappspatches_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappssessionpools_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappssessionpools_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/daprcomponentresiliencypolicies_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/daprcomponentresiliencypolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/daprsubscriptions_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/daprsubscriptions_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/dotnetcomponents_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/dotnetcomponents_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/appresiliency_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/buildauthtoken_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/builders_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/builds_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/buildsbybuilderresource_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsbuilds_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsbuildsbycontainerapp_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappspatches_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssessionpools_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/daprcomponentresiliencypolicies_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/daprsubscriptions_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/dotnetcomponents_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/functionsextension_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/javacomponents_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/logicapps_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentprivateendpointconnections_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentprivatelinkresources_server.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/functionsextension_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/functionsextension_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/interfaces.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/jobs_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/logicapps_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/logicapps_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivateendpointconnections_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivatelinkresources_client.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentusages_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/polymorphic_helpers.go delete mode 100644 sdk/resourcemanager/appcontainers/armappcontainers/usages_client_example_test.go diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md b/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md index de3024fb26a8..80e327e82964 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md +++ b/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md @@ -1,5 +1,26 @@ # Release History +## 3.1.0 (2024-12-25) +### Features Added + +- New value `StorageTypeNfsAzureFile` added to enum type `StorageType` +- New enum type `Level` with values `LevelDebug`, `LevelError`, `LevelInfo`, `LevelOff`, `LevelTrace`, `LevelWarn` +- New struct `LoggerSetting` +- New struct `NfsAzureFileProperties` +- New struct `Runtime` +- New struct `RuntimeJava` +- New struct `RuntimeJavaAgent` +- New struct `RuntimeJavaAgentLogging` +- New field `Runtime` in struct `Configuration` +- New field `Identity` in struct `CustomScaleRule` +- New field `Identity` in struct `HTTPScaleRule` +- New field `Identity` in struct `JobScaleRule` +- New field `NfsAzureFile` in struct `ManagedEnvironmentStorageProperties` +- New field `AccountName`, `Identity` in struct `QueueScaleRule` +- New field `CooldownPeriod`, `PollingInterval` in struct `Scale` +- New field `Identity` in struct `TCPScaleRule` + + ## 3.1.0-beta.1 (2024-10-23) ### Features Added diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/README.md b/sdk/resourcemanager/appcontainers/armappcontainers/README.md index da49a196fb5c..f301eab16556 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/README.md +++ b/sdk/resourcemanager/appcontainers/armappcontainers/README.md @@ -55,7 +55,7 @@ clientFactory, err := armappcontainers.NewClientFactory(, cred, A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewAppResiliencyClient() +client := clientFactory.NewAvailableWorkloadProfilesClient() ``` ## Fakes diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/appresiliency_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/appresiliency_client.go deleted file mode 100644 index 8cf2a619e848..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/appresiliency_client.go +++ /dev/null @@ -1,384 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// AppResiliencyClient contains the methods for the AppResiliency group. -// Don't use this type directly, use NewAppResiliencyClient() instead. -type AppResiliencyClient struct { - internal *arm.Client - subscriptionID string -} - -// NewAppResiliencyClient creates a new instance of AppResiliencyClient 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 NewAppResiliencyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AppResiliencyClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &AppResiliencyClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Create or update container app resiliency policy. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - resiliencyEnvelope - The resiliency policy to create or update. -// - options - AppResiliencyClientCreateOrUpdateOptions contains the optional parameters for the AppResiliencyClient.CreateOrUpdate -// method. -func (client *AppResiliencyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, appName string, name string, resiliencyEnvelope AppResiliency, options *AppResiliencyClientCreateOrUpdateOptions) (AppResiliencyClientCreateOrUpdateResponse, error) { - var err error - const operationName = "AppResiliencyClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, appName, name, resiliencyEnvelope, options) - if err != nil { - return AppResiliencyClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AppResiliencyClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return AppResiliencyClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AppResiliencyClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, appName string, name string, resiliencyEnvelope AppResiliency, options *AppResiliencyClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}" - 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 appName == "" { - return nil, errors.New("parameter appName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{appName}", url.PathEscape(appName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resiliencyEnvelope); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *AppResiliencyClient) createOrUpdateHandleResponse(resp *http.Response) (AppResiliencyClientCreateOrUpdateResponse, error) { - result := AppResiliencyClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AppResiliency); err != nil { - return AppResiliencyClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete container app resiliency policy. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - options - AppResiliencyClientDeleteOptions contains the optional parameters for the AppResiliencyClient.Delete method. -func (client *AppResiliencyClient) Delete(ctx context.Context, resourceGroupName string, appName string, name string, options *AppResiliencyClientDeleteOptions) (AppResiliencyClientDeleteResponse, error) { - var err error - const operationName = "AppResiliencyClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, appName, name, options) - if err != nil { - return AppResiliencyClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AppResiliencyClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return AppResiliencyClientDeleteResponse{}, err - } - return AppResiliencyClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *AppResiliencyClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, appName string, name string, options *AppResiliencyClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}" - 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 appName == "" { - return nil, errors.New("parameter appName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{appName}", url.PathEscape(appName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get container app resiliency policy. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - options - AppResiliencyClientGetOptions contains the optional parameters for the AppResiliencyClient.Get method. -func (client *AppResiliencyClient) Get(ctx context.Context, resourceGroupName string, appName string, name string, options *AppResiliencyClientGetOptions) (AppResiliencyClientGetResponse, error) { - var err error - const operationName = "AppResiliencyClient.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, appName, name, options) - if err != nil { - return AppResiliencyClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AppResiliencyClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AppResiliencyClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *AppResiliencyClient) getCreateRequest(ctx context.Context, resourceGroupName string, appName string, name string, options *AppResiliencyClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}" - 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 appName == "" { - return nil, errors.New("parameter appName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{appName}", url.PathEscape(appName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - 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-08-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 *AppResiliencyClient) getHandleResponse(resp *http.Response) (AppResiliencyClientGetResponse, error) { - result := AppResiliencyClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AppResiliency); err != nil { - return AppResiliencyClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List container app resiliency policies. -// -// Generated from API version 2024-08-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. -func (client *AppResiliencyClient) NewListPager(resourceGroupName string, appName string, options *AppResiliencyClientListOptions) *runtime.Pager[AppResiliencyClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AppResiliencyClientListResponse]{ - More: func(page AppResiliencyClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AppResiliencyClientListResponse) (AppResiliencyClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AppResiliencyClient.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, appName, options) - }, nil) - if err != nil { - return AppResiliencyClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *AppResiliencyClient) listCreateRequest(ctx context.Context, resourceGroupName string, appName string, options *AppResiliencyClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies" - 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 appName == "" { - return nil, errors.New("parameter appName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{appName}", url.PathEscape(appName)) - 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-08-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 *AppResiliencyClient) listHandleResponse(resp *http.Response) (AppResiliencyClientListResponse, error) { - result := AppResiliencyClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AppResiliencyCollection); err != nil { - return AppResiliencyClientListResponse{}, err - } - return result, nil -} - -// Update - Update container app resiliency policy. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - resiliencyEnvelope - The resiliency policy to update. -// - options - AppResiliencyClientUpdateOptions contains the optional parameters for the AppResiliencyClient.Update method. -func (client *AppResiliencyClient) Update(ctx context.Context, resourceGroupName string, appName string, name string, resiliencyEnvelope AppResiliency, options *AppResiliencyClientUpdateOptions) (AppResiliencyClientUpdateResponse, error) { - var err error - const operationName = "AppResiliencyClient.Update" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, appName, name, resiliencyEnvelope, options) - if err != nil { - return AppResiliencyClientUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AppResiliencyClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AppResiliencyClientUpdateResponse{}, err - } - resp, err := client.updateHandleResponse(httpResp) - return resp, err -} - -// updateCreateRequest creates the Update request. -func (client *AppResiliencyClient) updateCreateRequest(ctx context.Context, resourceGroupName string, appName string, name string, resiliencyEnvelope AppResiliency, options *AppResiliencyClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}" - 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 appName == "" { - return nil, errors.New("parameter appName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{appName}", url.PathEscape(appName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resiliencyEnvelope); err != nil { - return nil, err - } - return req, nil -} - -// updateHandleResponse handles the Update response. -func (client *AppResiliencyClient) updateHandleResponse(resp *http.Response) (AppResiliencyClientUpdateResponse, error) { - result := AppResiliencyClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AppResiliency); err != nil { - return AppResiliencyClientUpdateResponse{}, err - } - return result, 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 be83e6036857..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 e5f077e81bc5..b5fd5e2da549 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/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.1.0-beta.1 -tag: package-preview-2024-08 +module-version: 3.1.0 ``` \ 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 f002bb1c0aae..a8de8337ff43 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // AvailableWorkloadProfilesClient contains the methods for the AvailableWorkloadProfiles group. @@ -29,7 +28,7 @@ type AvailableWorkloadProfilesClient struct { } // NewAvailableWorkloadProfilesClient creates a new instance of AvailableWorkloadProfilesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAvailableWorkloadProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AvailableWorkloadProfilesClient, error) { @@ -46,7 +45,7 @@ func NewAvailableWorkloadProfilesClient(subscriptionID string, credential azcore // NewGetPager - Get all available workload profiles for a location. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - location - The name of Azure region. // - options - AvailableWorkloadProfilesClientGetOptions contains the optional parameters for the AvailableWorkloadProfilesClient.NewGetPager // method. @@ -89,7 +88,7 @@ func (client *AvailableWorkloadProfilesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 36dbfbea0124..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 fb9d5607d509..e6de48f3ecf9 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // BillingMetersClient contains the methods for the BillingMeters group. @@ -29,7 +28,7 @@ type BillingMetersClient struct { } // NewBillingMetersClient creates a new instance of BillingMetersClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewBillingMetersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BillingMetersClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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) { @@ -88,7 +87,7 @@ func (client *BillingMetersClient) getCreateRequest(ctx context.Context, locatio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 7b05697674eb..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 deleted file mode 100644 index eb4ff1488841..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/buildauthtoken_client.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// BuildAuthTokenClient contains the methods for the BuildAuthToken group. -// Don't use this type directly, use NewBuildAuthTokenClient() instead. -type BuildAuthTokenClient struct { - internal *arm.Client - subscriptionID string -} - -// NewBuildAuthTokenClient creates a new instance of BuildAuthTokenClient 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 NewBuildAuthTokenClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BuildAuthTokenClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &BuildAuthTokenClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// 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 2024-08-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. -// - options - BuildAuthTokenClientListOptions contains the optional parameters for the BuildAuthTokenClient.List method. -func (client *BuildAuthTokenClient) List(ctx context.Context, resourceGroupName string, builderName string, buildName string, options *BuildAuthTokenClientListOptions) (BuildAuthTokenClientListResponse, error) { - var err error - const operationName = "BuildAuthTokenClient.List" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listCreateRequest(ctx, resourceGroupName, builderName, buildName, options) - if err != nil { - return BuildAuthTokenClientListResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return BuildAuthTokenClientListResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return BuildAuthTokenClientListResponse{}, err - } - resp, err := client.listHandleResponse(httpResp) - return resp, err -} - -// listCreateRequest creates the List request. -func (client *BuildAuthTokenClient) listCreateRequest(ctx context.Context, resourceGroupName string, builderName string, buildName string, options *BuildAuthTokenClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}/listAuthToken" - 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 builderName == "" { - return nil, errors.New("parameter builderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{builderName}", url.PathEscape(builderName)) - 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-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 *BuildAuthTokenClient) listHandleResponse(resp *http.Response) (BuildAuthTokenClientListResponse, error) { - result := BuildAuthTokenClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BuildToken); err != nil { - return BuildAuthTokenClientListResponse{}, err - } - return result, 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 4c00de57afe3..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 deleted file mode 100644 index 123a83291c3a..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/builders_client.go +++ /dev/null @@ -1,461 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// BuildersClient contains the methods for the Builders group. -// Don't use this type directly, use NewBuildersClient() instead. -type BuildersClient struct { - internal *arm.Client - subscriptionID string -} - -// NewBuildersClient creates a new instance of BuildersClient 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 NewBuildersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BuildersClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &BuildersClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a BuilderResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - builderName - The name of the builder. -// - builderEnvelope - Resource create parameters. -// - options - BuildersClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildersClient.BeginCreateOrUpdate -// method. -func (client *BuildersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, builderName string, builderEnvelope BuilderResource, options *BuildersClientBeginCreateOrUpdateOptions) (*runtime.Poller[BuildersClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, builderName, builderEnvelope, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildersClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BuildersClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a BuilderResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, builderName, builderEnvelope, 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.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *BuildersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, builderName string, builderEnvelope BuilderResource, options *BuildersClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}" - 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 builderName == "" { - return nil, errors.New("parameter builderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{builderName}", url.PathEscape(builderName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, builderEnvelope); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a BuilderResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -func (client *BuildersClient) BeginDelete(ctx context.Context, resourceGroupName string, builderName string, options *BuildersClientBeginDeleteOptions) (*runtime.Poller[BuildersClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, builderName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildersClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BuildersClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a BuilderResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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" - 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, builderName, 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 *BuildersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, builderName string, options *BuildersClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}" - 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 builderName == "" { - return nil, errors.New("parameter builderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{builderName}", url.PathEscape(builderName)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a BuilderResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -func (client *BuildersClient) Get(ctx context.Context, resourceGroupName string, builderName string, options *BuildersClientGetOptions) (BuildersClientGetResponse, error) { - var err error - const operationName = "BuildersClient.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, builderName, options) - if err != nil { - return BuildersClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return BuildersClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return BuildersClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *BuildersClient) getCreateRequest(ctx context.Context, resourceGroupName string, builderName string, options *BuildersClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}" - 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 builderName == "" { - return nil, errors.New("parameter builderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{builderName}", url.PathEscape(builderName)) - 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-08-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 *BuildersClient) getHandleResponse(resp *http.Response) (BuildersClientGetResponse, error) { - result := BuildersClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BuilderResource); err != nil { - return BuildersClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - List BuilderResource resources by resource group -// -// Generated from API version 2024-08-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. -func (client *BuildersClient) NewListByResourceGroupPager(resourceGroupName string, options *BuildersClientListByResourceGroupOptions) *runtime.Pager[BuildersClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[BuildersClientListByResourceGroupResponse]{ - More: func(page BuildersClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *BuildersClientListByResourceGroupResponse) (BuildersClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BuildersClient.NewListByResourceGroupPager") - 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.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return BuildersClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *BuildersClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *BuildersClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *BuildersClient) listByResourceGroupHandleResponse(resp *http.Response) (BuildersClientListByResourceGroupResponse, error) { - result := BuildersClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BuilderCollection); err != nil { - return BuildersClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - List BuilderResource resources by subscription ID -// -// Generated from API version 2024-08-02-preview -// - options - BuildersClientListBySubscriptionOptions contains the optional parameters for the BuildersClient.NewListBySubscriptionPager -// method. -func (client *BuildersClient) NewListBySubscriptionPager(options *BuildersClientListBySubscriptionOptions) *runtime.Pager[BuildersClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[BuildersClientListBySubscriptionResponse]{ - More: func(page BuildersClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *BuildersClientListBySubscriptionResponse) (BuildersClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BuildersClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return BuildersClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *BuildersClient) listBySubscriptionCreateRequest(ctx context.Context, options *BuildersClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.App/builders" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *BuildersClient) listBySubscriptionHandleResponse(resp *http.Response) (BuildersClientListBySubscriptionResponse, error) { - result := BuildersClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BuilderCollection); err != nil { - return BuildersClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a BuilderResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - options - BuildersClientBeginUpdateOptions contains the optional parameters for the BuildersClient.BeginUpdate method. -func (client *BuildersClient) BeginUpdate(ctx context.Context, resourceGroupName string, builderName string, builderEnvelope BuilderResourceUpdate, options *BuildersClientBeginUpdateOptions) (*runtime.Poller[BuildersClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, builderName, builderEnvelope, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildersClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BuildersClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a BuilderResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, builderName, builderEnvelope, 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 -} - -// updateCreateRequest creates the Update request. -func (client *BuildersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, builderName string, builderEnvelope BuilderResourceUpdate, options *BuildersClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}" - 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 builderName == "" { - return nil, errors.New("parameter builderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{builderName}", url.PathEscape(builderName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, builderEnvelope); err != nil { - return nil, err - } - return req, 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 4180c97a7d54..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 deleted file mode 100644 index 0464c3c4e352..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/builds_client.go +++ /dev/null @@ -1,281 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// BuildsClient contains the methods for the Builds group. -// Don't use this type directly, use NewBuildsClient() instead. -type BuildsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewBuildsClient creates a new instance of BuildsClient 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 NewBuildsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BuildsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &BuildsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create a BuildResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - buildEnvelope - Resource create or update parameters. -// - options - BuildsClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildsClient.BeginCreateOrUpdate -// method. -func (client *BuildsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, builderName string, buildName string, buildEnvelope BuildResource, options *BuildsClientBeginCreateOrUpdateOptions) (*runtime.Poller[BuildsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, builderName, buildName, buildEnvelope, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BuildsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create a BuildResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, builderName, buildName, buildEnvelope, 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.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *BuildsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, builderName string, buildName string, buildEnvelope BuildResource, options *BuildsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/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 builderName == "" { - return nil, errors.New("parameter builderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{builderName}", url.PathEscape(builderName)) - 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, buildEnvelope); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a BuildResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - options - BuildsClientBeginDeleteOptions contains the optional parameters for the BuildsClient.BeginDelete method. -func (client *BuildsClient) BeginDelete(ctx context.Context, resourceGroupName string, builderName string, buildName string, options *BuildsClientBeginDeleteOptions) (*runtime.Poller[BuildsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, builderName, buildName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BuildsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a BuildResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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" - 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, builderName, 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 *BuildsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, builderName string, buildName string, options *BuildsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/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 builderName == "" { - return nil, errors.New("parameter builderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{builderName}", url.PathEscape(builderName)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a BuildResource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - options - BuildsClientGetOptions contains the optional parameters for the BuildsClient.Get method. -func (client *BuildsClient) Get(ctx context.Context, resourceGroupName string, builderName string, buildName string, options *BuildsClientGetOptions) (BuildsClientGetResponse, error) { - var err error - const operationName = "BuildsClient.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, builderName, buildName, options) - if err != nil { - return BuildsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return BuildsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return BuildsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *BuildsClient) getCreateRequest(ctx context.Context, resourceGroupName string, builderName string, buildName string, options *BuildsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/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 builderName == "" { - return nil, errors.New("parameter builderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{builderName}", url.PathEscape(builderName)) - 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-08-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 *BuildsClient) getHandleResponse(resp *http.Response) (BuildsClientGetResponse, error) { - result := BuildsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BuildResource); err != nil { - return BuildsClientGetResponse{}, err - } - return result, 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 5ee64a7fe013..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 deleted file mode 100644 index c92bd55b84b4..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/buildsbybuilderresource_client.go +++ /dev/null @@ -1,110 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// BuildsByBuilderResourceClient contains the methods for the BuildsByBuilderResource group. -// Don't use this type directly, use NewBuildsByBuilderResourceClient() instead. -type BuildsByBuilderResourceClient struct { - internal *arm.Client - subscriptionID string -} - -// NewBuildsByBuilderResourceClient creates a new instance of BuildsByBuilderResourceClient 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 NewBuildsByBuilderResourceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BuildsByBuilderResourceClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &BuildsByBuilderResourceClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - List BuildResource resources by BuilderResource -// -// Generated from API version 2024-08-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 -// method. -func (client *BuildsByBuilderResourceClient) NewListPager(resourceGroupName string, builderName string, options *BuildsByBuilderResourceClientListOptions) *runtime.Pager[BuildsByBuilderResourceClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[BuildsByBuilderResourceClientListResponse]{ - More: func(page BuildsByBuilderResourceClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *BuildsByBuilderResourceClientListResponse) (BuildsByBuilderResourceClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BuildsByBuilderResourceClient.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, builderName, options) - }, nil) - if err != nil { - return BuildsByBuilderResourceClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *BuildsByBuilderResourceClient) listCreateRequest(ctx context.Context, resourceGroupName string, builderName string, options *BuildsByBuilderResourceClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/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 builderName == "" { - return nil, errors.New("parameter builderName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{builderName}", url.PathEscape(builderName)) - 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-08-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 *BuildsByBuilderResourceClient) listHandleResponse(resp *http.Response) (BuildsByBuilderResourceClientListResponse, error) { - result := BuildsByBuilderResourceClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BuildCollection); err != nil { - return BuildsByBuilderResourceClientListResponse{}, err - } - return result, 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 0d72d74d91fa..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 6e6166666102..9181f222334b 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // CertificatesClient contains the methods for the Certificates group. @@ -29,7 +28,7 @@ type CertificatesClient struct { } // NewCertificatesClient creates a new instance of CertificatesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CertificatesClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - certificateName - Name of the Certificate. @@ -99,7 +98,7 @@ func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.CertificateEnvelope != nil { @@ -123,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - certificateName - Name of the Certificate. @@ -173,7 +172,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - certificateName - Name of the Certificate. @@ -233,7 +232,7 @@ func (client *CertificatesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +249,7 @@ func (client *CertificatesClient) getHandleResponse(resp *http.Response) (Certif // NewListPager - Get the Certificates in a given managed environment. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -297,7 +296,7 @@ func (client *CertificatesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -315,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - certificateName - Name of the Certificate. @@ -367,7 +366,7 @@ func (client *CertificatesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 e7271d320c35..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/certificates/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/certificates/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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/certificates/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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/certificates/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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/certificates/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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/certificates/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 b7ffd5d49e3e..8ae8900328b6 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/client_factory.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/client_factory.go @@ -22,7 +22,7 @@ type ClientFactory struct { // 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. +// - subscriptionID - The ID of the target subscription. // - 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) { @@ -36,14 +36,6 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -// NewAppResiliencyClient creates a new instance of AppResiliencyClient. -func (c *ClientFactory) NewAppResiliencyClient() *AppResiliencyClient { - return &AppResiliencyClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewAvailableWorkloadProfilesClient creates a new instance of AvailableWorkloadProfilesClient. func (c *ClientFactory) NewAvailableWorkloadProfilesClient() *AvailableWorkloadProfilesClient { return &AvailableWorkloadProfilesClient{ @@ -60,38 +52,6 @@ func (c *ClientFactory) NewBillingMetersClient() *BillingMetersClient { } } -// NewBuildAuthTokenClient creates a new instance of BuildAuthTokenClient. -func (c *ClientFactory) NewBuildAuthTokenClient() *BuildAuthTokenClient { - return &BuildAuthTokenClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewBuildersClient creates a new instance of BuildersClient. -func (c *ClientFactory) NewBuildersClient() *BuildersClient { - return &BuildersClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewBuildsByBuilderResourceClient creates a new instance of BuildsByBuilderResourceClient. -func (c *ClientFactory) NewBuildsByBuilderResourceClient() *BuildsByBuilderResourceClient { - return &BuildsByBuilderResourceClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewBuildsClient creates a new instance of BuildsClient. -func (c *ClientFactory) NewBuildsClient() *BuildsClient { - return &BuildsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewCertificatesClient creates a new instance of CertificatesClient. func (c *ClientFactory) NewCertificatesClient() *CertificatesClient { return &CertificatesClient{ @@ -148,22 +108,6 @@ func (c *ClientFactory) NewContainerAppsAuthConfigsClient() *ContainerAppsAuthCo } } -// NewContainerAppsBuildsByContainerAppClient creates a new instance of ContainerAppsBuildsByContainerAppClient. -func (c *ClientFactory) NewContainerAppsBuildsByContainerAppClient() *ContainerAppsBuildsByContainerAppClient { - return &ContainerAppsBuildsByContainerAppClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewContainerAppsBuildsClient creates a new instance of ContainerAppsBuildsClient. -func (c *ClientFactory) NewContainerAppsBuildsClient() *ContainerAppsBuildsClient { - return &ContainerAppsBuildsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewContainerAppsClient creates a new instance of ContainerAppsClient. func (c *ClientFactory) NewContainerAppsClient() *ContainerAppsClient { return &ContainerAppsClient{ @@ -180,14 +124,6 @@ func (c *ClientFactory) NewContainerAppsDiagnosticsClient() *ContainerAppsDiagno } } -// NewContainerAppsPatchesClient creates a new instance of ContainerAppsPatchesClient. -func (c *ClientFactory) NewContainerAppsPatchesClient() *ContainerAppsPatchesClient { - return &ContainerAppsPatchesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewContainerAppsRevisionReplicasClient creates a new instance of ContainerAppsRevisionReplicasClient. func (c *ClientFactory) NewContainerAppsRevisionReplicasClient() *ContainerAppsRevisionReplicasClient { return &ContainerAppsRevisionReplicasClient{ @@ -204,14 +140,6 @@ func (c *ClientFactory) NewContainerAppsRevisionsClient() *ContainerAppsRevision } } -// NewContainerAppsSessionPoolsClient creates a new instance of ContainerAppsSessionPoolsClient. -func (c *ClientFactory) NewContainerAppsSessionPoolsClient() *ContainerAppsSessionPoolsClient { - return &ContainerAppsSessionPoolsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewContainerAppsSourceControlsClient creates a new instance of ContainerAppsSourceControlsClient. func (c *ClientFactory) NewContainerAppsSourceControlsClient() *ContainerAppsSourceControlsClient { return &ContainerAppsSourceControlsClient{ @@ -220,14 +148,6 @@ func (c *ClientFactory) NewContainerAppsSourceControlsClient() *ContainerAppsSou } } -// NewDaprComponentResiliencyPoliciesClient creates a new instance of DaprComponentResiliencyPoliciesClient. -func (c *ClientFactory) NewDaprComponentResiliencyPoliciesClient() *DaprComponentResiliencyPoliciesClient { - return &DaprComponentResiliencyPoliciesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewDaprComponentsClient creates a new instance of DaprComponentsClient. func (c *ClientFactory) NewDaprComponentsClient() *DaprComponentsClient { return &DaprComponentsClient{ @@ -236,38 +156,6 @@ func (c *ClientFactory) NewDaprComponentsClient() *DaprComponentsClient { } } -// NewDaprSubscriptionsClient creates a new instance of DaprSubscriptionsClient. -func (c *ClientFactory) NewDaprSubscriptionsClient() *DaprSubscriptionsClient { - return &DaprSubscriptionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewDotNetComponentsClient creates a new instance of DotNetComponentsClient. -func (c *ClientFactory) NewDotNetComponentsClient() *DotNetComponentsClient { - return &DotNetComponentsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewFunctionsExtensionClient creates a new instance of FunctionsExtensionClient. -func (c *ClientFactory) NewFunctionsExtensionClient() *FunctionsExtensionClient { - return &FunctionsExtensionClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewJavaComponentsClient creates a new instance of JavaComponentsClient. -func (c *ClientFactory) NewJavaComponentsClient() *JavaComponentsClient { - return &JavaComponentsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewJobsClient creates a new instance of JobsClient. func (c *ClientFactory) NewJobsClient() *JobsClient { return &JobsClient{ @@ -284,14 +172,6 @@ func (c *ClientFactory) NewJobsExecutionsClient() *JobsExecutionsClient { } } -// NewLogicAppsClient creates a new instance of LogicAppsClient. -func (c *ClientFactory) NewLogicAppsClient() *LogicAppsClient { - return &LogicAppsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewManagedCertificatesClient creates a new instance of ManagedCertificatesClient. func (c *ClientFactory) NewManagedCertificatesClient() *ManagedCertificatesClient { return &ManagedCertificatesClient{ @@ -308,22 +188,6 @@ func (c *ClientFactory) NewManagedEnvironmentDiagnosticsClient() *ManagedEnviron } } -// NewManagedEnvironmentPrivateEndpointConnectionsClient creates a new instance of ManagedEnvironmentPrivateEndpointConnectionsClient. -func (c *ClientFactory) NewManagedEnvironmentPrivateEndpointConnectionsClient() *ManagedEnvironmentPrivateEndpointConnectionsClient { - return &ManagedEnvironmentPrivateEndpointConnectionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewManagedEnvironmentPrivateLinkResourcesClient creates a new instance of ManagedEnvironmentPrivateLinkResourcesClient. -func (c *ClientFactory) NewManagedEnvironmentPrivateLinkResourcesClient() *ManagedEnvironmentPrivateLinkResourcesClient { - return &ManagedEnvironmentPrivateLinkResourcesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewManagedEnvironmentUsagesClient creates a new instance of ManagedEnvironmentUsagesClient. func (c *ClientFactory) NewManagedEnvironmentUsagesClient() *ManagedEnvironmentUsagesClient { return &ManagedEnvironmentUsagesClient{ diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go index 70a8823f70f0..fcb39a3d761a 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ConnectedEnvironmentsClient contains the methods for the ConnectedEnvironments group. @@ -29,7 +28,7 @@ type ConnectedEnvironmentsClient struct { } // NewConnectedEnvironmentsClient creates a new instance of ConnectedEnvironmentsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewConnectedEnvironmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectedEnvironmentsClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Managed Environment. // - checkNameAvailabilityRequest - The check connectedEnvironmentName availability request. @@ -95,7 +94,7 @@ func (client *ConnectedEnvironmentsClient) checkNameAvailabilityCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkNameAvailabilityRequest); err != nil { @@ -116,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connectedEnvironment. // - environmentEnvelope - Configuration details of the connectedEnvironment. @@ -143,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 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -185,7 +184,7 @@ func (client *ConnectedEnvironmentsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, environmentEnvelope); err != nil { @@ -197,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -223,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 2024-08-02-preview +// Generated from API version 2025-01-01 func (client *ConnectedEnvironmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ConnectedEnvironmentsClient.BeginDelete" @@ -265,7 +264,7 @@ func (client *ConnectedEnvironmentsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -274,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -321,7 +320,7 @@ func (client *ConnectedEnvironmentsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -338,7 +337,7 @@ func (client *ConnectedEnvironmentsClient) getHandleResponse(resp *http.Response // NewListByResourceGroupPager - Get all connectedEnvironments in a resource group. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ConnectedEnvironmentsClientListByResourceGroupOptions contains the optional parameters for the ConnectedEnvironmentsClient.NewListByResourceGroupPager // method. @@ -381,7 +380,7 @@ func (client *ConnectedEnvironmentsClient) listByResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -398,7 +397,7 @@ func (client *ConnectedEnvironmentsClient) listByResourceGroupHandleResponse(res // NewListBySubscriptionPager - Get all connectedEnvironments for a subscription. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - options - ConnectedEnvironmentsClientListBySubscriptionOptions contains the optional parameters for the ConnectedEnvironmentsClient.NewListBySubscriptionPager // method. func (client *ConnectedEnvironmentsClient) NewListBySubscriptionPager(options *ConnectedEnvironmentsClientListBySubscriptionOptions) *runtime.Pager[ConnectedEnvironmentsClientListBySubscriptionResponse] { @@ -436,7 +435,7 @@ func (client *ConnectedEnvironmentsClient) listBySubscriptionCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -454,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -501,7 +500,7 @@ func (client *ConnectedEnvironmentsClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 55f04b1cb894..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 14710f66f671..45df2515353b 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ConnectedEnvironmentsCertificatesClient contains the methods for the ConnectedEnvironmentsCertificates group. @@ -29,7 +28,7 @@ type ConnectedEnvironmentsCertificatesClient struct { } // NewConnectedEnvironmentsCertificatesClient creates a new instance of ConnectedEnvironmentsCertificatesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewConnectedEnvironmentsCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectedEnvironmentsCertificatesClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Connected Environment. // - certificateName - Name of the Certificate. @@ -99,7 +98,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) createOrUpdateCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.CertificateEnvelope != nil { @@ -123,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Connected Environment. // - certificateName - Name of the Certificate. @@ -174,7 +173,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) deleteCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Connected Environment. // - certificateName - Name of the Certificate. @@ -235,7 +234,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +251,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) getHandleResponse(resp *h // NewListPager - Get the Certificates in a given connected environment. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -300,7 +299,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -318,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Connected Environment. // - certificateName - Name of the Certificate. @@ -371,7 +370,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) updateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 295aa2494e4e..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/certificates/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/certificates/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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/certificates/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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/certififcates/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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/certificates/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 85be72498081..68f15db148e3 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ConnectedEnvironmentsDaprComponentsClient contains the methods for the ConnectedEnvironmentsDaprComponents group. @@ -29,7 +28,7 @@ type ConnectedEnvironmentsDaprComponentsClient struct { } // NewConnectedEnvironmentsDaprComponentsClient creates a new instance of ConnectedEnvironmentsDaprComponentsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewConnectedEnvironmentsDaprComponentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectedEnvironmentsDaprComponentsClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connected environment. // - componentName - Name of the Dapr Component. @@ -100,7 +99,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) createOrUpdateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, daprComponentEnvelope); err != nil { @@ -121,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connected environment. // - componentName - Name of the Dapr Component. @@ -172,7 +171,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connected environment. // - componentName - Name of the Dapr Component. @@ -233,7 +232,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +249,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) getHandleResponse(resp // NewListPager - Get the Dapr Components for a connected environment. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -298,7 +297,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) listCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the connected environment. // - componentName - Name of the Dapr Component. @@ -368,7 +367,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) listSecretsCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 1730f7a9211f..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 d1c9c1376e74..6f9df01a110a 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ConnectedEnvironmentsStoragesClient contains the methods for the ConnectedEnvironmentsStorages group. @@ -29,7 +28,7 @@ type ConnectedEnvironmentsStoragesClient struct { } // NewConnectedEnvironmentsStoragesClient creates a new instance of ConnectedEnvironmentsStoragesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewConnectedEnvironmentsStoragesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectedEnvironmentsStoragesClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Environment. // - storageName - Name of the storage. @@ -100,7 +99,7 @@ func (client *ConnectedEnvironmentsStoragesClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, storageEnvelope); err != nil { @@ -121,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Environment. // - storageName - Name of the storage. @@ -172,7 +171,7 @@ func (client *ConnectedEnvironmentsStoragesClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - connectedEnvironmentName - Name of the Environment. // - storageName - Name of the storage. @@ -233,7 +232,7 @@ func (client *ConnectedEnvironmentsStoragesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -298,7 +297,7 @@ func (client *ConnectedEnvironmentsStoragesClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 ef1c8a2a36cf..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 93c1912a915b..36df29870714 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.1.0-beta.1" + moduleVersion = "v3.1.0" ) // AccessMode - Access mode for storage @@ -127,76 +127,6 @@ func PossibleBindingTypeValues() []BindingType { } } -// BuildProvisioningState - Resource instance provisioning state. -type BuildProvisioningState string - -const ( - BuildProvisioningStateCanceled BuildProvisioningState = "Canceled" - BuildProvisioningStateCreating BuildProvisioningState = "Creating" - BuildProvisioningStateDeleting BuildProvisioningState = "Deleting" - BuildProvisioningStateFailed BuildProvisioningState = "Failed" - BuildProvisioningStateSucceeded BuildProvisioningState = "Succeeded" - BuildProvisioningStateUpdating BuildProvisioningState = "Updating" -) - -// PossibleBuildProvisioningStateValues returns the possible values for the BuildProvisioningState const type. -func PossibleBuildProvisioningStateValues() []BuildProvisioningState { - return []BuildProvisioningState{ - BuildProvisioningStateCanceled, - BuildProvisioningStateCreating, - BuildProvisioningStateDeleting, - BuildProvisioningStateFailed, - BuildProvisioningStateSucceeded, - BuildProvisioningStateUpdating, - } -} - -// BuildStatus - Status of the build once it has been provisioned. -type BuildStatus string - -const ( - BuildStatusCanceled BuildStatus = "Canceled" - BuildStatusFailed BuildStatus = "Failed" - BuildStatusInProgress BuildStatus = "InProgress" - BuildStatusNotStarted BuildStatus = "NotStarted" - BuildStatusSucceeded BuildStatus = "Succeeded" -) - -// PossibleBuildStatusValues returns the possible values for the BuildStatus const type. -func PossibleBuildStatusValues() []BuildStatus { - return []BuildStatus{ - BuildStatusCanceled, - BuildStatusFailed, - BuildStatusInProgress, - BuildStatusNotStarted, - BuildStatusSucceeded, - } -} - -// BuilderProvisioningState - Resource instance provisioning state. -type BuilderProvisioningState string - -const ( - BuilderProvisioningStateCanceled BuilderProvisioningState = "Canceled" - BuilderProvisioningStateCreating BuilderProvisioningState = "Creating" - BuilderProvisioningStateDeleting BuilderProvisioningState = "Deleting" - BuilderProvisioningStateFailed BuilderProvisioningState = "Failed" - BuilderProvisioningStateSucceeded BuilderProvisioningState = "Succeeded" - BuilderProvisioningStateUpdating BuilderProvisioningState = "Updating" -) - -// PossibleBuilderProvisioningStateValues returns the possible values for the BuilderProvisioningState const type. -func PossibleBuilderProvisioningStateValues() []BuilderProvisioningState { - return []BuilderProvisioningState{ - BuilderProvisioningStateCanceled, - BuilderProvisioningStateCreating, - BuilderProvisioningStateDeleting, - BuilderProvisioningStateFailed, - BuilderProvisioningStateSucceeded, - BuilderProvisioningStateUpdating, - } -} - // CertificateProvisioningState - Provisioning state of the certificate. type CertificateProvisioningState string @@ -219,22 +149,6 @@ func PossibleCertificateProvisioningStateValues() []CertificateProvisioningState } } -// CertificateType - The type of the certificate. Allowed values are ServerSSLCertificate and ImagePullTrustedCA -type CertificateType string - -const ( - CertificateTypeImagePullTrustedCA CertificateType = "ImagePullTrustedCA" - CertificateTypeServerSSLCertificate CertificateType = "ServerSSLCertificate" -) - -// PossibleCertificateTypeValues returns the possible values for the CertificateType const type. -func PossibleCertificateTypeValues() []CertificateType { - return []CertificateType{ - CertificateTypeImagePullTrustedCA, - CertificateTypeServerSSLCertificate, - } -} - // CheckNameAvailabilityReason - The reason why the given name is not available. type CheckNameAvailabilityReason string @@ -337,22 +251,6 @@ func PossibleContainerAppReplicaRunningStateValues() []ContainerAppReplicaRunnin } } -// ContainerType - The container type of the sessions. -type ContainerType string - -const ( - ContainerTypeCustomContainer ContainerType = "CustomContainer" - ContainerTypePythonLTS ContainerType = "PythonLTS" -) - -// PossibleContainerTypeValues returns the possible values for the ContainerType const type. -func PossibleContainerTypeValues() []ContainerType { - return []ContainerType{ - ContainerTypeCustomContainer, - ContainerTypePythonLTS, - } -} - // CookieExpirationConvention - The convention used when determining the session cookie's expiration. type CookieExpirationConvention string @@ -407,60 +305,6 @@ 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 - -const ( - DotNetComponentProvisioningStateCanceled DotNetComponentProvisioningState = "Canceled" - DotNetComponentProvisioningStateDeleting DotNetComponentProvisioningState = "Deleting" - DotNetComponentProvisioningStateFailed DotNetComponentProvisioningState = "Failed" - DotNetComponentProvisioningStateInProgress DotNetComponentProvisioningState = "InProgress" - DotNetComponentProvisioningStateSucceeded DotNetComponentProvisioningState = "Succeeded" -) - -// PossibleDotNetComponentProvisioningStateValues returns the possible values for the DotNetComponentProvisioningState const type. -func PossibleDotNetComponentProvisioningStateValues() []DotNetComponentProvisioningState { - return []DotNetComponentProvisioningState{ - DotNetComponentProvisioningStateCanceled, - DotNetComponentProvisioningStateDeleting, - DotNetComponentProvisioningStateFailed, - DotNetComponentProvisioningStateInProgress, - DotNetComponentProvisioningStateSucceeded, - } -} - -// DotNetComponentType - Type of the .NET Component. -type DotNetComponentType string - -const ( - DotNetComponentTypeAspireDashboard DotNetComponentType = "AspireDashboard" -) - -// PossibleDotNetComponentTypeValues returns the possible values for the DotNetComponentType const type. -func PossibleDotNetComponentTypeValues() []DotNetComponentType { - return []DotNetComponentType{ - DotNetComponentTypeAspireDashboard, - } -} - // EnvironmentProvisioningState - Provisioning state of the Environment. type EnvironmentProvisioningState string @@ -493,20 +337,6 @@ func PossibleEnvironmentProvisioningStateValues() []EnvironmentProvisioningState } } -// ExecutionType - The execution type of the session pool. -type ExecutionType string - -const ( - ExecutionTypeTimed ExecutionType = "Timed" -) - -// PossibleExecutionTypeValues returns the possible values for the ExecutionType const type. -func PossibleExecutionTypeValues() []ExecutionType { - return []ExecutionType{ - ExecutionTypeTimed, - } -} - // ExtendedLocationTypes - The type of extendedLocation. type ExtendedLocationTypes string @@ -539,44 +369,6 @@ func PossibleForwardProxyConventionValues() []ForwardProxyConvention { } } -// IdentitySettingsLifeCycle - Use to select the lifecycle stages of a Container App during which the Managed Identity should -// be available. -type IdentitySettingsLifeCycle string - -const ( - IdentitySettingsLifeCycleAll IdentitySettingsLifeCycle = "All" - IdentitySettingsLifeCycleInit IdentitySettingsLifeCycle = "Init" - IdentitySettingsLifeCycleMain IdentitySettingsLifeCycle = "Main" - IdentitySettingsLifeCycleNone IdentitySettingsLifeCycle = "None" -) - -// PossibleIdentitySettingsLifeCycleValues returns the possible values for the IdentitySettingsLifeCycle const type. -func PossibleIdentitySettingsLifeCycleValues() []IdentitySettingsLifeCycle { - return []IdentitySettingsLifeCycle{ - IdentitySettingsLifeCycleAll, - IdentitySettingsLifeCycleInit, - IdentitySettingsLifeCycleMain, - IdentitySettingsLifeCycleNone, - } -} - -// 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. @@ -597,22 +389,6 @@ func PossibleIngressClientCertificateModeValues() []IngressClientCertificateMode } } -// IngressTargetPortHTTPScheme - Whether an http app listens on http or https -type IngressTargetPortHTTPScheme string - -const ( - IngressTargetPortHTTPSchemeHTTP IngressTargetPortHTTPScheme = "http" - IngressTargetPortHTTPSchemeHTTPS IngressTargetPortHTTPScheme = "https" -) - -// PossibleIngressTargetPortHTTPSchemeValues returns the possible values for the IngressTargetPortHTTPScheme const type. -func PossibleIngressTargetPortHTTPSchemeValues() []IngressTargetPortHTTPScheme { - return []IngressTargetPortHTTPScheme{ - IngressTargetPortHTTPSchemeHTTP, - IngressTargetPortHTTPSchemeHTTPS, - } -} - // IngressTransportMethod - Ingress transport protocol type IngressTransportMethod string @@ -633,50 +409,6 @@ func PossibleIngressTransportMethodValues() []IngressTransportMethod { } } -// JavaComponentProvisioningState - Provisioning state of the Java Component. -type JavaComponentProvisioningState string - -const ( - JavaComponentProvisioningStateCanceled JavaComponentProvisioningState = "Canceled" - JavaComponentProvisioningStateDeleting JavaComponentProvisioningState = "Deleting" - JavaComponentProvisioningStateFailed JavaComponentProvisioningState = "Failed" - JavaComponentProvisioningStateInProgress JavaComponentProvisioningState = "InProgress" - JavaComponentProvisioningStateSucceeded JavaComponentProvisioningState = "Succeeded" -) - -// PossibleJavaComponentProvisioningStateValues returns the possible values for the JavaComponentProvisioningState const type. -func PossibleJavaComponentProvisioningStateValues() []JavaComponentProvisioningState { - return []JavaComponentProvisioningState{ - JavaComponentProvisioningStateCanceled, - JavaComponentProvisioningStateDeleting, - JavaComponentProvisioningStateFailed, - JavaComponentProvisioningStateInProgress, - JavaComponentProvisioningStateSucceeded, - } -} - -// JavaComponentType - Type of the Java Component. -type JavaComponentType string - -const ( - JavaComponentTypeNacos JavaComponentType = "Nacos" - JavaComponentTypeSpringBootAdmin JavaComponentType = "SpringBootAdmin" - JavaComponentTypeSpringCloudConfig JavaComponentType = "SpringCloudConfig" - JavaComponentTypeSpringCloudEureka JavaComponentType = "SpringCloudEureka" - JavaComponentTypeSpringCloudGateway JavaComponentType = "SpringCloudGateway" -) - -// PossibleJavaComponentTypeValues returns the possible values for the JavaComponentType const type. -func PossibleJavaComponentTypeValues() []JavaComponentType { - return []JavaComponentType{ - JavaComponentTypeNacos, - JavaComponentTypeSpringBootAdmin, - JavaComponentTypeSpringCloudConfig, - JavaComponentTypeSpringCloudEureka, - JavaComponentTypeSpringCloudGateway, - } -} - // JobExecutionRunningState - Current running State of the job type JobExecutionRunningState string @@ -725,40 +457,6 @@ func PossibleJobProvisioningStateValues() []JobProvisioningState { } } -// JobRunningState - Current running state of the job -type JobRunningState string - -const ( - JobRunningStateProgressing JobRunningState = "Progressing" - JobRunningStateReady JobRunningState = "Ready" - JobRunningStateSuspended JobRunningState = "Suspended" -) - -// PossibleJobRunningStateValues returns the possible values for the JobRunningState const type. -func PossibleJobRunningStateValues() []JobRunningState { - return []JobRunningState{ - JobRunningStateProgressing, - JobRunningStateReady, - JobRunningStateSuspended, - } -} - -// Kind - Metadata used to render different experiences for resources of the same type; e.g. WorkflowApp is a kind of Microsoft.App/ContainerApps -// type. If supported, the resource provider must validate and -// persist this value. -type Kind string - -const ( - KindWorkflowapp Kind = "workflowapp" -) - -// PossibleKindValues returns the possible values for the Kind const type. -func PossibleKindValues() []Kind { - return []Kind{ - KindWorkflowapp, - } -} - // Level - The specified logger's log level. type Level string @@ -803,21 +501,6 @@ func PossibleLogLevelValues() []LogLevel { } } -type LogicAppsProxyMethod string - -const ( - LogicAppsProxyMethodGET LogicAppsProxyMethod = "GET" - LogicAppsProxyMethodPOST LogicAppsProxyMethod = "POST" -) - -// PossibleLogicAppsProxyMethodValues returns the possible values for the LogicAppsProxyMethod const type. -func PossibleLogicAppsProxyMethodValues() []LogicAppsProxyMethod { - return []LogicAppsProxyMethod{ - LogicAppsProxyMethodGET, - LogicAppsProxyMethodPOST, - } -} - // ManagedCertificateDomainControlValidation - Selected type of domain control validation for managed certificates. type ManagedCertificateDomainControlValidation string @@ -856,154 +539,6 @@ 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, - } -} - -// PoolManagementType - The pool management type of the session pool. -type PoolManagementType string - -const ( - PoolManagementTypeDynamic PoolManagementType = "Dynamic" - PoolManagementTypeManual PoolManagementType = "Manual" -) - -// PossiblePoolManagementTypeValues returns the possible values for the PoolManagementType const type. -func PossiblePoolManagementTypeValues() []PoolManagementType { - return []PoolManagementType{ - PoolManagementTypeDynamic, - PoolManagementTypeManual, - } -} - -// PrivateEndpointConnectionProvisioningState - The current provisioning state. -type PrivateEndpointConnectionProvisioningState string - -const ( - PrivateEndpointConnectionProvisioningStateCanceled PrivateEndpointConnectionProvisioningState = "Canceled" - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - PrivateEndpointConnectionProvisioningStatePending PrivateEndpointConnectionProvisioningState = "Pending" - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" - PrivateEndpointConnectionProvisioningStateUpdating PrivateEndpointConnectionProvisioningState = "Updating" - PrivateEndpointConnectionProvisioningStateWaiting PrivateEndpointConnectionProvisioningState = "Waiting" -) - -// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. -func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { - return []PrivateEndpointConnectionProvisioningState{ - PrivateEndpointConnectionProvisioningStateCanceled, - PrivateEndpointConnectionProvisioningStateDeleting, - PrivateEndpointConnectionProvisioningStateFailed, - PrivateEndpointConnectionProvisioningStatePending, - PrivateEndpointConnectionProvisioningStateSucceeded, - PrivateEndpointConnectionProvisioningStateUpdating, - PrivateEndpointConnectionProvisioningStateWaiting, - } -} - -// PrivateEndpointServiceConnectionStatus - The private endpoint connection status. -type PrivateEndpointServiceConnectionStatus string - -const ( - PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" - PrivateEndpointServiceConnectionStatusDisconnected PrivateEndpointServiceConnectionStatus = "Disconnected" - PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" - PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" -) - -// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type. -func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { - return []PrivateEndpointServiceConnectionStatus{ - PrivateEndpointServiceConnectionStatusApproved, - PrivateEndpointServiceConnectionStatusDisconnected, - PrivateEndpointServiceConnectionStatusPending, - PrivateEndpointServiceConnectionStatusRejected, - } -} - -// PublicNetworkAccess - Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled'. -type PublicNetworkAccess string - -const ( - PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" -) - -// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. -func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { - return []PublicNetworkAccess{ - PublicNetworkAccessDisabled, - PublicNetworkAccessEnabled, - } -} - // RevisionHealthState - Current health State of the revision type RevisionHealthState string @@ -1084,44 +619,6 @@ func PossibleSchemeValues() []Scheme { } } -// SessionNetworkStatus - Network status for the sessions. -type SessionNetworkStatus string - -const ( - SessionNetworkStatusEgressDisabled SessionNetworkStatus = "EgressDisabled" - SessionNetworkStatusEgressEnabled SessionNetworkStatus = "EgressEnabled" -) - -// PossibleSessionNetworkStatusValues returns the possible values for the SessionNetworkStatus const type. -func PossibleSessionNetworkStatusValues() []SessionNetworkStatus { - return []SessionNetworkStatus{ - SessionNetworkStatusEgressDisabled, - SessionNetworkStatusEgressEnabled, - } -} - -// SessionPoolProvisioningState - Provisioning state of the session pool. -type SessionPoolProvisioningState string - -const ( - SessionPoolProvisioningStateCanceled SessionPoolProvisioningState = "Canceled" - SessionPoolProvisioningStateDeleting SessionPoolProvisioningState = "Deleting" - SessionPoolProvisioningStateFailed SessionPoolProvisioningState = "Failed" - SessionPoolProvisioningStateInProgress SessionPoolProvisioningState = "InProgress" - SessionPoolProvisioningStateSucceeded SessionPoolProvisioningState = "Succeeded" -) - -// PossibleSessionPoolProvisioningStateValues returns the possible values for the SessionPoolProvisioningState const type. -func PossibleSessionPoolProvisioningStateValues() []SessionPoolProvisioningState { - return []SessionPoolProvisioningState{ - SessionPoolProvisioningStateCanceled, - SessionPoolProvisioningStateDeleting, - SessionPoolProvisioningStateFailed, - SessionPoolProvisioningStateInProgress, - SessionPoolProvisioningStateSucceeded, - } -} - // SourceControlOperationState - Current provisioning State of the operation type SourceControlOperationState string @@ -1150,7 +647,6 @@ const ( StorageTypeEmptyDir StorageType = "EmptyDir" StorageTypeNfsAzureFile StorageType = "NfsAzureFile" StorageTypeSecret StorageType = "Secret" - StorageTypeSmb StorageType = "Smb" ) // PossibleStorageTypeValues returns the possible values for the StorageType const type. @@ -1160,7 +656,6 @@ func PossibleStorageTypeValues() []StorageType { StorageTypeEmptyDir, StorageTypeNfsAzureFile, StorageTypeSecret, - StorageTypeSmb, } } @@ -1219,47 +714,3 @@ func PossibleUnauthenticatedClientActionV2Values() []UnauthenticatedClientAction UnauthenticatedClientActionV2Return403, } } - -// WorkflowHealthState - Gets or sets the workflow health state. -type WorkflowHealthState string - -const ( - WorkflowHealthStateHealthy WorkflowHealthState = "Healthy" - WorkflowHealthStateNotSpecified WorkflowHealthState = "NotSpecified" - WorkflowHealthStateUnhealthy WorkflowHealthState = "Unhealthy" - WorkflowHealthStateUnknown WorkflowHealthState = "Unknown" -) - -// PossibleWorkflowHealthStateValues returns the possible values for the WorkflowHealthState const type. -func PossibleWorkflowHealthStateValues() []WorkflowHealthState { - return []WorkflowHealthState{ - WorkflowHealthStateHealthy, - WorkflowHealthStateNotSpecified, - WorkflowHealthStateUnhealthy, - WorkflowHealthStateUnknown, - } -} - -// WorkflowState - The workflow state. -type WorkflowState string - -const ( - WorkflowStateCompleted WorkflowState = "Completed" - WorkflowStateDeleted WorkflowState = "Deleted" - WorkflowStateDisabled WorkflowState = "Disabled" - WorkflowStateEnabled WorkflowState = "Enabled" - WorkflowStateNotSpecified WorkflowState = "NotSpecified" - WorkflowStateSuspended WorkflowState = "Suspended" -) - -// PossibleWorkflowStateValues returns the possible values for the WorkflowState const type. -func PossibleWorkflowStateValues() []WorkflowState { - return []WorkflowState{ - WorkflowStateCompleted, - WorkflowStateDeleted, - WorkflowStateDisabled, - WorkflowStateEnabled, - WorkflowStateNotSpecified, - WorkflowStateSuspended, - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go index ab664ab26982..2ab741df1f72 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ContainerAppsClient contains the methods for the ContainerApps group. @@ -29,7 +28,7 @@ type ContainerAppsClient struct { } // NewContainerAppsClient creates a new instance of ContainerAppsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewContainerAppsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerAppsClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -74,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 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -116,7 +115,7 @@ func (client *ContainerAppsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, containerAppEnvelope); err != nil { @@ -128,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -154,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 2024-08-02-preview +// Generated from API version 2025-01-01 func (client *ContainerAppsClient) deleteOperation(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ContainerAppsClient.BeginDelete" @@ -196,7 +195,7 @@ func (client *ContainerAppsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -251,7 +250,7 @@ func (client *ContainerAppsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -316,7 +315,7 @@ func (client *ContainerAppsClient) getAuthTokenCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -333,7 +332,7 @@ func (client *ContainerAppsClient) getAuthTokenHandleResponse(resp *http.Respons // NewListByResourceGroupPager - Get the Container Apps in a given resource group. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ContainerAppsClientListByResourceGroupOptions contains the optional parameters for the ContainerAppsClient.NewListByResourceGroupPager // method. @@ -376,7 +375,7 @@ func (client *ContainerAppsClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -393,7 +392,7 @@ func (client *ContainerAppsClient) listByResourceGroupHandleResponse(resp *http. // NewListBySubscriptionPager - Get the Container Apps in a given subscription. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - options - ContainerAppsClientListBySubscriptionOptions contains the optional parameters for the ContainerAppsClient.NewListBySubscriptionPager // method. func (client *ContainerAppsClient) NewListBySubscriptionPager(options *ContainerAppsClientListBySubscriptionOptions) *runtime.Pager[ContainerAppsClientListBySubscriptionResponse] { @@ -431,7 +430,7 @@ func (client *ContainerAppsClient) listBySubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -449,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -496,7 +495,7 @@ func (client *ContainerAppsClient) listCustomHostNameAnalysisCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") if options != nil && options.CustomHostname != nil { reqQP.Set("customHostname", *options.CustomHostname) } @@ -517,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -564,7 +563,7 @@ func (client *ContainerAppsClient) listSecretsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -582,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -608,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 2024-08-02-preview +// Generated from API version 2025-01-01 func (client *ContainerAppsClient) start(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ContainerAppsClient.BeginStart" @@ -650,7 +649,7 @@ func (client *ContainerAppsClient) startCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -659,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -684,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 2024-08-02-preview +// Generated from API version 2025-01-01 func (client *ContainerAppsClient) stop(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ContainerAppsClient.BeginStop" @@ -726,7 +725,7 @@ func (client *ContainerAppsClient) stopCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -735,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -761,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 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -803,7 +802,7 @@ func (client *ContainerAppsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 21bd838105aa..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client_example_test.go +++ /dev/null @@ -1,2782 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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), - // Runtime: &armappcontainers.Runtime{ - // Dotnet: &armappcontainers.RuntimeDotnet{ - // AutoConfigureDataProtection: to.Ptr(true), - // }, - // Java: &armappcontainers.RuntimeJava{ - // EnableMetrics: to.Ptr(true), - // JavaAgent: &armappcontainers.RuntimeJavaAgent{ - // Enabled: to.Ptr(true), - // Logging: &armappcontainers.RuntimeJavaAgentLogging{ - // LoggerSettings: []*armappcontainers.LoggerSetting{ - // { - // Level: to.Ptr(armappcontainers.LevelDebug), - // Logger: to.Ptr("org.springframework.boot"), - // }}, - // }, - // }, - // }, - // }, - // 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{ - // CooldownPeriod: to.Ptr[int32](350), - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](35), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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), - // Runtime: &armappcontainers.Runtime{ - // Dotnet: &armappcontainers.RuntimeDotnet{ - // AutoConfigureDataProtection: to.Ptr(true), - // }, - // Java: &armappcontainers.RuntimeJava{ - // EnableMetrics: to.Ptr(true), - // JavaAgent: &armappcontainers.RuntimeJavaAgent{ - // Enabled: to.Ptr(true), - // Logging: &armappcontainers.RuntimeJavaAgentLogging{ - // LoggerSettings: []*armappcontainers.LoggerSetting{ - // { - // Level: to.Ptr(armappcontainers.LevelDebug), - // Logger: to.Ptr("org.springframework.boot"), - // }}, - // }, - // }, - // }, - // }, - // }, - // 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{ - // CooldownPeriod: to.Ptr[int32](350), - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](35), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }}, - // }, - // }, - // WorkloadProfileName: to.Ptr("My-GP-01"), - // }, - // }, - // { - // Name: to.Ptr("testcontainerApp1"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp1"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // Ingress: &armappcontainers.Ingress{ - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerApp1.demokube-t24clv0g.eastus.containerApps.k4apps.io"), - // TargetPort: to.Ptr[int32](3000), - // TargetPortHTTPScheme: to.Ptr(armappcontainers.IngressTargetPortHTTPSchemeHTTP), - // Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto), - // }, - // MaxInactiveRevisions: to.Ptr[int32](10), - // }, - // DeploymentErrors: to.Ptr("Code: ContainerAppImagePullProvisionError, Message: Error pulling the container image. Please check the image name or any registry credentials to access if required."), - // EventStreamEndpoint: to.Ptr("testEndpoint"), - // LatestReadyRevisionName: to.Ptr("testcontainerApp0-pjxhsye"), - // LatestRevisionFqdn: to.Ptr("testcontainerApp1-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("testcontainerApp1"), - // Image: to.Ptr("repo/testcontainerApp1:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // InitContainers: []*armappcontainers.InitContainer{ - // { - // Name: to.Ptr("testcontainerApp1"), - // Image: to.Ptr("repo/testcontainerApp1:v4"), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](0.2), - // Memory: to.Ptr("100Mi"), - // }, - // }}, - // Scale: &armappcontainers.Scale{ - // CooldownPeriod: to.Ptr[int32](350), - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](35), - // }, - // }, - // WorkloadProfileName: to.Ptr("Consumption"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("24adfa4f-dedf-8dc0-ca29-b6d1a69ab319"), - // TenantID: to.Ptr("23adfa4f-eedf-1dc0-ba29-a6d1a69ab3d0"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df"), - // PrincipalID: to.Ptr("74adfa4f-dedf-8dc0-ca29-b6d1a69ab312"), - // }, - // }, - // }, - // 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), - // }, - // IdentitySettings: []*armappcontainers.IdentitySettings{ - // { - // Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleAll), - // }, - // { - // Identity: to.Ptr("system"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleInit), - // }}, - // 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), - // Runtime: &armappcontainers.Runtime{ - // Dotnet: &armappcontainers.RuntimeDotnet{ - // AutoConfigureDataProtection: to.Ptr(true), - // }, - // Java: &armappcontainers.RuntimeJava{ - // EnableMetrics: to.Ptr(true), - // JavaAgent: &armappcontainers.RuntimeJavaAgent{ - // Enabled: to.Ptr(true), - // Logging: &armappcontainers.RuntimeJavaAgentLogging{ - // LoggerSettings: []*armappcontainers.LoggerSetting{ - // { - // Level: to.Ptr(armappcontainers.LevelDebug), - // Logger: to.Ptr("org.springframework.boot"), - // }}, - // }, - // }, - // }, - // }, - // 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{ - // CooldownPeriod: to.Ptr[int32](350), - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](35), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }, - // { - // Name: to.Ptr("servicebus"), - // Custom: &armappcontainers.CustomScaleRule{ - // Type: to.Ptr("azure-servicebus"), - // Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - // Metadata: map[string]*string{ - // "messageCount": to.Ptr("5"), - // "namespace": to.Ptr("mynamespace"), - // "queueName": to.Ptr("myqueue"), - // }, - // }, - // }}, - // }, - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Kind_CreateOrUpdate.json -func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateAppKind() { - 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", "testcontainerAppKind", armappcontainers.ContainerApp{ - Location: to.Ptr("East Us"), - Kind: to.Ptr(armappcontainers.KindWorkflowapp), - ManagedBy: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind"), - Properties: &armappcontainers.ContainerAppProperties{ - Configuration: &armappcontainers.Configuration{ - ActiveRevisionsMode: to.Ptr(armappcontainers.ActiveRevisionsModeSingle), - Ingress: &armappcontainers.Ingress{ - AllowInsecure: to.Ptr(true), - External: to.Ptr(true), - TargetPort: to.Ptr[int32](80), - }, - }, - ManagedEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3"), - Template: &armappcontainers.Template{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("logicapps-container"), - Image: to.Ptr("default/logicapps-base:latest"), - Resources: &armappcontainers.ContainerResources{ - CPU: to.Ptr[float64](1), - Memory: to.Ptr("2.0Gi"), - }, - }}, - Scale: &armappcontainers.Scale{ - CooldownPeriod: to.Ptr[int32](350), - MaxReplicas: to.Ptr[int32](30), - MinReplicas: to.Ptr[int32](1), - PollingInterval: to.Ptr[int32](35), - }, - }, - }, - }, 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("testcontainerAppKind"), - // Type: to.Ptr("Microsoft.App/containerApps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerapps/testcontainerAppKind"), - // Location: to.Ptr("East US"), - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeNone), - // }, - // Kind: to.Ptr(armappcontainers.KindWorkflowapp), - // ManagedBy: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind"), - // Properties: &armappcontainers.ContainerAppProperties{ - // Configuration: &armappcontainers.Configuration{ - // ActiveRevisionsMode: to.Ptr(armappcontainers.ActiveRevisionsModeSingle), - // Ingress: &armappcontainers.Ingress{ - // AllowInsecure: to.Ptr(true), - // ExposedPort: to.Ptr[int32](0), - // External: to.Ptr(true), - // Fqdn: to.Ptr("testcontainerAppKind.nicefield-53acf186.eastus.azurecontainerapps-test.io"), - // TargetPort: to.Ptr[int32](80), - // Traffic: []*armappcontainers.TrafficWeight{ - // { - // LatestRevision: to.Ptr(true), - // Weight: to.Ptr[int32](100), - // }}, - // Transport: to.Ptr(armappcontainers.IngressTransportMethodAuto), - // }, - // MaxInactiveRevisions: to.Ptr[int32](100), - // }, - // EnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3"), - // EventStreamEndpoint: to.Ptr("https://azurecontainerapps-test.dev/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/containerApps/testcontainerAppKind/eventstream"), - // LatestReadyRevisionName: to.Ptr("testcontainerAppKind--2rltv14"), - // LatestRevisionFqdn: to.Ptr("testcontainerAppKind--2rltv14.nicefield-53acf186.eastus.azurecontainerapps-test.io"), - // LatestRevisionName: to.Ptr("testcontainerAppKind--2rltv14"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3"), - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("logicapps-container"), - // Image: to.Ptr("default/logicapps-base:latest"), - // ImageType: to.Ptr(armappcontainers.ImageTypeContainerImage), - // Resources: &armappcontainers.ContainerResources{ - // CPU: to.Ptr[float64](1), - // EphemeralStorage: to.Ptr("4Gi"), - // Memory: to.Ptr("2Gi"), - // }, - // }}, - // RevisionSuffix: to.Ptr(""), - // Scale: &armappcontainers.Scale{ - // CooldownPeriod: to.Ptr[int32](350), - // MaxReplicas: to.Ptr[int32](30), - // MinReplicas: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](35), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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), - Runtime: &armappcontainers.Runtime{ - Dotnet: &armappcontainers.RuntimeDotnet{ - AutoConfigureDataProtection: to.Ptr(true), - }, - Java: &armappcontainers.RuntimeJava{ - EnableMetrics: to.Ptr(true), - JavaAgent: &armappcontainers.RuntimeJavaAgent{ - Enabled: to.Ptr(true), - Logging: &armappcontainers.RuntimeJavaAgentLogging{ - LoggerSettings: []*armappcontainers.LoggerSetting{ - { - Level: to.Ptr(armappcontainers.LevelDebug), - Logger: to.Ptr("org.springframework.boot"), - }}, - }, - }, - }, - }, - }, - 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{ - CooldownPeriod: to.Ptr[int32](350), - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - PollingInterval: to.Ptr[int32](35), - 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), - // }, - // Runtime: &armappcontainers.Runtime{ - // Dotnet: &armappcontainers.RuntimeDotnet{ - // AutoConfigureDataProtection: to.Ptr(true), - // }, - // Java: &armappcontainers.RuntimeJava{ - // EnableMetrics: to.Ptr(true), - // JavaAgent: &armappcontainers.RuntimeJavaAgent{ - // Enabled: to.Ptr(true), - // Logging: &armappcontainers.RuntimeJavaAgentLogging{ - // LoggerSettings: []*armappcontainers.LoggerSetting{ - // { - // Level: to.Ptr(armappcontainers.LevelDebug), - // Logger: to.Ptr("org.springframework.boot"), - // }}, - // }, - // }, - // }, - // }, - // }, - // 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{ - // CooldownPeriod: to.Ptr[int32](350), - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](35), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - Identity: &armappcontainers.ManagedServiceIdentity{ - Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {}, - }, - }, - 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), - }, - IdentitySettings: []*armappcontainers.IdentitySettings{ - { - Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleAll), - }, - { - Identity: to.Ptr("system"), - Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleInit), - }}, - 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), - Runtime: &armappcontainers.Runtime{ - Dotnet: &armappcontainers.RuntimeDotnet{ - AutoConfigureDataProtection: to.Ptr(true), - }, - Java: &armappcontainers.RuntimeJava{ - EnableMetrics: to.Ptr(true), - JavaAgent: &armappcontainers.RuntimeJavaAgent{ - Enabled: to.Ptr(true), - Logging: &armappcontainers.RuntimeJavaAgentLogging{ - LoggerSettings: []*armappcontainers.LoggerSetting{ - { - Level: to.Ptr(armappcontainers.LevelDebug), - Logger: to.Ptr("org.springframework.boot"), - }}, - }, - }, - }, - }, - 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{ - CooldownPeriod: to.Ptr[int32](350), - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - PollingInterval: to.Ptr[int32](35), - Rules: []*armappcontainers.ScaleRule{ - { - Name: to.Ptr("httpscalingrule"), - Custom: &armappcontainers.CustomScaleRule{ - Type: to.Ptr("http"), - Metadata: map[string]*string{ - "concurrentRequests": to.Ptr("50"), - }, - }, - }, - { - Name: to.Ptr("servicebus"), - Custom: &armappcontainers.CustomScaleRule{ - Type: to.Ptr("azure-servicebus"), - Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - Metadata: map[string]*string{ - "messageCount": to.Ptr("5"), - "namespace": to.Ptr("mynamespace"), - "queueName": to.Ptr("myqueue"), - }, - }, - }, - { - Name: to.Ptr("azure-queue"), - AzureQueue: &armappcontainers.QueueScaleRule{ - AccountName: to.Ptr("account1"), - Identity: to.Ptr("system"), - QueueLength: to.Ptr[int32](1), - QueueName: to.Ptr("queue1"), - }, - }}, - }, - 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"), - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("24adfa4f-dedf-8dc0-ca29-b6d1a69ab319"), - // TenantID: to.Ptr("23adfa4f-eedf-1dc0-ba29-a6d1a69ab3d0"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df"), - // PrincipalID: to.Ptr("74adfa4f-dedf-8dc0-ca29-b6d1a69ab312"), - // }, - // }, - // }, - // 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), - // }, - // IdentitySettings: []*armappcontainers.IdentitySettings{ - // { - // Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleAll), - // }, - // { - // Identity: to.Ptr("system"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleInit), - // }}, - // 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), - // }, - // Runtime: &armappcontainers.Runtime{ - // Dotnet: &armappcontainers.RuntimeDotnet{ - // AutoConfigureDataProtection: to.Ptr(true), - // }, - // Java: &armappcontainers.RuntimeJava{ - // EnableMetrics: to.Ptr(true), - // JavaAgent: &armappcontainers.RuntimeJavaAgent{ - // Enabled: to.Ptr(true), - // Logging: &armappcontainers.RuntimeJavaAgentLogging{ - // LoggerSettings: []*armappcontainers.LoggerSetting{ - // { - // Level: to.Ptr(armappcontainers.LevelDebug), - // Logger: to.Ptr("org.springframework.boot"), - // }}, - // }, - // }, - // }, - // }, - // }, - // 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{ - // CooldownPeriod: to.Ptr[int32](350), - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](35), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }, - // { - // Name: to.Ptr("servicebus"), - // Custom: &armappcontainers.CustomScaleRule{ - // Type: to.Ptr("azure-servicebus"), - // Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - // Metadata: map[string]*string{ - // "messageCount": to.Ptr("5"), - // "namespace": to.Ptr("mynamespace"), - // "queueName": to.Ptr("myqueue"), - // }, - // }, - // }, - // { - // Name: to.Ptr("azure-queue"), - // AzureQueue: &armappcontainers.QueueScaleRule{ - // AccountName: to.Ptr("account1"), - // Identity: to.Ptr("system"), - // QueueLength: to.Ptr[int32](1), - // QueueName: to.Ptr("queue1"), - // }, - // }}, - // }, - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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{ - CooldownPeriod: to.Ptr[int32](350), - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - PollingInterval: to.Ptr[int32](35), - 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{ - // CooldownPeriod: to.Ptr[int32](350), - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](35), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_SourceToCloudApp_CreateOrUpdate.json -func ExampleContainerAppsClient_BeginCreateOrUpdate_createOrUpdateSourceToCloudApp() { - 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"), - PatchingConfiguration: &armappcontainers.ContainerAppPropertiesPatchingConfiguration{ - PatchingMode: to.Ptr(armappcontainers.PatchingModeAutomatic), - }, - Template: &armappcontainers.Template{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerApp0"), - Image: to.Ptr(""), - ImageType: to.Ptr(armappcontainers.ImageTypeCloudBuild), - 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{ - CooldownPeriod: to.Ptr[int32](350), - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - PollingInterval: to.Ptr[int32](35), - 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"), - // PatchingConfiguration: &armappcontainers.ContainerAppPropertiesPatchingConfiguration{ - // PatchingMode: to.Ptr(armappcontainers.PatchingModeAutomatic), - // }, - // ProvisioningState: to.Ptr(armappcontainers.ContainerAppProvisioningStateSucceeded), - // Template: &armappcontainers.Template{ - // Containers: []*armappcontainers.Container{ - // { - // Name: to.Ptr("testcontainerApp0"), - // Image: to.Ptr("mcr.microsoft.com/k8se/cloudbuild-waiting-upload:latest"), - // ImageType: to.Ptr(armappcontainers.ImageTypeCloudBuild), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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{ - CooldownPeriod: to.Ptr[int32](350), - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - PollingInterval: to.Ptr[int32](35), - 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{ - // CooldownPeriod: to.Ptr[int32](350), - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](35), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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), - Runtime: &armappcontainers.Runtime{ - Dotnet: &armappcontainers.RuntimeDotnet{ - AutoConfigureDataProtection: to.Ptr(true), - }, - Java: &armappcontainers.RuntimeJava{ - EnableMetrics: to.Ptr(true), - JavaAgent: &armappcontainers.RuntimeJavaAgent{ - Enabled: to.Ptr(true), - Logging: &armappcontainers.RuntimeJavaAgentLogging{ - LoggerSettings: []*armappcontainers.LoggerSetting{ - { - Level: to.Ptr(armappcontainers.LevelDebug), - Logger: to.Ptr("org.springframework.boot"), - }}, - }, - }, - }, - }, - 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{ - CooldownPeriod: to.Ptr[int32](350), - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - PollingInterval: to.Ptr[int32](35), - 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), - // Runtime: &armappcontainers.Runtime{ - // Dotnet: &armappcontainers.RuntimeDotnet{ - // AutoConfigureDataProtection: to.Ptr(true), - // }, - // Java: &armappcontainers.RuntimeJava{ - // EnableMetrics: to.Ptr(true), - // JavaAgent: &armappcontainers.RuntimeJavaAgent{ - // Enabled: to.Ptr(true), - // Logging: &armappcontainers.RuntimeJavaAgentLogging{ - // LoggerSettings: []*armappcontainers.LoggerSetting{ - // { - // Level: to.Ptr(armappcontainers.LevelDebug), - // Logger: to.Ptr("org.springframework.boot"), - // }}, - // }, - // }, - // }, - // }, - // }, - // 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{ - // CooldownPeriod: to.Ptr[int32](350), - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](35), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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), - // Runtime: &armappcontainers.Runtime{ - // Dotnet: &armappcontainers.RuntimeDotnet{ - // AutoConfigureDataProtection: to.Ptr(true), - // }, - // Java: &armappcontainers.RuntimeJava{ - // EnableMetrics: to.Ptr(true), - // JavaAgent: &armappcontainers.RuntimeJavaAgent{ - // Enabled: to.Ptr(true), - // Logging: &armappcontainers.RuntimeJavaAgentLogging{ - // LoggerSettings: []*armappcontainers.LoggerSetting{ - // { - // Level: to.Ptr(armappcontainers.LevelDebug), - // Logger: to.Ptr("org.springframework.boot"), - // }}, - // }, - // }, - // }, - // }, - // }, - // 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{ - // CooldownPeriod: to.Ptr[int32](350), - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](35), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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), - // Runtime: &armappcontainers.Runtime{ - // Dotnet: &armappcontainers.RuntimeDotnet{ - // AutoConfigureDataProtection: to.Ptr(true), - // }, - // Java: &armappcontainers.RuntimeJava{ - // EnableMetrics: to.Ptr(true), - // JavaAgent: &armappcontainers.RuntimeJavaAgent{ - // Enabled: to.Ptr(true), - // Logging: &armappcontainers.RuntimeJavaAgentLogging{ - // LoggerSettings: []*armappcontainers.LoggerSetting{ - // { - // Level: to.Ptr(armappcontainers.LevelDebug), - // Logger: to.Ptr("org.springframework.boot"), - // }}, - // }, - // }, - // }, - // }, - // }, - // 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 c453cc31cf74..76b67615baf6 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsapi_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsapi_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ContainerAppsAPIClient contains the methods for the ContainerAppsAPIClient group. @@ -29,7 +28,7 @@ type ContainerAppsAPIClient struct { } // NewContainerAppsAPIClient creates a new instance of ContainerAppsAPIClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewContainerAppsAPIClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerAppsAPIClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - options - ContainerAppsAPIClientGetCustomDomainVerificationIDOptions contains the optional parameters for the ContainerAppsAPIClient.GetCustomDomainVerificationID // method. func (client *ContainerAppsAPIClient) GetCustomDomainVerificationID(ctx context.Context, options *ContainerAppsAPIClientGetCustomDomainVerificationIDOptions) (ContainerAppsAPIClientGetCustomDomainVerificationIDResponse, error) { @@ -84,7 +83,7 @@ func (client *ContainerAppsAPIClient) getCustomDomainVerificationIDCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -102,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - jobExecutionName - Job execution name. @@ -154,7 +153,7 @@ func (client *ContainerAppsAPIClient) jobExecutionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 aed27d2c0a45..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 f39e84d13602..d9fec6207ef4 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ContainerAppsAuthConfigsClient contains the methods for the ContainerAppsAuthConfigs group. @@ -29,7 +28,7 @@ type ContainerAppsAuthConfigsClient struct { } // NewContainerAppsAuthConfigsClient creates a new instance of ContainerAppsAuthConfigsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewContainerAppsAuthConfigsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerAppsAuthConfigsClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -100,7 +99,7 @@ func (client *ContainerAppsAuthConfigsClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, authConfigEnvelope); err != nil { @@ -121,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -172,7 +171,7 @@ func (client *ContainerAppsAuthConfigsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -233,7 +232,7 @@ func (client *ContainerAppsAuthConfigsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -298,7 +297,7 @@ func (client *ContainerAppsAuthConfigsClient) listByContainerAppCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 7d0196ecd6aa..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 deleted file mode 100644 index 61004bf94a25..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuilds_client.go +++ /dev/null @@ -1,196 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// 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 -} - -// NewContainerAppsBuildsClient creates a new instance of ContainerAppsBuildsClient 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 NewContainerAppsBuildsClient(subscriptionID 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, - 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-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App the Build is associated. -// - 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, containerAppName string, buildName string, options *ContainerAppsBuildsClientBeginDeleteOptions) (*runtime.Poller[ContainerAppsBuildsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, containerAppName, 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-08-02-preview -func (client *ContainerAppsBuildsClient) deleteOperation(ctx context.Context, resourceGroupName string, containerAppName 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, containerAppName, 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, containerAppName 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 containerAppName == "" { - return nil, errors.New("parameter containerAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(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-08-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-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App the Build is associated. -// - 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, containerAppName 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, containerAppName, 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, containerAppName 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 containerAppName == "" { - return nil, errors.New("parameter containerAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(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-08-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/containerappsbuilds_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuilds_client_example_test.go deleted file mode 100644 index f329bf80def6..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuilds_client_example_test.go +++ /dev/null @@ -1,121 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_Get.json -func ExampleContainerAppsBuildsClient_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.NewContainerAppsBuildsClient().Get(ctx, "rg", "testCapp", "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.ContainerAppsBuildResource = armappcontainers.ContainerAppsBuildResource{ - // Name: to.Ptr("testBuild"), - // Type: to.Ptr("Microsoft.App/containerApps/builds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/containerApps/testCapp/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.ContainerAppsBuildProperties{ - // BuildStatus: to.Ptr(armappcontainers.BuildStatusInProgress), - // Configuration: &armappcontainers.ContainerAppsBuildConfiguration{ - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_Delete.json -func ExampleContainerAppsBuildsClient_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.NewContainerAppsBuildsClient().BeginDelete(ctx, "rg", "testCapp", "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/containerappsbuildsbycontainerapp_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuildsbycontainerapp_client.go deleted file mode 100644 index 3327e91716b1..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuildsbycontainerapp_client.go +++ /dev/null @@ -1,110 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// 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 -} - -// NewContainerAppsBuildsByContainerAppClient creates a new instance of ContainerAppsBuildsByContainerAppClient 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 NewContainerAppsBuildsByContainerAppClient(subscriptionID 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, - internal: cl, - } - return client, nil -} - -// NewListPager - List Container Apps Build resources by Container App -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App the Build is associated. -// - options - ContainerAppsBuildsByContainerAppClientListOptions contains the optional parameters for the ContainerAppsBuildsByContainerAppClient.NewListPager -// method. -func (client *ContainerAppsBuildsByContainerAppClient) NewListPager(resourceGroupName string, containerAppName 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, containerAppName, 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, containerAppName 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 containerAppName == "" { - return nil, errors.New("parameter containerAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(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-08-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/containerappsbuildsbycontainerapp_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuildsbycontainerapp_client_example_test.go deleted file mode 100644 index a023eade55b0..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsbuildsbycontainerapp_client_example_test.go +++ /dev/null @@ -1,170 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_ListByContainerApp.json -func ExampleContainerAppsBuildsByContainerAppClient_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.NewContainerAppsBuildsByContainerAppClient().NewListPager("rg", "testCapp", 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.ContainerAppsBuildCollection = armappcontainers.ContainerAppsBuildCollection{ - // Value: []*armappcontainers.ContainerAppsBuildResource{ - // { - // Name: to.Ptr("testBuild1"), - // Type: to.Ptr("Microsoft.App/containerApps/builds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/containerApps/testCapp/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.ContainerAppsBuildProperties{ - // BuildStatus: to.Ptr(armappcontainers.BuildStatusInProgress), - // Configuration: &armappcontainers.ContainerAppsBuildConfiguration{ - // 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), - // }, - // }, - // { - // Name: to.Ptr("testBuild2"), - // Type: to.Ptr("Microsoft.App/containerApps/builds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/containerApps/testCapp/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.ContainerAppsBuildProperties{ - // BuildStatus: to.Ptr(armappcontainers.BuildStatusInProgress), - // Configuration: &armappcontainers.ContainerAppsBuildConfiguration{ - // 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), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go index a857a07a9b76..54618fa86d19 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ContainerAppsDiagnosticsClient contains the methods for the ContainerAppsDiagnostics group. @@ -29,7 +28,7 @@ type ContainerAppsDiagnosticsClient struct { } // NewContainerAppsDiagnosticsClient creates a new instance of ContainerAppsDiagnosticsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewContainerAppsDiagnosticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerAppsDiagnosticsClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -99,7 +98,7 @@ func (client *ContainerAppsDiagnosticsClient) getDetectorCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -169,7 +168,7 @@ func (client *ContainerAppsDiagnosticsClient) getRevisionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -187,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -234,7 +233,7 @@ func (client *ContainerAppsDiagnosticsClient) getRootCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -299,7 +298,7 @@ func (client *ContainerAppsDiagnosticsClient) listDetectorsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,7 +315,7 @@ func (client *ContainerAppsDiagnosticsClient) listDetectorsHandleResponse(resp * // NewListRevisionsPager - Get the Revisions for a given Container App. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -367,7 +366,7 @@ func (client *ContainerAppsDiagnosticsClient) listRevisionsCreateRequest(ctx con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 9c884ff40e4e..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client_example_test.go +++ /dev/null @@ -1,472 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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.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), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("24adfa4f-dedf-8dc0-ca29-b6d1a69ab319"), - // TenantID: to.Ptr("23adfa4f-eedf-1dc0-ba29-a6d1a69ab3d0"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df"), - // PrincipalID: to.Ptr("74adfa4f-dedf-8dc0-ca29-b6d1a69ab312"), - // }, - // }, - // }, - // 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), - // }, - // IdentitySettings: []*armappcontainers.IdentitySettings{ - // { - // Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleAll), - // }, - // { - // Identity: to.Ptr("system"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleInit), - // }}, - // 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), - // Runtime: &armappcontainers.Runtime{ - // Dotnet: &armappcontainers.RuntimeDotnet{ - // AutoConfigureDataProtection: to.Ptr(true), - // }, - // Java: &armappcontainers.RuntimeJava{ - // EnableMetrics: to.Ptr(true), - // JavaAgent: &armappcontainers.RuntimeJavaAgent{ - // Enabled: to.Ptr(true), - // Logging: &armappcontainers.RuntimeJavaAgentLogging{ - // LoggerSettings: []*armappcontainers.LoggerSetting{ - // { - // Level: to.Ptr(armappcontainers.LevelDebug), - // Logger: to.Ptr("org.springframework.boot"), - // }}, - // }, - // }, - // }, - // }, - // 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{ - // CooldownPeriod: to.Ptr[int32](350), - // MaxReplicas: to.Ptr[int32](5), - // MinReplicas: to.Ptr[int32](1), - // PollingInterval: to.Ptr[int32](35), - // Rules: []*armappcontainers.ScaleRule{ - // { - // Name: to.Ptr("httpscalingrule"), - // HTTP: &armappcontainers.HTTPScaleRule{ - // Metadata: map[string]*string{ - // "concurrentRequests": to.Ptr("50"), - // }, - // }, - // }, - // { - // Name: to.Ptr("servicebus"), - // Custom: &armappcontainers.CustomScaleRule{ - // Type: to.Ptr("azure-servicebus"), - // Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - // Metadata: map[string]*string{ - // "messageCount": to.Ptr("5"), - // "namespace": to.Ptr("mynamespace"), - // "queueName": to.Ptr("myqueue"), - // }, - // }, - // }}, - // }, - // 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 deleted file mode 100644 index b9a04f945f09..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappspatches_client.go +++ /dev/null @@ -1,433 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// 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 -} - -// NewContainerAppsPatchesClient creates a new instance of ContainerAppsPatchesClient 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 NewContainerAppsPatchesClient(subscriptionID 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, - 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-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App the Patch is associated. -// - 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, containerAppName string, patchName string, options *ContainerAppsPatchesClientBeginApplyOptions) (*runtime.Poller[ContainerAppsPatchesClientApplyResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.apply(ctx, resourceGroupName, containerAppName, 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-08-02-preview -func (client *ContainerAppsPatchesClient) apply(ctx context.Context, resourceGroupName string, containerAppName 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, containerAppName, 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, containerAppName 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 containerAppName == "" { - return nil, errors.New("parameter containerAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(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-08-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-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App the Patch is associated. -// - 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, containerAppName string, patchName string, options *ContainerAppsPatchesClientBeginDeleteOptions) (*runtime.Poller[ContainerAppsPatchesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, containerAppName, 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-08-02-preview -func (client *ContainerAppsPatchesClient) deleteOperation(ctx context.Context, resourceGroupName string, containerAppName 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, containerAppName, 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, containerAppName 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 containerAppName == "" { - return nil, errors.New("parameter containerAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(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-08-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-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App the Patch is associated. -// - 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, containerAppName 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, containerAppName, 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, containerAppName 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 containerAppName == "" { - return nil, errors.New("parameter containerAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(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-08-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-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App the Patch is associated. -// - options - ContainerAppsPatchesClientListByContainerAppOptions contains the optional parameters for the ContainerAppsPatchesClient.NewListByContainerAppPager -// method. -func (client *ContainerAppsPatchesClient) NewListByContainerAppPager(resourceGroupName string, containerAppName 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, containerAppName, 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, containerAppName 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 containerAppName == "" { - return nil, errors.New("parameter containerAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(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-08-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-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App the Patch is associated. -// - 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, containerAppName string, patchName string, patchSkipConfig PatchSkipConfig, options *ContainerAppsPatchesClientBeginSkipConfigureOptions) (*runtime.Poller[ContainerAppsPatchesClientSkipConfigureResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.skipConfigure(ctx, resourceGroupName, containerAppName, 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-08-02-preview -func (client *ContainerAppsPatchesClient) skipConfigure(ctx context.Context, resourceGroupName string, containerAppName 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, containerAppName, 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, containerAppName 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 containerAppName == "" { - return nil, errors.New("parameter containerAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{containerAppName}", url.PathEscape(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-08-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/containerappspatches_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappspatches_client_example_test.go deleted file mode 100644 index 7ed73eaeb54a..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappspatches_client_example_test.go +++ /dev/null @@ -1,281 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_ListByContainerApp.json -func ExampleContainerAppsPatchesClient_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.NewContainerAppsPatchesClient().NewListByContainerAppPager("rg", "test-app", &armappcontainers.ContainerAppsPatchesClientListByContainerAppOptions{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.PatchCollection = armappcontainers.PatchCollection{ - // Value: []*armappcontainers.ContainerAppsPatchResource{ - // { - // Name: to.Ptr("testPatch-25fe4b"), - // Type: to.Ptr("Microsoft.App/containerApps/patches"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerApps/test-app/patches/testPatch-25fe4b"), - // Properties: &armappcontainers.PatchProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-10T12:06:20.342Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-10T12:06:20.342Z"); return t}()), - // PatchApplyStatus: to.Ptr(armappcontainers.PatchApplyStatusNotStarted), - // PatchDetails: []*armappcontainers.PatchDetails{ - // { - // DetectionStatus: to.Ptr(armappcontainers.DetectionStatusSucceeded), - // LastDetectionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-10T12:06:19.524Z"); return t}()), - // NewImageName: to.Ptr("testregistry.azurecr.io/test-image:release-1-patched-202210101206185241"), - // NewLayer: &armappcontainers.PatchDetailsNewLayer{ - // Name: to.Ptr("mcr.microsoft.com/dotnet/aspnet:7.0.9-cbl-mariner2.0"), - // FrameworkAndVersion: to.Ptr("dotnet:7.0.9"), - // OSAndVersion: to.Ptr("cbl-mariner2.0"), - // }, - // OldLayer: &armappcontainers.PatchDetailsOldLayer{ - // Name: to.Ptr("mcr.microsoft.com/dotnet/aspnet:7.0.7-cbl-mariner2.0"), - // FrameworkAndVersion: to.Ptr("dotnet:7.0.7"), - // OSAndVersion: to.Ptr("cbl-mariner2.0"), - // }, - // PatchType: to.Ptr(armappcontainers.PatchTypeFrameworkSecurity), - // TargetContainerName: to.Ptr("test-container"), - // TargetImage: to.Ptr("testregistry.azurecr.io/test-image:release-1-patched-202209101206203421"), - // }}, - // TargetContainerAppID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerApps/test-app"), - // TargetEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/test-env"), - // TargetRevisionID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/apps/test-app/revisions/test-app--jm3vvry"), - // }, - // }, - // { - // Name: to.Ptr("testPatch-27c3d5"), - // Type: to.Ptr("Microsoft.App/containerApps/patches"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerApps/test-app/patches/testPatch-27c3d5"), - // Properties: &armappcontainers.PatchProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-10T12:06:20.342Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-20T12:06:20.342Z"); return t}()), - // PatchApplyStatus: to.Ptr(armappcontainers.PatchApplyStatusSucceeded), - // PatchDetails: []*armappcontainers.PatchDetails{ - // { - // DetectionStatus: to.Ptr(armappcontainers.DetectionStatusSucceeded), - // LastDetectionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-21T12:06:19.524Z"); return t}()), - // NewImageName: to.Ptr("testregistry.azurecr.io/test-image:release-1-patched-202209101206203421"), - // NewLayer: &armappcontainers.PatchDetailsNewLayer{ - // Name: to.Ptr("mcr.microsoft.com/dotnet/aspnet:7.0.7-cbl-mariner2.0"), - // FrameworkAndVersion: to.Ptr("dotnet:7.0.7"), - // OSAndVersion: to.Ptr("cbl-mariner2.0"), - // }, - // OldLayer: &armappcontainers.PatchDetailsOldLayer{ - // Name: to.Ptr("mcr.microsoft.com/dotnet/aspnet:7.0.5-cbl-mariner2.0"), - // FrameworkAndVersion: to.Ptr("dotnet:7.0.5"), - // OSAndVersion: to.Ptr("cbl-mariner2.0"), - // }, - // PatchType: to.Ptr(armappcontainers.PatchTypeFrameworkSecurity), - // TargetContainerName: to.Ptr("test-container"), - // TargetImage: to.Ptr("testregistry.azurecr.io/test-image:release-1"), - // }, - // { - // DetectionStatus: to.Ptr(armappcontainers.DetectionStatusSucceeded), - // LastDetectionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-09-21T12:06:19.524Z"); return t}()), - // NewImageName: to.Ptr("testregistry.azurecr.io/test-image:release-2-patched-202209101206203421"), - // NewLayer: &armappcontainers.PatchDetailsNewLayer{ - // Name: to.Ptr("mcr.microsoft.com/dotnet/aspnet:7.0.7-cbl-mariner2.0"), - // FrameworkAndVersion: to.Ptr("dotnet:7.0.7"), - // OSAndVersion: to.Ptr("cbl-mariner2.0"), - // }, - // OldLayer: &armappcontainers.PatchDetailsOldLayer{ - // Name: to.Ptr("mcr.microsoft.com/dotnet/aspnet:7.0.0-cbl-mariner2.0"), - // FrameworkAndVersion: to.Ptr("dotnet:7.0.0"), - // OSAndVersion: to.Ptr("cbl-mariner2.0"), - // }, - // PatchType: to.Ptr(armappcontainers.PatchTypeFrameworkSecurity), - // TargetContainerName: to.Ptr("test-container-2"), - // TargetImage: to.Ptr("testregistry.azurecr.io/test-image:release-2"), - // }}, - // TargetContainerAppID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerApps/test-app"), - // TargetEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/test-env"), - // TargetRevisionID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerApps/test-app2/revisions/test-app--z79h4oc"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Get.json -func ExampleContainerAppsPatchesClient_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.NewContainerAppsPatchesClient().Get(ctx, "rg", "test-app", "testPatch-25fe4b", 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.ContainerAppsPatchResource = armappcontainers.ContainerAppsPatchResource{ - // Name: to.Ptr("testPatch-25fe4b"), - // Type: to.Ptr("Microsoft.App/containerApps/patches"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerApps/test-app/patches/testPatch-25fe4b"), - // Properties: &armappcontainers.PatchProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-10T12:06:20.342Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-10T12:06:20.342Z"); return t}()), - // PatchApplyStatus: to.Ptr(armappcontainers.PatchApplyStatusNotStarted), - // PatchDetails: []*armappcontainers.PatchDetails{ - // { - // DetectionStatus: to.Ptr(armappcontainers.DetectionStatusSucceeded), - // LastDetectionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-10T12:06:19.524Z"); return t}()), - // NewImageName: to.Ptr("testregistry.azurecr.io/test-image:latest-patched-202210101206"), - // NewLayer: &armappcontainers.PatchDetailsNewLayer{ - // Name: to.Ptr("mcr.microsoft.com/dotnet/aspnet:7.0.7-cbl-mariner2.0"), - // FrameworkAndVersion: to.Ptr("dotnet:7.0.7"), - // OSAndVersion: to.Ptr("cbl-mariner2.0"), - // }, - // OldLayer: &armappcontainers.PatchDetailsOldLayer{ - // Name: to.Ptr("mcr.microsoft.com/dotnet/aspnet:7.0.5-cbl-mariner2.0"), - // FrameworkAndVersion: to.Ptr("dotnet:7.0.5"), - // OSAndVersion: to.Ptr("cbl-mariner2.0"), - // }, - // PatchType: to.Ptr(armappcontainers.PatchTypeFrameworkSecurity), - // TargetContainerName: to.Ptr("test-container"), - // TargetImage: to.Ptr("testregistry.azurecr.io/test-image:latest"), - // }}, - // TargetContainerAppID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerApps/test-app"), - // TargetEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/test-env"), - // TargetRevisionID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/apps/test-app/revisions/test-app--jm3vvry"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Delete.json -func ExampleContainerAppsPatchesClient_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.NewContainerAppsPatchesClient().BeginDelete(ctx, "rg", "test-app", "testPatch-25fe4b", 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Skip_Configure.json -func ExampleContainerAppsPatchesClient_BeginSkipConfigure() { - 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.NewContainerAppsPatchesClient().BeginSkipConfigure(ctx, "rg", "test-app", "testPatch-25fe4b", armappcontainers.PatchSkipConfig{ - Skip: to.Ptr(true), - }, 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Apply.json -func ExampleContainerAppsPatchesClient_BeginApply() { - 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.NewContainerAppsPatchesClient().BeginApply(ctx, "rg", "test-app", "testPatch-25fe4b", 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.ContainerAppsPatchResource = armappcontainers.ContainerAppsPatchResource{ - // Name: to.Ptr("testPatch-25fe4b"), - // Type: to.Ptr("Microsoft.App/containerApps/patches"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerApps/test-app/patches/testPatch-25fe4b"), - // Properties: &armappcontainers.PatchProperties{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-10T12:06:20.342Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-10T12:06:20.342Z"); return t}()), - // PatchApplyStatus: to.Ptr(armappcontainers.PatchApplyStatusSucceeded), - // PatchDetails: []*armappcontainers.PatchDetails{ - // { - // DetectionStatus: to.Ptr(armappcontainers.DetectionStatusSucceeded), - // LastDetectionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-10-10T12:06:19.524Z"); return t}()), - // NewImageName: to.Ptr("testregistry.azurecr.io/test-image:latest-patched-202210101206"), - // NewLayer: &armappcontainers.PatchDetailsNewLayer{ - // Name: to.Ptr("mcr.microsoft.com/dotnet/aspnet:7.0.7-cbl-mariner2.0"), - // FrameworkAndVersion: to.Ptr("dotnet:7.0.7"), - // OSAndVersion: to.Ptr("cbl-mariner2.0"), - // }, - // OldLayer: &armappcontainers.PatchDetailsOldLayer{ - // Name: to.Ptr("mcr.microsoft.com/dotnet/aspnet:7.0.5-cbl-mariner2.0"), - // FrameworkAndVersion: to.Ptr("dotnet:7.0.5"), - // OSAndVersion: to.Ptr("cbl-mariner2.0"), - // }, - // PatchType: to.Ptr(armappcontainers.PatchTypeFrameworkSecurity), - // TargetContainerName: to.Ptr("test-container"), - // TargetImage: to.Ptr("testregistry.azurecr.io/test-image:latest"), - // }}, - // TargetContainerAppID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/containerApps/test-app"), - // TargetEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/test-env"), - // TargetRevisionID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/apps/test-app/revisions/test-app--jm3vvry"), - // }, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go index 726e985b3baa..55fff65514d2 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ContainerAppsRevisionReplicasClient contains the methods for the ContainerAppsRevisionReplicas group. @@ -29,7 +28,7 @@ type ContainerAppsRevisionReplicasClient struct { } // NewContainerAppsRevisionReplicasClient creates a new instance of ContainerAppsRevisionReplicasClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewContainerAppsRevisionReplicasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerAppsRevisionReplicasClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -104,7 +103,7 @@ func (client *ContainerAppsRevisionReplicasClient) getReplicaCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -122,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -174,7 +173,7 @@ func (client *ContainerAppsRevisionReplicasClient) listReplicasCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 06a5f2a15bfa..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client_example_test.go +++ /dev/null @@ -1,111 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - // DebugEndpoint: to.Ptr("wss://eastasia.azurecontainerapps.dev/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/containerApps/myapp/revisions/myapp--0wlqy09/replicas/myapp--0wlqy09-5d9774cff-5wnd8/debug?targetContainer=hello92"), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - // DebugEndpoint: to.Ptr("wss://eastasia.azurecontainerapps.dev/subscriptions/651f8027-33e8-4ec4-97b4-f6e9f3dc8744/resourceGroups/workerapps-rg-xj/containerApps/myapp/revisions/myapp--0wlqy09/replicas/myapp--0wlqy09-5d9774cff-5wnd8/debug?targetContainer=hello92"), - // 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 e2339f64e161..77a311576309 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ContainerAppsRevisionsClient contains the methods for the ContainerAppsRevisions group. @@ -29,7 +28,7 @@ type ContainerAppsRevisionsClient struct { } // NewContainerAppsRevisionsClient creates a new instance of ContainerAppsRevisionsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewContainerAppsRevisionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerAppsRevisionsClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -98,7 +97,7 @@ func (client *ContainerAppsRevisionsClient) activateRevisionCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -158,7 +157,7 @@ func (client *ContainerAppsRevisionsClient) deactivateRevisionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -167,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -219,7 +218,7 @@ func (client *ContainerAppsRevisionsClient) getRevisionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,7 +235,7 @@ func (client *ContainerAppsRevisionsClient) getRevisionHandleResponse(resp *http // NewListRevisionsPager - Get the Revisions for a given Container App. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -287,7 +286,7 @@ func (client *ContainerAppsRevisionsClient) listRevisionsCreateRequest(ctx conte if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -356,7 +355,7 @@ func (client *ContainerAppsRevisionsClient) restartRevisionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 44bf2f6ccccb..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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.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), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/containerappssessionpools_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappssessionpools_client.go deleted file mode 100644 index 2204ef02833c..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssessionpools_client.go +++ /dev/null @@ -1,464 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// ContainerAppsSessionPoolsClient contains the methods for the ContainerAppsSessionPools group. -// Don't use this type directly, use NewContainerAppsSessionPoolsClient() instead. -type ContainerAppsSessionPoolsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewContainerAppsSessionPoolsClient creates a new instance of ContainerAppsSessionPoolsClient 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 NewContainerAppsSessionPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerAppsSessionPoolsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ContainerAppsSessionPoolsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a session pool with the given properties. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - sessionPoolName - Name of the session pool. -// - sessionPoolEnvelope - Properties used to create a session pool -// - options - ContainerAppsSessionPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.BeginCreateOrUpdate -// method. -func (client *ContainerAppsSessionPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, sessionPoolName string, sessionPoolEnvelope SessionPool, options *ContainerAppsSessionPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ContainerAppsSessionPoolsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, sessionPoolName, sessionPoolEnvelope, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerAppsSessionPoolsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ContainerAppsSessionPoolsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a session pool with the given properties. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -func (client *ContainerAppsSessionPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, sessionPoolName string, sessionPoolEnvelope SessionPool, options *ContainerAppsSessionPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ContainerAppsSessionPoolsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, sessionPoolName, sessionPoolEnvelope, 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.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ContainerAppsSessionPoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, sessionPoolName string, sessionPoolEnvelope SessionPool, options *ContainerAppsSessionPoolsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}" - 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 sessionPoolName == "" { - return nil, errors.New("parameter sessionPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sessionPoolName}", url.PathEscape(sessionPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, sessionPoolEnvelope); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete the session pool with the given name. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - sessionPoolName - Name of the session pool. -// - options - ContainerAppsSessionPoolsClientBeginDeleteOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.BeginDelete -// method. -func (client *ContainerAppsSessionPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, sessionPoolName string, options *ContainerAppsSessionPoolsClientBeginDeleteOptions) (*runtime.Poller[ContainerAppsSessionPoolsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, sessionPoolName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerAppsSessionPoolsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ContainerAppsSessionPoolsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete the session pool with the given name. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -func (client *ContainerAppsSessionPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, sessionPoolName string, options *ContainerAppsSessionPoolsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "ContainerAppsSessionPoolsClient.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, sessionPoolName, 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 *ContainerAppsSessionPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sessionPoolName string, options *ContainerAppsSessionPoolsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}" - 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 sessionPoolName == "" { - return nil, errors.New("parameter sessionPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sessionPoolName}", url.PathEscape(sessionPoolName)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get the properties of a session pool. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - sessionPoolName - Name of the session pool. -// - options - ContainerAppsSessionPoolsClientGetOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.Get -// method. -func (client *ContainerAppsSessionPoolsClient) Get(ctx context.Context, resourceGroupName string, sessionPoolName string, options *ContainerAppsSessionPoolsClientGetOptions) (ContainerAppsSessionPoolsClientGetResponse, error) { - var err error - const operationName = "ContainerAppsSessionPoolsClient.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, sessionPoolName, options) - if err != nil { - return ContainerAppsSessionPoolsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ContainerAppsSessionPoolsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ContainerAppsSessionPoolsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ContainerAppsSessionPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, sessionPoolName string, options *ContainerAppsSessionPoolsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}" - 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 sessionPoolName == "" { - return nil, errors.New("parameter sessionPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sessionPoolName}", url.PathEscape(sessionPoolName)) - 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-08-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 *ContainerAppsSessionPoolsClient) getHandleResponse(resp *http.Response) (ContainerAppsSessionPoolsClientGetResponse, error) { - result := ContainerAppsSessionPoolsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SessionPool); err != nil { - return ContainerAppsSessionPoolsClientGetResponse{}, err - } - return result, nil -} - -// NewListByResourceGroupPager - Get the session pools in a given resource group of a subscription. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - options - ContainerAppsSessionPoolsClientListByResourceGroupOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.NewListByResourceGroupPager -// method. -func (client *ContainerAppsSessionPoolsClient) NewListByResourceGroupPager(resourceGroupName string, options *ContainerAppsSessionPoolsClientListByResourceGroupOptions) *runtime.Pager[ContainerAppsSessionPoolsClientListByResourceGroupResponse] { - return runtime.NewPager(runtime.PagingHandler[ContainerAppsSessionPoolsClientListByResourceGroupResponse]{ - More: func(page ContainerAppsSessionPoolsClientListByResourceGroupResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ContainerAppsSessionPoolsClientListByResourceGroupResponse) (ContainerAppsSessionPoolsClientListByResourceGroupResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ContainerAppsSessionPoolsClient.NewListByResourceGroupPager") - 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.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) - }, nil) - if err != nil { - return ContainerAppsSessionPoolsClientListByResourceGroupResponse{}, err - } - return client.listByResourceGroupHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ContainerAppsSessionPoolsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ContainerAppsSessionPoolsClientListByResourceGroupOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByResourceGroupHandleResponse handles the ListByResourceGroup response. -func (client *ContainerAppsSessionPoolsClient) listByResourceGroupHandleResponse(resp *http.Response) (ContainerAppsSessionPoolsClientListByResourceGroupResponse, error) { - result := ContainerAppsSessionPoolsClientListByResourceGroupResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SessionPoolCollection); err != nil { - return ContainerAppsSessionPoolsClientListByResourceGroupResponse{}, err - } - return result, nil -} - -// NewListBySubscriptionPager - Get the session pools in a given subscription. -// -// Generated from API version 2024-08-02-preview -// - options - ContainerAppsSessionPoolsClientListBySubscriptionOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.NewListBySubscriptionPager -// method. -func (client *ContainerAppsSessionPoolsClient) NewListBySubscriptionPager(options *ContainerAppsSessionPoolsClientListBySubscriptionOptions) *runtime.Pager[ContainerAppsSessionPoolsClientListBySubscriptionResponse] { - return runtime.NewPager(runtime.PagingHandler[ContainerAppsSessionPoolsClientListBySubscriptionResponse]{ - More: func(page ContainerAppsSessionPoolsClientListBySubscriptionResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ContainerAppsSessionPoolsClientListBySubscriptionResponse) (ContainerAppsSessionPoolsClientListBySubscriptionResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ContainerAppsSessionPoolsClient.NewListBySubscriptionPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) - }, nil) - if err != nil { - return ContainerAppsSessionPoolsClientListBySubscriptionResponse{}, err - } - return client.listBySubscriptionHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ContainerAppsSessionPoolsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ContainerAppsSessionPoolsClientListBySubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.App/sessionPools" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listBySubscriptionHandleResponse handles the ListBySubscription response. -func (client *ContainerAppsSessionPoolsClient) listBySubscriptionHandleResponse(resp *http.Response) (ContainerAppsSessionPoolsClientListBySubscriptionResponse, error) { - result := ContainerAppsSessionPoolsClientListBySubscriptionResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.SessionPoolCollection); err != nil { - return ContainerAppsSessionPoolsClientListBySubscriptionResponse{}, err - } - return result, nil -} - -// BeginUpdate - Patches a session pool using JSON merge patch -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - sessionPoolName - Name of the session pool. -// - sessionPoolEnvelope - Properties used to create a session pool -// - options - ContainerAppsSessionPoolsClientBeginUpdateOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.BeginUpdate -// method. -func (client *ContainerAppsSessionPoolsClient) BeginUpdate(ctx context.Context, resourceGroupName string, sessionPoolName string, sessionPoolEnvelope SessionPoolUpdatableProperties, options *ContainerAppsSessionPoolsClientBeginUpdateOptions) (*runtime.Poller[ContainerAppsSessionPoolsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, sessionPoolName, sessionPoolEnvelope, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerAppsSessionPoolsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ContainerAppsSessionPoolsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Patches a session pool using JSON merge patch -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -func (client *ContainerAppsSessionPoolsClient) update(ctx context.Context, resourceGroupName string, sessionPoolName string, sessionPoolEnvelope SessionPoolUpdatableProperties, options *ContainerAppsSessionPoolsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ContainerAppsSessionPoolsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, sessionPoolName, sessionPoolEnvelope, 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 -} - -// updateCreateRequest creates the Update request. -func (client *ContainerAppsSessionPoolsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sessionPoolName string, sessionPoolEnvelope SessionPoolUpdatableProperties, options *ContainerAppsSessionPoolsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}" - 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 sessionPoolName == "" { - return nil, errors.New("parameter sessionPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{sessionPoolName}", url.PathEscape(sessionPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, sessionPoolEnvelope); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssessionpools_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappssessionpools_client_example_test.go deleted file mode 100644 index bf3bd839e0bc..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssessionpools_client_example_test.go +++ /dev/null @@ -1,462 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_ListBySubscription.json -func ExampleContainerAppsSessionPoolsClient_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.NewContainerAppsSessionPoolsClient().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.SessionPoolCollection = armappcontainers.SessionPoolCollection{ - // Value: []*armappcontainers.SessionPool{ - // { - // Name: to.Ptr("testsessionpool"), - // Type: to.Ptr("Microsoft.App/sessionPools"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.SessionPoolProperties{ - // ContainerType: to.Ptr(armappcontainers.ContainerTypeCustomContainer), - // CustomContainerTemplate: &armappcontainers.CustomContainerTemplate{ - // Containers: []*armappcontainers.SessionContainer{ - // { - // Name: to.Ptr("testinitcontainer"), - // 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/testcontainer:v4"), - // Resources: &armappcontainers.SessionContainerResources{ - // CPU: to.Ptr[float64](0.25), - // Memory: to.Ptr("0.5Gi"), - // }, - // }}, - // Ingress: &armappcontainers.SessionIngress{ - // TargetPort: to.Ptr[int32](80), - // }, - // }, - // DynamicPoolConfiguration: &armappcontainers.DynamicPoolConfiguration{ - // CooldownPeriodInSeconds: to.Ptr[int32](600), - // ExecutionType: to.Ptr(armappcontainers.ExecutionTypeTimed), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // NodeCount: to.Ptr[int32](1), - // PoolManagementEndpoint: to.Ptr("https://testsessionpool.agreeableriver-3d30edf1.eastus.azurecontainerapps.io"), - // PoolManagementType: to.Ptr(armappcontainers.PoolManagementTypeDynamic), - // ProvisioningState: to.Ptr(armappcontainers.SessionPoolProvisioningStateSucceeded), - // ScaleConfiguration: &armappcontainers.ScaleConfiguration{ - // MaxConcurrentSessions: to.Ptr[int32](500), - // ReadySessionInstances: to.Ptr[int32](100), - // }, - // SessionNetworkConfiguration: &armappcontainers.SessionNetworkConfiguration{ - // Status: to.Ptr(armappcontainers.SessionNetworkStatusEgressEnabled), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_ListByResourceGroup.json -func ExampleContainerAppsSessionPoolsClient_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.NewContainerAppsSessionPoolsClient().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.SessionPoolCollection = armappcontainers.SessionPoolCollection{ - // Value: []*armappcontainers.SessionPool{ - // { - // Name: to.Ptr("testsessionpool"), - // Type: to.Ptr("Microsoft.App/sessionPools"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.SessionPoolProperties{ - // ContainerType: to.Ptr(armappcontainers.ContainerTypeCustomContainer), - // CustomContainerTemplate: &armappcontainers.CustomContainerTemplate{ - // Containers: []*armappcontainers.SessionContainer{ - // { - // Name: to.Ptr("testinitcontainer"), - // 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/testcontainer:v4"), - // Resources: &armappcontainers.SessionContainerResources{ - // CPU: to.Ptr[float64](0.25), - // Memory: to.Ptr("0.5Gi"), - // }, - // }}, - // Ingress: &armappcontainers.SessionIngress{ - // TargetPort: to.Ptr[int32](80), - // }, - // }, - // DynamicPoolConfiguration: &armappcontainers.DynamicPoolConfiguration{ - // CooldownPeriodInSeconds: to.Ptr[int32](600), - // ExecutionType: to.Ptr(armappcontainers.ExecutionTypeTimed), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // NodeCount: to.Ptr[int32](1), - // PoolManagementEndpoint: to.Ptr("https://testsessionpool.agreeableriver-3d30edf1.eastus.azurecontainerapps.io"), - // PoolManagementType: to.Ptr(armappcontainers.PoolManagementTypeDynamic), - // ProvisioningState: to.Ptr(armappcontainers.SessionPoolProvisioningStateSucceeded), - // ScaleConfiguration: &armappcontainers.ScaleConfiguration{ - // MaxConcurrentSessions: to.Ptr[int32](500), - // ReadySessionInstances: to.Ptr[int32](100), - // }, - // SessionNetworkConfiguration: &armappcontainers.SessionNetworkConfiguration{ - // Status: to.Ptr(armappcontainers.SessionNetworkStatusEgressEnabled), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Get.json -func ExampleContainerAppsSessionPoolsClient_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.NewContainerAppsSessionPoolsClient().Get(ctx, "rg", "testsessionpool", 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.SessionPool = armappcontainers.SessionPool{ - // Name: to.Ptr("testsessionpool"), - // Type: to.Ptr("Microsoft.App/sessionPools"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.SessionPoolProperties{ - // ContainerType: to.Ptr(armappcontainers.ContainerTypeCustomContainer), - // CustomContainerTemplate: &armappcontainers.CustomContainerTemplate{ - // Containers: []*armappcontainers.SessionContainer{ - // { - // Name: to.Ptr("testinitcontainer"), - // 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/testcontainer:v4"), - // Resources: &armappcontainers.SessionContainerResources{ - // CPU: to.Ptr[float64](0.25), - // Memory: to.Ptr("0.5Gi"), - // }, - // }}, - // Ingress: &armappcontainers.SessionIngress{ - // TargetPort: to.Ptr[int32](80), - // }, - // RegistryCredentials: &armappcontainers.SessionRegistryCredentials{ - // Identity: to.Ptr("/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"), - // Server: to.Ptr("test.azurecr.io"), - // }, - // }, - // DynamicPoolConfiguration: &armappcontainers.DynamicPoolConfiguration{ - // CooldownPeriodInSeconds: to.Ptr[int32](600), - // ExecutionType: to.Ptr(armappcontainers.ExecutionTypeTimed), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // NodeCount: to.Ptr[int32](1), - // PoolManagementEndpoint: to.Ptr("https://testsessionpool.agreeableriver-3d30edf1.eastus.azurecontainerapps.io"), - // PoolManagementType: to.Ptr(armappcontainers.PoolManagementTypeDynamic), - // ProvisioningState: to.Ptr(armappcontainers.SessionPoolProvisioningStateSucceeded), - // ScaleConfiguration: &armappcontainers.ScaleConfiguration{ - // MaxConcurrentSessions: to.Ptr[int32](500), - // ReadySessionInstances: to.Ptr[int32](100), - // }, - // SessionNetworkConfiguration: &armappcontainers.SessionNetworkConfiguration{ - // Status: to.Ptr(armappcontainers.SessionNetworkStatusEgressEnabled), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_CreateOrUpdate.json -func ExampleContainerAppsSessionPoolsClient_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.NewContainerAppsSessionPoolsClient().BeginCreateOrUpdate(ctx, "rg", "testsessionpool", armappcontainers.SessionPool{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.SessionPoolProperties{ - ContainerType: to.Ptr(armappcontainers.ContainerTypeCustomContainer), - CustomContainerTemplate: &armappcontainers.CustomContainerTemplate{ - Containers: []*armappcontainers.SessionContainer{ - { - Name: to.Ptr("testinitcontainer"), - 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/testcontainer:v4"), - Resources: &armappcontainers.SessionContainerResources{ - CPU: to.Ptr[float64](0.25), - Memory: to.Ptr("0.5Gi"), - }, - }}, - Ingress: &armappcontainers.SessionIngress{ - TargetPort: to.Ptr[int32](80), - }, - }, - DynamicPoolConfiguration: &armappcontainers.DynamicPoolConfiguration{ - CooldownPeriodInSeconds: to.Ptr[int32](600), - ExecutionType: to.Ptr(armappcontainers.ExecutionTypeTimed), - }, - EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - PoolManagementType: to.Ptr(armappcontainers.PoolManagementTypeDynamic), - ScaleConfiguration: &armappcontainers.ScaleConfiguration{ - MaxConcurrentSessions: to.Ptr[int32](500), - ReadySessionInstances: to.Ptr[int32](100), - }, - SessionNetworkConfiguration: &armappcontainers.SessionNetworkConfiguration{ - Status: to.Ptr(armappcontainers.SessionNetworkStatusEgressEnabled), - }, - }, - }, 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.SessionPool = armappcontainers.SessionPool{ - // Name: to.Ptr("testsessionpool"), - // Type: to.Ptr("Microsoft.App/sessionPools"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.SessionPoolProperties{ - // ContainerType: to.Ptr(armappcontainers.ContainerTypeCustomContainer), - // CustomContainerTemplate: &armappcontainers.CustomContainerTemplate{ - // Containers: []*armappcontainers.SessionContainer{ - // { - // Name: to.Ptr("testinitcontainer"), - // 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/testcontainer:v4"), - // Resources: &armappcontainers.SessionContainerResources{ - // CPU: to.Ptr[float64](0.25), - // Memory: to.Ptr("0.5Gi"), - // }, - // }}, - // Ingress: &armappcontainers.SessionIngress{ - // TargetPort: to.Ptr[int32](80), - // }, - // RegistryCredentials: &armappcontainers.SessionRegistryCredentials{ - // Identity: to.Ptr("/subscriptions/7a497526-bb8d-4816-9795-db1418a1f977/resourcegroups/test/providers/Microsoft.ManagedIdentity/userAssignedIdentities/testSP"), - // Server: to.Ptr("test.azurecr.io"), - // }, - // }, - // DynamicPoolConfiguration: &armappcontainers.DynamicPoolConfiguration{ - // CooldownPeriodInSeconds: to.Ptr[int32](600), - // ExecutionType: to.Ptr(armappcontainers.ExecutionTypeTimed), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // NodeCount: to.Ptr[int32](1), - // PoolManagementEndpoint: to.Ptr("https://testsessionpool.agreeableriver-3d30edf1.eastus.azurecontainerapps.io"), - // PoolManagementType: to.Ptr(armappcontainers.PoolManagementTypeDynamic), - // ProvisioningState: to.Ptr(armappcontainers.SessionPoolProvisioningStateSucceeded), - // ScaleConfiguration: &armappcontainers.ScaleConfiguration{ - // MaxConcurrentSessions: to.Ptr[int32](500), - // ReadySessionInstances: to.Ptr[int32](100), - // }, - // SessionNetworkConfiguration: &armappcontainers.SessionNetworkConfiguration{ - // Status: to.Ptr(armappcontainers.SessionNetworkStatusEgressEnabled), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Patch.json -func ExampleContainerAppsSessionPoolsClient_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.NewContainerAppsSessionPoolsClient().BeginUpdate(ctx, "rg", "testsessionpool", armappcontainers.SessionPoolUpdatableProperties{ - Properties: &armappcontainers.SessionPoolUpdatablePropertiesProperties{ - CustomContainerTemplate: &armappcontainers.CustomContainerTemplate{ - Containers: []*armappcontainers.SessionContainer{ - { - Name: to.Ptr("testinitcontainer"), - 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/testcontainer:v4"), - Resources: &armappcontainers.SessionContainerResources{ - CPU: to.Ptr[float64](0.25), - Memory: to.Ptr("0.5Gi"), - }, - }}, - Ingress: &armappcontainers.SessionIngress{ - TargetPort: to.Ptr[int32](80), - }, - }, - DynamicPoolConfiguration: &armappcontainers.DynamicPoolConfiguration{ - CooldownPeriodInSeconds: to.Ptr[int32](600), - ExecutionType: to.Ptr(armappcontainers.ExecutionTypeTimed), - }, - ScaleConfiguration: &armappcontainers.ScaleConfiguration{ - MaxConcurrentSessions: to.Ptr[int32](500), - ReadySessionInstances: to.Ptr[int32](100), - }, - SessionNetworkConfiguration: &armappcontainers.SessionNetworkConfiguration{ - Status: to.Ptr(armappcontainers.SessionNetworkStatusEgressEnabled), - }, - }, - }, 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.SessionPool = armappcontainers.SessionPool{ - // Name: to.Ptr("testsessionpool"), - // Type: to.Ptr("Microsoft.App/sessionPools"), - // ID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/sessionPools/testsessionpool"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.SessionPoolProperties{ - // ContainerType: to.Ptr(armappcontainers.ContainerTypeCustomContainer), - // CustomContainerTemplate: &armappcontainers.CustomContainerTemplate{ - // Containers: []*armappcontainers.SessionContainer{ - // { - // Name: to.Ptr("testinitcontainer"), - // 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/testcontainer:v4"), - // Resources: &armappcontainers.SessionContainerResources{ - // CPU: to.Ptr[float64](0.25), - // Memory: to.Ptr("0.5Gi"), - // }, - // }}, - // Ingress: &armappcontainers.SessionIngress{ - // TargetPort: to.Ptr[int32](80), - // }, - // }, - // DynamicPoolConfiguration: &armappcontainers.DynamicPoolConfiguration{ - // CooldownPeriodInSeconds: to.Ptr[int32](600), - // ExecutionType: to.Ptr(armappcontainers.ExecutionTypeTimed), - // }, - // EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - // NodeCount: to.Ptr[int32](1), - // PoolManagementEndpoint: to.Ptr("https://testsessionpool.agreeableriver-3d30edf1.eastus.azurecontainerapps.io"), - // PoolManagementType: to.Ptr(armappcontainers.PoolManagementTypeDynamic), - // ProvisioningState: to.Ptr(armappcontainers.SessionPoolProvisioningStateSucceeded), - // ScaleConfiguration: &armappcontainers.ScaleConfiguration{ - // MaxConcurrentSessions: to.Ptr[int32](500), - // ReadySessionInstances: to.Ptr[int32](100), - // }, - // SessionNetworkConfiguration: &armappcontainers.SessionNetworkConfiguration{ - // Status: to.Ptr(armappcontainers.SessionNetworkStatusEgressEnabled), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Delete.json -func ExampleContainerAppsSessionPoolsClient_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.NewContainerAppsSessionPoolsClient().BeginDelete(ctx, "rg", "testsessionpool", 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/containerappssourcecontrols_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go index e27a1e89b49b..cef409ebc499 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go @@ -11,15 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strconv" - "strings" - "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" ) // ContainerAppsSourceControlsClient contains the methods for the ContainerAppsSourceControls group. @@ -30,7 +28,7 @@ type ContainerAppsSourceControlsClient struct { } // NewContainerAppsSourceControlsClient creates a new instance of ContainerAppsSourceControlsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewContainerAppsSourceControlsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerAppsSourceControlsClient, error) { @@ -48,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -75,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 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -121,12 +119,9 @@ func (client *ContainerAppsSourceControlsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.XMSGithubAuxiliary != nil { - req.Raw().Header["x-ms-github-auxiliary"] = []string{*options.XMSGithubAuxiliary} - } if err := runtime.MarshalAsJSON(req, sourceControlEnvelope); err != nil { return nil, err } @@ -136,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -162,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 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -208,25 +203,16 @@ func (client *ContainerAppsSourceControlsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - if options != nil && options.DeleteWorkflow != nil { - reqQP.Set("deleteWorkflow", strconv.FormatBool(*options.DeleteWorkflow)) - } - if options != nil && options.IgnoreWorkflowDeletionFailure != nil { - reqQP.Set("ignoreWorkflowDeletionFailure", strconv.FormatBool(*options.IgnoreWorkflowDeletionFailure)) - } + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.XMSGithubAuxiliary != nil { - req.Raw().Header["x-ms-github-auxiliary"] = []string{*options.XMSGithubAuxiliary} - } return req, nil } // Get - Get a SourceControl of a Container App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -278,7 +264,7 @@ func (client *ContainerAppsSourceControlsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -295,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -343,7 +329,7 @@ func (client *ContainerAppsSourceControlsClient) listByContainerAppCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 995b12e24d57..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client_example_test.go +++ /dev/null @@ -1,227 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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("./"), - // DockerfilePath: to.Ptr("./Dockerfile"), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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("./"), - // DockerfilePath: to.Ptr("./Dockerfile"), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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("./"), - DockerfilePath: to.Ptr("./Dockerfile"), - 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"), - }, - }, &armappcontainers.ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions{XMSGithubAuxiliary: to.Ptr("githubaccesstoken")}) - 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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", &armappcontainers.ContainerAppsSourceControlsClientBeginDeleteOptions{XMSGithubAuxiliary: to.Ptr("githubaccesstoken"), - IgnoreWorkflowDeletionFailure: to.Ptr(false), - DeleteWorkflow: to.Ptr(false), - }) - 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 deleted file mode 100644 index ab0614011f96..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponentresiliencypolicies_client.go +++ /dev/null @@ -1,334 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// DaprComponentResiliencyPoliciesClient contains the methods for the DaprComponentResiliencyPolicies group. -// Don't use this type directly, use NewDaprComponentResiliencyPoliciesClient() instead. -type DaprComponentResiliencyPoliciesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDaprComponentResiliencyPoliciesClient creates a new instance of DaprComponentResiliencyPoliciesClient 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 NewDaprComponentResiliencyPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DaprComponentResiliencyPoliciesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DaprComponentResiliencyPoliciesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// 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 2024-08-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. -// - name - Name of the Dapr Component Resiliency Policy. -// - daprComponentResiliencyPolicyEnvelope - Configuration details of the Dapr Component Resiliency Policy. -// - options - DaprComponentResiliencyPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DaprComponentResiliencyPoliciesClient.CreateOrUpdate -// method. -func (client *DaprComponentResiliencyPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, componentName string, name string, daprComponentResiliencyPolicyEnvelope DaprComponentResiliencyPolicy, options *DaprComponentResiliencyPoliciesClientCreateOrUpdateOptions) (DaprComponentResiliencyPoliciesClientCreateOrUpdateResponse, error) { - var err error - const operationName = "DaprComponentResiliencyPoliciesClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, environmentName, componentName, name, daprComponentResiliencyPolicyEnvelope, options) - if err != nil { - return DaprComponentResiliencyPoliciesClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprComponentResiliencyPoliciesClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return DaprComponentResiliencyPoliciesClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DaprComponentResiliencyPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, componentName string, name string, daprComponentResiliencyPolicyEnvelope DaprComponentResiliencyPolicy, options *DaprComponentResiliencyPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if componentName == "" { - return nil, errors.New("parameter componentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, daprComponentResiliencyPolicyEnvelope); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *DaprComponentResiliencyPoliciesClient) createOrUpdateHandleResponse(resp *http.Response) (DaprComponentResiliencyPoliciesClientCreateOrUpdateResponse, error) { - result := DaprComponentResiliencyPoliciesClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprComponentResiliencyPolicy); err != nil { - return DaprComponentResiliencyPoliciesClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete a resiliency policy for a Dapr component. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - name - Name of the Dapr Component Resiliency Policy. -// - options - DaprComponentResiliencyPoliciesClientDeleteOptions contains the optional parameters for the DaprComponentResiliencyPoliciesClient.Delete -// method. -func (client *DaprComponentResiliencyPoliciesClient) Delete(ctx context.Context, resourceGroupName string, environmentName string, componentName string, name string, options *DaprComponentResiliencyPoliciesClientDeleteOptions) (DaprComponentResiliencyPoliciesClientDeleteResponse, error) { - var err error - const operationName = "DaprComponentResiliencyPoliciesClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, environmentName, componentName, name, options) - if err != nil { - return DaprComponentResiliencyPoliciesClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprComponentResiliencyPoliciesClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return DaprComponentResiliencyPoliciesClientDeleteResponse{}, err - } - return DaprComponentResiliencyPoliciesClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DaprComponentResiliencyPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, componentName string, name string, options *DaprComponentResiliencyPoliciesClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if componentName == "" { - return nil, errors.New("parameter componentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a Dapr component resiliency policy. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - name - Name of the Dapr Component Resiliency Policy. -// - options - DaprComponentResiliencyPoliciesClientGetOptions contains the optional parameters for the DaprComponentResiliencyPoliciesClient.Get -// method. -func (client *DaprComponentResiliencyPoliciesClient) Get(ctx context.Context, resourceGroupName string, environmentName string, componentName string, name string, options *DaprComponentResiliencyPoliciesClientGetOptions) (DaprComponentResiliencyPoliciesClientGetResponse, error) { - var err error - const operationName = "DaprComponentResiliencyPoliciesClient.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, environmentName, componentName, name, options) - if err != nil { - return DaprComponentResiliencyPoliciesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprComponentResiliencyPoliciesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DaprComponentResiliencyPoliciesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DaprComponentResiliencyPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, componentName string, name string, options *DaprComponentResiliencyPoliciesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if componentName == "" { - return nil, errors.New("parameter componentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - 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-08-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 *DaprComponentResiliencyPoliciesClient) getHandleResponse(resp *http.Response) (DaprComponentResiliencyPoliciesClientGetResponse, error) { - result := DaprComponentResiliencyPoliciesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprComponentResiliencyPolicy); err != nil { - return DaprComponentResiliencyPoliciesClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Get the resiliency policies for a Dapr component. -// -// Generated from API version 2024-08-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. -// - options - DaprComponentResiliencyPoliciesClientListOptions contains the optional parameters for the DaprComponentResiliencyPoliciesClient.NewListPager -// method. -func (client *DaprComponentResiliencyPoliciesClient) NewListPager(resourceGroupName string, environmentName string, componentName string, options *DaprComponentResiliencyPoliciesClientListOptions) *runtime.Pager[DaprComponentResiliencyPoliciesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DaprComponentResiliencyPoliciesClientListResponse]{ - More: func(page DaprComponentResiliencyPoliciesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DaprComponentResiliencyPoliciesClientListResponse) (DaprComponentResiliencyPoliciesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DaprComponentResiliencyPoliciesClient.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, environmentName, componentName, options) - }, nil) - if err != nil { - return DaprComponentResiliencyPoliciesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *DaprComponentResiliencyPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, componentName string, options *DaprComponentResiliencyPoliciesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if componentName == "" { - return nil, errors.New("parameter componentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{componentName}", url.PathEscape(componentName)) - 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-08-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 *DaprComponentResiliencyPoliciesClient) listHandleResponse(resp *http.Response) (DaprComponentResiliencyPoliciesClientListResponse, error) { - result := DaprComponentResiliencyPoliciesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprComponentResiliencyPoliciesCollection); err != nil { - return DaprComponentResiliencyPoliciesClientListResponse{}, err - } - return result, 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 7f2a1dc56fa8..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 f905bf710a44..4e7dccb6f2b4 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // DaprComponentsClient contains the methods for the DaprComponents group. @@ -29,7 +28,7 @@ type DaprComponentsClient struct { } // NewDaprComponentsClient creates a new instance of DaprComponentsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewDaprComponentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DaprComponentsClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - componentName - Name of the Dapr Component. @@ -100,7 +99,7 @@ func (client *DaprComponentsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, daprComponentEnvelope); err != nil { @@ -121,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - componentName - Name of the Dapr Component. @@ -171,7 +170,7 @@ func (client *DaprComponentsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - componentName - Name of the Dapr Component. @@ -231,7 +230,7 @@ func (client *DaprComponentsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +247,7 @@ func (client *DaprComponentsClient) getHandleResponse(resp *http.Response) (Dapr // NewListPager - Get the Dapr Components for a managed environment. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -295,7 +294,7 @@ func (client *DaprComponentsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - componentName - Name of the Dapr Component. @@ -365,7 +364,7 @@ func (client *DaprComponentsClient) listSecretsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 a2492bb02922..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 deleted file mode 100644 index 49eb6d46fb81..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/daprsubscriptions_client.go +++ /dev/null @@ -1,313 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// DaprSubscriptionsClient contains the methods for the DaprSubscriptions group. -// Don't use this type directly, use NewDaprSubscriptionsClient() instead. -type DaprSubscriptionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDaprSubscriptionsClient creates a new instance of DaprSubscriptionsClient 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 NewDaprSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DaprSubscriptionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DaprSubscriptionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// 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 2024-08-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. -// - daprSubscriptionEnvelope - Configuration details of the Dapr subscription. -// - options - DaprSubscriptionsClientCreateOrUpdateOptions contains the optional parameters for the DaprSubscriptionsClient.CreateOrUpdate -// method. -func (client *DaprSubscriptionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, name string, daprSubscriptionEnvelope DaprSubscription, options *DaprSubscriptionsClientCreateOrUpdateOptions) (DaprSubscriptionsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "DaprSubscriptionsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, environmentName, name, daprSubscriptionEnvelope, options) - if err != nil { - return DaprSubscriptionsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprSubscriptionsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return DaprSubscriptionsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DaprSubscriptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, daprSubscriptionEnvelope DaprSubscription, options *DaprSubscriptionsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, daprSubscriptionEnvelope); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *DaprSubscriptionsClient) createOrUpdateHandleResponse(resp *http.Response) (DaprSubscriptionsClientCreateOrUpdateResponse, error) { - result := DaprSubscriptionsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprSubscription); err != nil { - return DaprSubscriptionsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete a Dapr subscription from a Managed Environment. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - options - DaprSubscriptionsClientDeleteOptions contains the optional parameters for the DaprSubscriptionsClient.Delete -// method. -func (client *DaprSubscriptionsClient) Delete(ctx context.Context, resourceGroupName string, environmentName string, name string, options *DaprSubscriptionsClientDeleteOptions) (DaprSubscriptionsClientDeleteResponse, error) { - var err error - const operationName = "DaprSubscriptionsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, environmentName, name, options) - if err != nil { - return DaprSubscriptionsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprSubscriptionsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return DaprSubscriptionsClientDeleteResponse{}, err - } - return DaprSubscriptionsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *DaprSubscriptionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, options *DaprSubscriptionsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a dapr subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - options - DaprSubscriptionsClientGetOptions contains the optional parameters for the DaprSubscriptionsClient.Get method. -func (client *DaprSubscriptionsClient) Get(ctx context.Context, resourceGroupName string, environmentName string, name string, options *DaprSubscriptionsClientGetOptions) (DaprSubscriptionsClientGetResponse, error) { - var err error - const operationName = "DaprSubscriptionsClient.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, environmentName, name, options) - if err != nil { - return DaprSubscriptionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DaprSubscriptionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DaprSubscriptionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DaprSubscriptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, options *DaprSubscriptionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - 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-08-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 *DaprSubscriptionsClient) getHandleResponse(resp *http.Response) (DaprSubscriptionsClientGetResponse, error) { - result := DaprSubscriptionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprSubscription); err != nil { - return DaprSubscriptionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Get the Dapr subscriptions for a managed environment. -// -// Generated from API version 2024-08-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 -// method. -func (client *DaprSubscriptionsClient) NewListPager(resourceGroupName string, environmentName string, options *DaprSubscriptionsClientListOptions) *runtime.Pager[DaprSubscriptionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DaprSubscriptionsClientListResponse]{ - More: func(page DaprSubscriptionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DaprSubscriptionsClientListResponse) (DaprSubscriptionsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DaprSubscriptionsClient.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, environmentName, options) - }, nil) - if err != nil { - return DaprSubscriptionsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *DaprSubscriptionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *DaprSubscriptionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - 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-08-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 *DaprSubscriptionsClient) listHandleResponse(resp *http.Response) (DaprSubscriptionsClientListResponse, error) { - result := DaprSubscriptionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DaprSubscriptionsCollection); err != nil { - return DaprSubscriptionsClientListResponse{}, err - } - return result, 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 d239bcd2578d..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 deleted file mode 100644 index 60bc84ac5f2a..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/dotnetcomponents_client.go +++ /dev/null @@ -1,432 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// DotNetComponentsClient contains the methods for the DotNetComponents group. -// Don't use this type directly, use NewDotNetComponentsClient() instead. -type DotNetComponentsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewDotNetComponentsClient creates a new instance of DotNetComponentsClient 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 NewDotNetComponentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DotNetComponentsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &DotNetComponentsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// 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 2024-08-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. -// - dotNetComponentEnvelope - Configuration details of the .NET Component. -// - options - DotNetComponentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DotNetComponentsClient.BeginCreateOrUpdate -// method. -func (client *DotNetComponentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, name string, dotNetComponentEnvelope DotNetComponent, options *DotNetComponentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DotNetComponentsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, environmentName, name, dotNetComponentEnvelope, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DotNetComponentsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DotNetComponentsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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 2024-08-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" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, environmentName, name, dotNetComponentEnvelope, 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.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DotNetComponentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, dotNetComponentEnvelope DotNetComponent, options *DotNetComponentsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, dotNetComponentEnvelope); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a .NET Component. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - options - DotNetComponentsClientBeginDeleteOptions contains the optional parameters for the DotNetComponentsClient.BeginDelete -// method. -func (client *DotNetComponentsClient) BeginDelete(ctx context.Context, resourceGroupName string, environmentName string, name string, options *DotNetComponentsClientBeginDeleteOptions) (*runtime.Poller[DotNetComponentsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, environmentName, name, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DotNetComponentsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DotNetComponentsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a .NET Component. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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" - 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, environmentName, name, 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 *DotNetComponentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, options *DotNetComponentsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a .NET Component. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - options - DotNetComponentsClientGetOptions contains the optional parameters for the DotNetComponentsClient.Get method. -func (client *DotNetComponentsClient) Get(ctx context.Context, resourceGroupName string, environmentName string, name string, options *DotNetComponentsClientGetOptions) (DotNetComponentsClientGetResponse, error) { - var err error - const operationName = "DotNetComponentsClient.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, environmentName, name, options) - if err != nil { - return DotNetComponentsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return DotNetComponentsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return DotNetComponentsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *DotNetComponentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, options *DotNetComponentsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - 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-08-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 *DotNetComponentsClient) getHandleResponse(resp *http.Response) (DotNetComponentsClientGetResponse, error) { - result := DotNetComponentsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DotNetComponent); err != nil { - return DotNetComponentsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Get the .NET Components for a managed environment. -// -// Generated from API version 2024-08-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 -// method. -func (client *DotNetComponentsClient) NewListPager(resourceGroupName string, environmentName string, options *DotNetComponentsClientListOptions) *runtime.Pager[DotNetComponentsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[DotNetComponentsClientListResponse]{ - More: func(page DotNetComponentsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *DotNetComponentsClientListResponse) (DotNetComponentsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "DotNetComponentsClient.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, environmentName, options) - }, nil) - if err != nil { - return DotNetComponentsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *DotNetComponentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *DotNetComponentsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - 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-08-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 *DotNetComponentsClient) listHandleResponse(resp *http.Response) (DotNetComponentsClientListResponse, error) { - result := DotNetComponentsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.DotNetComponentsCollection); err != nil { - return DotNetComponentsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - Patches a .NET Component using JSON Merge Patch -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - dotNetComponentEnvelope - Configuration details of the .NET Component. -// - options - DotNetComponentsClientBeginUpdateOptions contains the optional parameters for the DotNetComponentsClient.BeginUpdate -// method. -func (client *DotNetComponentsClient) BeginUpdate(ctx context.Context, resourceGroupName string, environmentName string, name string, dotNetComponentEnvelope DotNetComponent, options *DotNetComponentsClientBeginUpdateOptions) (*runtime.Poller[DotNetComponentsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, environmentName, name, dotNetComponentEnvelope, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DotNetComponentsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[DotNetComponentsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Patches a .NET Component using JSON Merge Patch -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, environmentName, name, dotNetComponentEnvelope, 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 -} - -// updateCreateRequest creates the Update request. -func (client *DotNetComponentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, dotNetComponentEnvelope DotNetComponent, options *DotNetComponentsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, dotNetComponentEnvelope); err != nil { - return nil, err - } - return req, 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 5feaf78c731a..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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.DotNetComponentType("MyOtherDotNetComponentType")), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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.DotNetComponentType("MyOtherDotNetComponentType")), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/appresiliency_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/appresiliency_server.go deleted file mode 100644 index 3261255adf8a..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/appresiliency_server.go +++ /dev/null @@ -1,294 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// AppResiliencyServer is a fake server for instances of the armappcontainers.AppResiliencyClient type. -type AppResiliencyServer struct { - // CreateOrUpdate is the fake for method AppResiliencyClient.CreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - CreateOrUpdate func(ctx context.Context, resourceGroupName string, appName string, name string, resiliencyEnvelope armappcontainers.AppResiliency, options *armappcontainers.AppResiliencyClientCreateOrUpdateOptions) (resp azfake.Responder[armappcontainers.AppResiliencyClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // Delete is the fake for method AppResiliencyClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, resourceGroupName string, appName string, name string, options *armappcontainers.AppResiliencyClientDeleteOptions) (resp azfake.Responder[armappcontainers.AppResiliencyClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method AppResiliencyClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, appName string, name string, options *armappcontainers.AppResiliencyClientGetOptions) (resp azfake.Responder[armappcontainers.AppResiliencyClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method AppResiliencyClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, appName string, options *armappcontainers.AppResiliencyClientListOptions) (resp azfake.PagerResponder[armappcontainers.AppResiliencyClientListResponse]) - - // Update is the fake for method AppResiliencyClient.Update - // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, resourceGroupName string, appName string, name string, resiliencyEnvelope armappcontainers.AppResiliency, options *armappcontainers.AppResiliencyClientUpdateOptions) (resp azfake.Responder[armappcontainers.AppResiliencyClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewAppResiliencyServerTransport creates a new instance of AppResiliencyServerTransport with the provided implementation. -// The returned AppResiliencyServerTransport instance is connected to an instance of armappcontainers.AppResiliencyClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewAppResiliencyServerTransport(srv *AppResiliencyServer) *AppResiliencyServerTransport { - return &AppResiliencyServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armappcontainers.AppResiliencyClientListResponse]](), - } -} - -// AppResiliencyServerTransport connects instances of armappcontainers.AppResiliencyClient to instances of AppResiliencyServer. -// Don't use this type directly, use NewAppResiliencyServerTransport instead. -type AppResiliencyServerTransport struct { - srv *AppResiliencyServer - newListPager *tracker[azfake.PagerResponder[armappcontainers.AppResiliencyClientListResponse]] -} - -// Do implements the policy.Transporter interface for AppResiliencyServerTransport. -func (a *AppResiliencyServerTransport) 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 "AppResiliencyClient.CreateOrUpdate": - resp, err = a.dispatchCreateOrUpdate(req) - case "AppResiliencyClient.Delete": - resp, err = a.dispatchDelete(req) - case "AppResiliencyClient.Get": - resp, err = a.dispatchGet(req) - case "AppResiliencyClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AppResiliencyClient.Update": - resp, err = a.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (a *AppResiliencyServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { - if a.srv.CreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate 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~%@]+)/resiliencyPolicies/(?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) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.AppResiliency](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - appNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, appNameParam, nameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AppResiliency, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AppResiliencyServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if a.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/containerApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resiliencyPolicies/(?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 - } - appNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.Delete(req.Context(), resourceGroupNameParam, appNameParam, nameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AppResiliencyServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if a.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~%@]+)/resiliencyPolicies/(?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 - } - appNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, appNameParam, nameParam, 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).AppResiliency, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AppResiliencyServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if a.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := a.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~%@]+)/resiliencyPolicies` - 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 - } - appNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appName")]) - if err != nil { - return nil, err - } - resp := a.srv.NewListPager(resourceGroupNameParam, appNameParam, nil) - newListPager = &resp - a.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armappcontainers.AppResiliencyClientListResponse, 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) { - a.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - a.newListPager.remove(req) - } - return resp, nil -} - -func (a *AppResiliencyServerTransport) dispatchUpdate(req *http.Request) (*http.Response, error) { - if a.srv.Update == nil { - return nil, &nonRetriableError{errors.New("fake for method Update 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~%@]+)/resiliencyPolicies/(?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) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.AppResiliency](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - appNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("appName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.Update(req.Context(), resourceGroupNameParam, appNameParam, nameParam, body, 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).AppResiliency, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/availableworkloadprofiles_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/availableworkloadprofiles_server.go index b7e4276be2dd..97e136b55c89 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/availableworkloadprofiles_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/availableworkloadprofiles_server.go @@ -11,15 +11,14 @@ package fake import ( "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // AvailableWorkloadProfilesServer is a fake server for instances of the armappcontainers.AvailableWorkloadProfilesClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/billingmeters_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/billingmeters_server.go index 3ec8c1e13e1c..c4043b639598 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/billingmeters_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/billingmeters_server.go @@ -12,14 +12,13 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // BillingMetersServer is a fake server for instances of the armappcontainers.BillingMetersClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/buildauthtoken_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/buildauthtoken_server.go deleted file mode 100644 index b78b5f9711eb..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/buildauthtoken_server.go +++ /dev/null @@ -1,105 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// BuildAuthTokenServer is a fake server for instances of the armappcontainers.BuildAuthTokenClient type. -type BuildAuthTokenServer struct { - // List is the fake for method BuildAuthTokenClient.List - // HTTP status codes to indicate success: http.StatusOK - List func(ctx context.Context, resourceGroupName string, builderName string, buildName string, options *armappcontainers.BuildAuthTokenClientListOptions) (resp azfake.Responder[armappcontainers.BuildAuthTokenClientListResponse], errResp azfake.ErrorResponder) -} - -// NewBuildAuthTokenServerTransport creates a new instance of BuildAuthTokenServerTransport with the provided implementation. -// The returned BuildAuthTokenServerTransport instance is connected to an instance of armappcontainers.BuildAuthTokenClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewBuildAuthTokenServerTransport(srv *BuildAuthTokenServer) *BuildAuthTokenServerTransport { - return &BuildAuthTokenServerTransport{srv: srv} -} - -// BuildAuthTokenServerTransport connects instances of armappcontainers.BuildAuthTokenClient to instances of BuildAuthTokenServer. -// Don't use this type directly, use NewBuildAuthTokenServerTransport instead. -type BuildAuthTokenServerTransport struct { - srv *BuildAuthTokenServer -} - -// Do implements the policy.Transporter interface for BuildAuthTokenServerTransport. -func (b *BuildAuthTokenServerTransport) 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 "BuildAuthTokenClient.List": - resp, err = b.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (b *BuildAuthTokenServerTransport) dispatchList(req *http.Request) (*http.Response, error) { - if b.srv.List == nil { - return nil, &nonRetriableError{errors.New("fake for method List not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/builders/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/builds/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listAuthToken` - 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 - } - builderNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("builderName")]) - if err != nil { - return nil, err - } - buildNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("buildName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.List(req.Context(), resourceGroupNameParam, builderNameParam, 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).BuildToken, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/builders_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/builders_server.go deleted file mode 100644 index b87d6ed74f4d..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/builders_server.go +++ /dev/null @@ -1,354 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// BuildersServer is a fake server for instances of the armappcontainers.BuildersClient type. -type BuildersServer struct { - // BeginCreateOrUpdate is the fake for method BuildersClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, builderName string, builderEnvelope armappcontainers.BuilderResource, options *armappcontainers.BuildersClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armappcontainers.BuildersClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method BuildersClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, builderName string, options *armappcontainers.BuildersClientBeginDeleteOptions) (resp azfake.PollerResponder[armappcontainers.BuildersClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method BuildersClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, builderName string, options *armappcontainers.BuildersClientGetOptions) (resp azfake.Responder[armappcontainers.BuildersClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByResourceGroupPager is the fake for method BuildersClient.NewListByResourceGroupPager - // HTTP status codes to indicate success: http.StatusOK - NewListByResourceGroupPager func(resourceGroupName string, options *armappcontainers.BuildersClientListByResourceGroupOptions) (resp azfake.PagerResponder[armappcontainers.BuildersClientListByResourceGroupResponse]) - - // NewListBySubscriptionPager is the fake for method BuildersClient.NewListBySubscriptionPager - // HTTP status codes to indicate success: http.StatusOK - NewListBySubscriptionPager func(options *armappcontainers.BuildersClientListBySubscriptionOptions) (resp azfake.PagerResponder[armappcontainers.BuildersClientListBySubscriptionResponse]) - - // BeginUpdate is the fake for method BuildersClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceGroupName string, builderName string, builderEnvelope armappcontainers.BuilderResourceUpdate, options *armappcontainers.BuildersClientBeginUpdateOptions) (resp azfake.PollerResponder[armappcontainers.BuildersClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewBuildersServerTransport creates a new instance of BuildersServerTransport with the provided implementation. -// The returned BuildersServerTransport instance is connected to an instance of armappcontainers.BuildersClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewBuildersServerTransport(srv *BuildersServer) *BuildersServerTransport { - return &BuildersServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappcontainers.BuildersClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armappcontainers.BuildersClientDeleteResponse]](), - newListByResourceGroupPager: newTracker[azfake.PagerResponder[armappcontainers.BuildersClientListByResourceGroupResponse]](), - newListBySubscriptionPager: newTracker[azfake.PagerResponder[armappcontainers.BuildersClientListBySubscriptionResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armappcontainers.BuildersClientUpdateResponse]](), - } -} - -// BuildersServerTransport connects instances of armappcontainers.BuildersClient to instances of BuildersServer. -// Don't use this type directly, use NewBuildersServerTransport instead. -type BuildersServerTransport struct { - srv *BuildersServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armappcontainers.BuildersClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armappcontainers.BuildersClientDeleteResponse]] - newListByResourceGroupPager *tracker[azfake.PagerResponder[armappcontainers.BuildersClientListByResourceGroupResponse]] - newListBySubscriptionPager *tracker[azfake.PagerResponder[armappcontainers.BuildersClientListBySubscriptionResponse]] - beginUpdate *tracker[azfake.PollerResponder[armappcontainers.BuildersClientUpdateResponse]] -} - -// Do implements the policy.Transporter interface for BuildersServerTransport. -func (b *BuildersServerTransport) 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 "BuildersClient.BeginCreateOrUpdate": - resp, err = b.dispatchBeginCreateOrUpdate(req) - case "BuildersClient.BeginDelete": - resp, err = b.dispatchBeginDelete(req) - case "BuildersClient.Get": - resp, err = b.dispatchGet(req) - case "BuildersClient.NewListByResourceGroupPager": - resp, err = b.dispatchNewListByResourceGroupPager(req) - case "BuildersClient.NewListBySubscriptionPager": - resp, err = b.dispatchNewListBySubscriptionPager(req) - case "BuildersClient.BeginUpdate": - resp, err = b.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (b *BuildersServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if b.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := b.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/builders/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.BuilderResource](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - builderNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("builderName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, builderNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - b.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - b.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - b.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (b *BuildersServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if b.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := b.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/builders/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - builderNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("builderName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginDelete(req.Context(), resourceGroupNameParam, builderNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - b.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) { - b.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) { - b.beginDelete.remove(req) - } - - return resp, nil -} - -func (b *BuildersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if b.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/builders/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - builderNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("builderName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.Get(req.Context(), resourceGroupNameParam, builderNameParam, 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).BuilderResource, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (b *BuildersServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { - if b.srv.NewListByResourceGroupPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} - } - newListByResourceGroupPager := b.newListByResourceGroupPager.get(req) - if newListByResourceGroupPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/builders` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resp := b.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) - newListByResourceGroupPager = &resp - b.newListByResourceGroupPager.add(req, newListByResourceGroupPager) - server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armappcontainers.BuildersClientListByResourceGroupResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - b.newListByResourceGroupPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByResourceGroupPager) { - b.newListByResourceGroupPager.remove(req) - } - return resp, nil -} - -func (b *BuildersServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { - if b.srv.NewListBySubscriptionPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} - } - newListBySubscriptionPager := b.newListBySubscriptionPager.get(req) - if newListBySubscriptionPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/builders` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resp := b.srv.NewListBySubscriptionPager(nil) - newListBySubscriptionPager = &resp - b.newListBySubscriptionPager.add(req, newListBySubscriptionPager) - server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armappcontainers.BuildersClientListBySubscriptionResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - b.newListBySubscriptionPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListBySubscriptionPager) { - b.newListBySubscriptionPager.remove(req) - } - return resp, nil -} - -func (b *BuildersServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if b.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := b.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/builders/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.BuilderResourceUpdate](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - builderNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("builderName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginUpdate(req.Context(), resourceGroupNameParam, builderNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - b.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - b.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - b.beginUpdate.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/builds_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/builds_server.go deleted file mode 100644 index ca8cf5a38458..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/builds_server.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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// BuildsServer is a fake server for instances of the armappcontainers.BuildsClient type. -type BuildsServer struct { - // BeginCreateOrUpdate is the fake for method BuildsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, builderName string, buildName string, buildEnvelope armappcontainers.BuildResource, options *armappcontainers.BuildsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armappcontainers.BuildsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method BuildsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, builderName string, buildName string, options *armappcontainers.BuildsClientBeginDeleteOptions) (resp azfake.PollerResponder[armappcontainers.BuildsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method BuildsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, builderName string, buildName string, options *armappcontainers.BuildsClientGetOptions) (resp azfake.Responder[armappcontainers.BuildsClientGetResponse], errResp azfake.ErrorResponder) -} - -// NewBuildsServerTransport creates a new instance of BuildsServerTransport with the provided implementation. -// The returned BuildsServerTransport instance is connected to an instance of armappcontainers.BuildsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewBuildsServerTransport(srv *BuildsServer) *BuildsServerTransport { - return &BuildsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappcontainers.BuildsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armappcontainers.BuildsClientDeleteResponse]](), - } -} - -// BuildsServerTransport connects instances of armappcontainers.BuildsClient to instances of BuildsServer. -// Don't use this type directly, use NewBuildsServerTransport instead. -type BuildsServerTransport struct { - srv *BuildsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armappcontainers.BuildsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armappcontainers.BuildsClientDeleteResponse]] -} - -// Do implements the policy.Transporter interface for BuildsServerTransport. -func (b *BuildsServerTransport) 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 "BuildsClient.BeginCreateOrUpdate": - resp, err = b.dispatchBeginCreateOrUpdate(req) - case "BuildsClient.BeginDelete": - resp, err = b.dispatchBeginDelete(req) - case "BuildsClient.Get": - resp, err = b.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (b *BuildsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if b.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := b.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/builders/(?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) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.BuildResource](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - builderNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("builderName")]) - if err != nil { - return nil, err - } - buildNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("buildName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, builderNameParam, buildNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - b.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - b.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - b.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (b *BuildsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if b.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := b.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/builders/(?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 - } - builderNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("builderName")]) - if err != nil { - return nil, err - } - buildNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("buildName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginDelete(req.Context(), resourceGroupNameParam, builderNameParam, buildNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - b.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) { - b.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) { - b.beginDelete.remove(req) - } - - return resp, nil -} - -func (b *BuildsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if b.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/builders/(?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 - } - builderNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("builderName")]) - if err != nil { - return nil, err - } - buildNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("buildName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.Get(req.Context(), resourceGroupNameParam, builderNameParam, 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).BuildResource, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/buildsbybuilderresource_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/buildsbybuilderresource_server.go deleted file mode 100644 index abe6a8fd072d..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/buildsbybuilderresource_server.go +++ /dev/null @@ -1,113 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// BuildsByBuilderResourceServer is a fake server for instances of the armappcontainers.BuildsByBuilderResourceClient type. -type BuildsByBuilderResourceServer struct { - // NewListPager is the fake for method BuildsByBuilderResourceClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, builderName string, options *armappcontainers.BuildsByBuilderResourceClientListOptions) (resp azfake.PagerResponder[armappcontainers.BuildsByBuilderResourceClientListResponse]) -} - -// NewBuildsByBuilderResourceServerTransport creates a new instance of BuildsByBuilderResourceServerTransport with the provided implementation. -// The returned BuildsByBuilderResourceServerTransport instance is connected to an instance of armappcontainers.BuildsByBuilderResourceClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewBuildsByBuilderResourceServerTransport(srv *BuildsByBuilderResourceServer) *BuildsByBuilderResourceServerTransport { - return &BuildsByBuilderResourceServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armappcontainers.BuildsByBuilderResourceClientListResponse]](), - } -} - -// BuildsByBuilderResourceServerTransport connects instances of armappcontainers.BuildsByBuilderResourceClient to instances of BuildsByBuilderResourceServer. -// Don't use this type directly, use NewBuildsByBuilderResourceServerTransport instead. -type BuildsByBuilderResourceServerTransport struct { - srv *BuildsByBuilderResourceServer - newListPager *tracker[azfake.PagerResponder[armappcontainers.BuildsByBuilderResourceClientListResponse]] -} - -// Do implements the policy.Transporter interface for BuildsByBuilderResourceServerTransport. -func (b *BuildsByBuilderResourceServerTransport) 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 "BuildsByBuilderResourceClient.NewListPager": - resp, err = b.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (b *BuildsByBuilderResourceServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if b.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := b.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/builders/(?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 - } - builderNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("builderName")]) - if err != nil { - return nil, err - } - resp := b.srv.NewListPager(resourceGroupNameParam, builderNameParam, nil) - newListPager = &resp - b.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armappcontainers.BuildsByBuilderResourceClientListResponse, 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) { - b.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - b.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/certificates_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/certificates_server.go index 3ca540fff52d..bf03f93f8f88 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/certificates_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/certificates_server.go @@ -12,16 +12,15 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "reflect" - "regexp" - 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" + "reflect" + "regexp" ) // CertificatesServer is a fake server for instances of the armappcontainers.CertificatesClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironments_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironments_server.go index 3502eb18a3d4..0373828e415a 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironments_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironments_server.go @@ -12,15 +12,14 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ConnectedEnvironmentsServer is a fake server for instances of the armappcontainers.ConnectedEnvironmentsClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentscertificates_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentscertificates_server.go index 8d6c858ff015..4c48815fd50c 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentscertificates_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentscertificates_server.go @@ -12,16 +12,15 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "reflect" - "regexp" - 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" + "reflect" + "regexp" ) // ConnectedEnvironmentsCertificatesServer is a fake server for instances of the armappcontainers.ConnectedEnvironmentsCertificatesClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsdaprcomponents_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsdaprcomponents_server.go index 26fa054b179f..109760712e09 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsdaprcomponents_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsdaprcomponents_server.go @@ -12,15 +12,14 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ConnectedEnvironmentsDaprComponentsServer is a fake server for instances of the armappcontainers.ConnectedEnvironmentsDaprComponentsClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsstorages_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsstorages_server.go index 87a61a5c2952..0a4c9802a3f7 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsstorages_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsstorages_server.go @@ -12,14 +12,13 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ConnectedEnvironmentsStoragesServer is a fake server for instances of the armappcontainers.ConnectedEnvironmentsStoragesClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerapps_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerapps_server.go index 66764ff84795..dce2e07f26c2 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerapps_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerapps_server.go @@ -12,15 +12,14 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ContainerAppsServer is a fake server for instances of the armappcontainers.ContainerAppsClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsapi_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsapi_server.go index 84cf870fcb4f..43d56f17d794 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsapi_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsapi_server.go @@ -12,14 +12,13 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ContainerAppsAPIServer is a fake server for instances of the armappcontainers.ContainerAppsAPIClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsauthconfigs_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsauthconfigs_server.go index 31ff382f8d88..5eb1a3c7da0a 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsauthconfigs_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsauthconfigs_server.go @@ -12,15 +12,14 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ContainerAppsAuthConfigsServer is a fake server for instances of the armappcontainers.ContainerAppsAuthConfigsClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsbuilds_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsbuilds_server.go deleted file mode 100644 index 38f0954295ee..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsbuilds_server.go +++ /dev/null @@ -1,163 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// 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, containerAppName 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, containerAppName 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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - 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, containerAppNameParam, 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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - 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, containerAppNameParam, 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 deleted file mode 100644 index 31796dd6be77..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsbuildsbycontainerapp_server.go +++ /dev/null @@ -1,113 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// 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, containerAppName 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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - if err != nil { - return nil, err - } - resp := c.srv.NewListPager(resourceGroupNameParam, containerAppNameParam, 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/containerappsdiagnostics_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsdiagnostics_server.go index 1efe63b4eead..ed86f9954b42 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsdiagnostics_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsdiagnostics_server.go @@ -12,15 +12,14 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ContainerAppsDiagnosticsServer is a fake server for instances of the armappcontainers.ContainerAppsDiagnosticsClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappspatches_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappspatches_server.go deleted file mode 100644 index 18be3208ac09..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappspatches_server.go +++ /dev/null @@ -1,341 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// 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, containerAppName 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, containerAppName 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, containerAppName 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, containerAppName 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, containerAppName 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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - 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, containerAppNameParam, 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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - 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, containerAppNameParam, 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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - 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, containerAppNameParam, 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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - 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, containerAppNameParam, 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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - 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, containerAppNameParam, 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/containerappsrevisionreplicas_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisionreplicas_server.go index f088fef363f2..e717e5f1feb2 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisionreplicas_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisionreplicas_server.go @@ -12,14 +12,13 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ContainerAppsRevisionReplicasServer is a fake server for instances of the armappcontainers.ContainerAppsRevisionReplicasClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisions_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisions_server.go index 25666dad3ace..c067b284ec98 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisions_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisions_server.go @@ -12,15 +12,14 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ContainerAppsRevisionsServer is a fake server for instances of the armappcontainers.ContainerAppsRevisionsClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssessionpools_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssessionpools_server.go deleted file mode 100644 index c69f07f68dae..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssessionpools_server.go +++ /dev/null @@ -1,354 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// ContainerAppsSessionPoolsServer is a fake server for instances of the armappcontainers.ContainerAppsSessionPoolsClient type. -type ContainerAppsSessionPoolsServer struct { - // BeginCreateOrUpdate is the fake for method ContainerAppsSessionPoolsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, sessionPoolName string, sessionPoolEnvelope armappcontainers.SessionPool, options *armappcontainers.ContainerAppsSessionPoolsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armappcontainers.ContainerAppsSessionPoolsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method ContainerAppsSessionPoolsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, sessionPoolName string, options *armappcontainers.ContainerAppsSessionPoolsClientBeginDeleteOptions) (resp azfake.PollerResponder[armappcontainers.ContainerAppsSessionPoolsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method ContainerAppsSessionPoolsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, sessionPoolName string, options *armappcontainers.ContainerAppsSessionPoolsClientGetOptions) (resp azfake.Responder[armappcontainers.ContainerAppsSessionPoolsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByResourceGroupPager is the fake for method ContainerAppsSessionPoolsClient.NewListByResourceGroupPager - // HTTP status codes to indicate success: http.StatusOK - NewListByResourceGroupPager func(resourceGroupName string, options *armappcontainers.ContainerAppsSessionPoolsClientListByResourceGroupOptions) (resp azfake.PagerResponder[armappcontainers.ContainerAppsSessionPoolsClientListByResourceGroupResponse]) - - // NewListBySubscriptionPager is the fake for method ContainerAppsSessionPoolsClient.NewListBySubscriptionPager - // HTTP status codes to indicate success: http.StatusOK - NewListBySubscriptionPager func(options *armappcontainers.ContainerAppsSessionPoolsClientListBySubscriptionOptions) (resp azfake.PagerResponder[armappcontainers.ContainerAppsSessionPoolsClientListBySubscriptionResponse]) - - // BeginUpdate is the fake for method ContainerAppsSessionPoolsClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceGroupName string, sessionPoolName string, sessionPoolEnvelope armappcontainers.SessionPoolUpdatableProperties, options *armappcontainers.ContainerAppsSessionPoolsClientBeginUpdateOptions) (resp azfake.PollerResponder[armappcontainers.ContainerAppsSessionPoolsClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewContainerAppsSessionPoolsServerTransport creates a new instance of ContainerAppsSessionPoolsServerTransport with the provided implementation. -// The returned ContainerAppsSessionPoolsServerTransport instance is connected to an instance of armappcontainers.ContainerAppsSessionPoolsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewContainerAppsSessionPoolsServerTransport(srv *ContainerAppsSessionPoolsServer) *ContainerAppsSessionPoolsServerTransport { - return &ContainerAppsSessionPoolsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappcontainers.ContainerAppsSessionPoolsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armappcontainers.ContainerAppsSessionPoolsClientDeleteResponse]](), - newListByResourceGroupPager: newTracker[azfake.PagerResponder[armappcontainers.ContainerAppsSessionPoolsClientListByResourceGroupResponse]](), - newListBySubscriptionPager: newTracker[azfake.PagerResponder[armappcontainers.ContainerAppsSessionPoolsClientListBySubscriptionResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armappcontainers.ContainerAppsSessionPoolsClientUpdateResponse]](), - } -} - -// ContainerAppsSessionPoolsServerTransport connects instances of armappcontainers.ContainerAppsSessionPoolsClient to instances of ContainerAppsSessionPoolsServer. -// Don't use this type directly, use NewContainerAppsSessionPoolsServerTransport instead. -type ContainerAppsSessionPoolsServerTransport struct { - srv *ContainerAppsSessionPoolsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armappcontainers.ContainerAppsSessionPoolsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armappcontainers.ContainerAppsSessionPoolsClientDeleteResponse]] - newListByResourceGroupPager *tracker[azfake.PagerResponder[armappcontainers.ContainerAppsSessionPoolsClientListByResourceGroupResponse]] - newListBySubscriptionPager *tracker[azfake.PagerResponder[armappcontainers.ContainerAppsSessionPoolsClientListBySubscriptionResponse]] - beginUpdate *tracker[azfake.PollerResponder[armappcontainers.ContainerAppsSessionPoolsClientUpdateResponse]] -} - -// Do implements the policy.Transporter interface for ContainerAppsSessionPoolsServerTransport. -func (c *ContainerAppsSessionPoolsServerTransport) 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 "ContainerAppsSessionPoolsClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "ContainerAppsSessionPoolsClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "ContainerAppsSessionPoolsClient.Get": - resp, err = c.dispatchGet(req) - case "ContainerAppsSessionPoolsClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "ContainerAppsSessionPoolsClient.NewListBySubscriptionPager": - resp, err = c.dispatchNewListBySubscriptionPager(req) - case "ContainerAppsSessionPoolsClient.BeginUpdate": - resp, err = c.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (c *ContainerAppsSessionPoolsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if c.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := c.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/sessionPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.SessionPool](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - sessionPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sessionPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, sessionPoolNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - c.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - c.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - c.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (c *ContainerAppsSessionPoolsServerTransport) 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/sessionPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - sessionPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sessionPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginDelete(req.Context(), resourceGroupNameParam, sessionPoolNameParam, 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 *ContainerAppsSessionPoolsServerTransport) 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/sessionPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - sessionPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sessionPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, sessionPoolNameParam, 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).SessionPool, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (c *ContainerAppsSessionPoolsServerTransport) dispatchNewListByResourceGroupPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListByResourceGroupPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} - } - newListByResourceGroupPager := c.newListByResourceGroupPager.get(req) - if newListByResourceGroupPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/sessionPools` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resp := c.srv.NewListByResourceGroupPager(resourceGroupNameParam, nil) - newListByResourceGroupPager = &resp - c.newListByResourceGroupPager.add(req, newListByResourceGroupPager) - server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armappcontainers.ContainerAppsSessionPoolsClientListByResourceGroupResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListByResourceGroupPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByResourceGroupPager) { - c.newListByResourceGroupPager.remove(req) - } - return resp, nil -} - -func (c *ContainerAppsSessionPoolsServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { - if c.srv.NewListBySubscriptionPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} - } - newListBySubscriptionPager := c.newListBySubscriptionPager.get(req) - if newListBySubscriptionPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/sessionPools` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resp := c.srv.NewListBySubscriptionPager(nil) - newListBySubscriptionPager = &resp - c.newListBySubscriptionPager.add(req, newListBySubscriptionPager) - server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armappcontainers.ContainerAppsSessionPoolsClientListBySubscriptionResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - c.newListBySubscriptionPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListBySubscriptionPager) { - c.newListBySubscriptionPager.remove(req) - } - return resp, nil -} - -func (c *ContainerAppsSessionPoolsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if c.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := c.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/sessionPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.SessionPoolUpdatableProperties](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - sessionPoolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("sessionPoolName")]) - if err != nil { - return nil, err - } - respr, errRespr := c.srv.BeginUpdate(req.Context(), resourceGroupNameParam, sessionPoolNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - c.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - c.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - c.beginUpdate.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssourcecontrols_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssourcecontrols_server.go index 4befa944532d..5d7a6ad7211b 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssourcecontrols_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssourcecontrols_server.go @@ -12,16 +12,14 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - "strconv" - 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" ) // ContainerAppsSourceControlsServer is a fake server for instances of the armappcontainers.ContainerAppsSourceControlsClient type. @@ -123,14 +121,7 @@ func (c *ContainerAppsSourceControlsServerTransport) dispatchBeginCreateOrUpdate if err != nil { return nil, err } - xMSGithubAuxiliaryParam := getOptional(getHeaderValue(req.Header, "x-ms-github-auxiliary")) - var options *armappcontainers.ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions - if xMSGithubAuxiliaryParam != nil { - options = &armappcontainers.ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions{ - XMSGithubAuxiliary: xMSGithubAuxiliaryParam, - } - } - respr, errRespr := c.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, containerAppNameParam, sourceControlNameParam, body, options) + respr, errRespr := c.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, containerAppNameParam, sourceControlNameParam, body, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } @@ -166,7 +157,6 @@ func (c *ContainerAppsSourceControlsServerTransport) dispatchBeginDelete(req *ht if matches == nil || len(matches) < 4 { 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 @@ -179,32 +169,7 @@ func (c *ContainerAppsSourceControlsServerTransport) dispatchBeginDelete(req *ht if err != nil { return nil, err } - xMSGithubAuxiliaryParam := getOptional(getHeaderValue(req.Header, "x-ms-github-auxiliary")) - ignoreWorkflowDeletionFailureUnescaped, err := url.QueryUnescape(qp.Get("ignoreWorkflowDeletionFailure")) - if err != nil { - return nil, err - } - ignoreWorkflowDeletionFailureParam, err := parseOptional(ignoreWorkflowDeletionFailureUnescaped, strconv.ParseBool) - if err != nil { - return nil, err - } - deleteWorkflowUnescaped, err := url.QueryUnescape(qp.Get("deleteWorkflow")) - if err != nil { - return nil, err - } - deleteWorkflowParam, err := parseOptional(deleteWorkflowUnescaped, strconv.ParseBool) - if err != nil { - return nil, err - } - var options *armappcontainers.ContainerAppsSourceControlsClientBeginDeleteOptions - if xMSGithubAuxiliaryParam != nil || ignoreWorkflowDeletionFailureParam != nil || deleteWorkflowParam != nil { - options = &armappcontainers.ContainerAppsSourceControlsClientBeginDeleteOptions{ - XMSGithubAuxiliary: xMSGithubAuxiliaryParam, - IgnoreWorkflowDeletionFailure: ignoreWorkflowDeletionFailureParam, - DeleteWorkflow: deleteWorkflowParam, - } - } - respr, errRespr := c.srv.BeginDelete(req.Context(), resourceGroupNameParam, containerAppNameParam, sourceControlNameParam, options) + respr, errRespr := c.srv.BeginDelete(req.Context(), resourceGroupNameParam, containerAppNameParam, sourceControlNameParam, nil) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/daprcomponentresiliencypolicies_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/daprcomponentresiliencypolicies_server.go deleted file mode 100644 index abadab5a86c5..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/daprcomponentresiliencypolicies_server.go +++ /dev/null @@ -1,263 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// DaprComponentResiliencyPoliciesServer is a fake server for instances of the armappcontainers.DaprComponentResiliencyPoliciesClient type. -type DaprComponentResiliencyPoliciesServer struct { - // CreateOrUpdate is the fake for method DaprComponentResiliencyPoliciesClient.CreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - CreateOrUpdate func(ctx context.Context, resourceGroupName string, environmentName string, componentName string, name string, daprComponentResiliencyPolicyEnvelope armappcontainers.DaprComponentResiliencyPolicy, options *armappcontainers.DaprComponentResiliencyPoliciesClientCreateOrUpdateOptions) (resp azfake.Responder[armappcontainers.DaprComponentResiliencyPoliciesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // Delete is the fake for method DaprComponentResiliencyPoliciesClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, resourceGroupName string, environmentName string, componentName string, name string, options *armappcontainers.DaprComponentResiliencyPoliciesClientDeleteOptions) (resp azfake.Responder[armappcontainers.DaprComponentResiliencyPoliciesClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method DaprComponentResiliencyPoliciesClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, environmentName string, componentName string, name string, options *armappcontainers.DaprComponentResiliencyPoliciesClientGetOptions) (resp azfake.Responder[armappcontainers.DaprComponentResiliencyPoliciesClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method DaprComponentResiliencyPoliciesClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, environmentName string, componentName string, options *armappcontainers.DaprComponentResiliencyPoliciesClientListOptions) (resp azfake.PagerResponder[armappcontainers.DaprComponentResiliencyPoliciesClientListResponse]) -} - -// NewDaprComponentResiliencyPoliciesServerTransport creates a new instance of DaprComponentResiliencyPoliciesServerTransport with the provided implementation. -// The returned DaprComponentResiliencyPoliciesServerTransport instance is connected to an instance of armappcontainers.DaprComponentResiliencyPoliciesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewDaprComponentResiliencyPoliciesServerTransport(srv *DaprComponentResiliencyPoliciesServer) *DaprComponentResiliencyPoliciesServerTransport { - return &DaprComponentResiliencyPoliciesServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armappcontainers.DaprComponentResiliencyPoliciesClientListResponse]](), - } -} - -// DaprComponentResiliencyPoliciesServerTransport connects instances of armappcontainers.DaprComponentResiliencyPoliciesClient to instances of DaprComponentResiliencyPoliciesServer. -// Don't use this type directly, use NewDaprComponentResiliencyPoliciesServerTransport instead. -type DaprComponentResiliencyPoliciesServerTransport struct { - srv *DaprComponentResiliencyPoliciesServer - newListPager *tracker[azfake.PagerResponder[armappcontainers.DaprComponentResiliencyPoliciesClientListResponse]] -} - -// Do implements the policy.Transporter interface for DaprComponentResiliencyPoliciesServerTransport. -func (d *DaprComponentResiliencyPoliciesServerTransport) 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 "DaprComponentResiliencyPoliciesClient.CreateOrUpdate": - resp, err = d.dispatchCreateOrUpdate(req) - case "DaprComponentResiliencyPoliciesClient.Delete": - resp, err = d.dispatchDelete(req) - case "DaprComponentResiliencyPoliciesClient.Get": - resp, err = d.dispatchGet(req) - case "DaprComponentResiliencyPoliciesClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (d *DaprComponentResiliencyPoliciesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { - if d.srv.CreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/daprComponents/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resiliencyPolicies/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - 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) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.DaprComponentResiliencyPolicy](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - componentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("componentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, environmentNameParam, componentNameParam, nameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DaprComponentResiliencyPolicy, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (d *DaprComponentResiliencyPoliciesServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if d.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/daprComponents/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resiliencyPolicies/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - 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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - componentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("componentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.Delete(req.Context(), resourceGroupNameParam, environmentNameParam, componentNameParam, nameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (d *DaprComponentResiliencyPoliciesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if d.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/daprComponents/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resiliencyPolicies/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - 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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - componentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("componentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, environmentNameParam, componentNameParam, nameParam, 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).DaprComponentResiliencyPolicy, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (d *DaprComponentResiliencyPoliciesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if d.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := d.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/daprComponents/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resiliencyPolicies` - 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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - componentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("componentName")]) - if err != nil { - return nil, err - } - resp := d.srv.NewListPager(resourceGroupNameParam, environmentNameParam, componentNameParam, nil) - newListPager = &resp - d.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armappcontainers.DaprComponentResiliencyPoliciesClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - d.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - d.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/daprcomponents_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/daprcomponents_server.go index 7770e429b7bb..1ac347b26dcd 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/daprcomponents_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/daprcomponents_server.go @@ -12,15 +12,14 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // DaprComponentsServer is a fake server for instances of the armappcontainers.DaprComponentsClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/daprsubscriptions_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/daprsubscriptions_server.go deleted file mode 100644 index 81f4ffa6389d..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/daprsubscriptions_server.go +++ /dev/null @@ -1,247 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// DaprSubscriptionsServer is a fake server for instances of the armappcontainers.DaprSubscriptionsClient type. -type DaprSubscriptionsServer struct { - // CreateOrUpdate is the fake for method DaprSubscriptionsClient.CreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - CreateOrUpdate func(ctx context.Context, resourceGroupName string, environmentName string, name string, daprSubscriptionEnvelope armappcontainers.DaprSubscription, options *armappcontainers.DaprSubscriptionsClientCreateOrUpdateOptions) (resp azfake.Responder[armappcontainers.DaprSubscriptionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // Delete is the fake for method DaprSubscriptionsClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, resourceGroupName string, environmentName string, name string, options *armappcontainers.DaprSubscriptionsClientDeleteOptions) (resp azfake.Responder[armappcontainers.DaprSubscriptionsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method DaprSubscriptionsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, environmentName string, name string, options *armappcontainers.DaprSubscriptionsClientGetOptions) (resp azfake.Responder[armappcontainers.DaprSubscriptionsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method DaprSubscriptionsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, environmentName string, options *armappcontainers.DaprSubscriptionsClientListOptions) (resp azfake.PagerResponder[armappcontainers.DaprSubscriptionsClientListResponse]) -} - -// NewDaprSubscriptionsServerTransport creates a new instance of DaprSubscriptionsServerTransport with the provided implementation. -// The returned DaprSubscriptionsServerTransport instance is connected to an instance of armappcontainers.DaprSubscriptionsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewDaprSubscriptionsServerTransport(srv *DaprSubscriptionsServer) *DaprSubscriptionsServerTransport { - return &DaprSubscriptionsServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armappcontainers.DaprSubscriptionsClientListResponse]](), - } -} - -// DaprSubscriptionsServerTransport connects instances of armappcontainers.DaprSubscriptionsClient to instances of DaprSubscriptionsServer. -// Don't use this type directly, use NewDaprSubscriptionsServerTransport instead. -type DaprSubscriptionsServerTransport struct { - srv *DaprSubscriptionsServer - newListPager *tracker[azfake.PagerResponder[armappcontainers.DaprSubscriptionsClientListResponse]] -} - -// Do implements the policy.Transporter interface for DaprSubscriptionsServerTransport. -func (d *DaprSubscriptionsServerTransport) 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 "DaprSubscriptionsClient.CreateOrUpdate": - resp, err = d.dispatchCreateOrUpdate(req) - case "DaprSubscriptionsClient.Delete": - resp, err = d.dispatchDelete(req) - case "DaprSubscriptionsClient.Get": - resp, err = d.dispatchGet(req) - case "DaprSubscriptionsClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (d *DaprSubscriptionsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { - if d.srv.CreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/daprSubscriptions/(?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) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.DaprSubscription](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, environmentNameParam, nameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).DaprSubscription, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (d *DaprSubscriptionsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if d.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/daprSubscriptions/(?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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.Delete(req.Context(), resourceGroupNameParam, environmentNameParam, nameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (d *DaprSubscriptionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if d.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/daprSubscriptions/(?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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, environmentNameParam, nameParam, 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).DaprSubscription, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (d *DaprSubscriptionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if d.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := d.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/daprSubscriptions` - 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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - resp := d.srv.NewListPager(resourceGroupNameParam, environmentNameParam, nil) - newListPager = &resp - d.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armappcontainers.DaprSubscriptionsClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - d.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - d.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/dotnetcomponents_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/dotnetcomponents_server.go deleted file mode 100644 index eb3a6cb617c2..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/dotnetcomponents_server.go +++ /dev/null @@ -1,333 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// DotNetComponentsServer is a fake server for instances of the armappcontainers.DotNetComponentsClient type. -type DotNetComponentsServer struct { - // BeginCreateOrUpdate is the fake for method DotNetComponentsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, environmentName string, name string, dotNetComponentEnvelope armappcontainers.DotNetComponent, options *armappcontainers.DotNetComponentsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armappcontainers.DotNetComponentsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method DotNetComponentsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, environmentName string, name string, options *armappcontainers.DotNetComponentsClientBeginDeleteOptions) (resp azfake.PollerResponder[armappcontainers.DotNetComponentsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method DotNetComponentsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, environmentName string, name string, options *armappcontainers.DotNetComponentsClientGetOptions) (resp azfake.Responder[armappcontainers.DotNetComponentsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method DotNetComponentsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, environmentName string, options *armappcontainers.DotNetComponentsClientListOptions) (resp azfake.PagerResponder[armappcontainers.DotNetComponentsClientListResponse]) - - // BeginUpdate is the fake for method DotNetComponentsClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceGroupName string, environmentName string, name string, dotNetComponentEnvelope armappcontainers.DotNetComponent, options *armappcontainers.DotNetComponentsClientBeginUpdateOptions) (resp azfake.PollerResponder[armappcontainers.DotNetComponentsClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewDotNetComponentsServerTransport creates a new instance of DotNetComponentsServerTransport with the provided implementation. -// The returned DotNetComponentsServerTransport instance is connected to an instance of armappcontainers.DotNetComponentsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewDotNetComponentsServerTransport(srv *DotNetComponentsServer) *DotNetComponentsServerTransport { - return &DotNetComponentsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappcontainers.DotNetComponentsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armappcontainers.DotNetComponentsClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armappcontainers.DotNetComponentsClientListResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armappcontainers.DotNetComponentsClientUpdateResponse]](), - } -} - -// DotNetComponentsServerTransport connects instances of armappcontainers.DotNetComponentsClient to instances of DotNetComponentsServer. -// Don't use this type directly, use NewDotNetComponentsServerTransport instead. -type DotNetComponentsServerTransport struct { - srv *DotNetComponentsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armappcontainers.DotNetComponentsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armappcontainers.DotNetComponentsClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armappcontainers.DotNetComponentsClientListResponse]] - beginUpdate *tracker[azfake.PollerResponder[armappcontainers.DotNetComponentsClientUpdateResponse]] -} - -// Do implements the policy.Transporter interface for DotNetComponentsServerTransport. -func (d *DotNetComponentsServerTransport) 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 "DotNetComponentsClient.BeginCreateOrUpdate": - resp, err = d.dispatchBeginCreateOrUpdate(req) - case "DotNetComponentsClient.BeginDelete": - resp, err = d.dispatchBeginDelete(req) - case "DotNetComponentsClient.Get": - resp, err = d.dispatchGet(req) - case "DotNetComponentsClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - case "DotNetComponentsClient.BeginUpdate": - resp, err = d.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (d *DotNetComponentsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if d.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := d.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dotNetComponents/(?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) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.DotNetComponent](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, environmentNameParam, nameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - d.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - d.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - d.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (d *DotNetComponentsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if d.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := d.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dotNetComponents/(?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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.BeginDelete(req.Context(), resourceGroupNameParam, environmentNameParam, nameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - d.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) { - d.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) { - d.beginDelete.remove(req) - } - - return resp, nil -} - -func (d *DotNetComponentsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if d.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dotNetComponents/(?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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.Get(req.Context(), resourceGroupNameParam, environmentNameParam, nameParam, 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).DotNetComponent, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (d *DotNetComponentsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if d.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := d.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dotNetComponents` - 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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - resp := d.srv.NewListPager(resourceGroupNameParam, environmentNameParam, nil) - newListPager = &resp - d.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armappcontainers.DotNetComponentsClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - d.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - d.newListPager.remove(req) - } - return resp, nil -} - -func (d *DotNetComponentsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if d.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := d.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/dotNetComponents/(?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) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.DotNetComponent](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := d.srv.BeginUpdate(req.Context(), resourceGroupNameParam, environmentNameParam, nameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - d.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - d.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - d.beginUpdate.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 deleted file mode 100644 index 2074b89e16eb..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/functionsextension_server.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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// 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/internal.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/internal.go index c423f69a92d1..94e060e89dbd 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/internal.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/internal.go @@ -9,11 +9,10 @@ package fake import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "net/http" "reflect" "sync" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" ) type nonRetriableError struct { @@ -33,14 +32,6 @@ func contains[T comparable](s []T, v T) bool { return false } -func getHeaderValue(h http.Header, k string) string { - v := h[k] - if len(v) == 0 { - return "" - } - return v[0] -} - func getOptional[T any](v T) *T { if reflect.ValueOf(v).IsZero() { return nil @@ -48,17 +39,6 @@ func getOptional[T any](v T) *T { return &v } -func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) { - if v == "" { - return nil, nil - } - t, err := parse(v) - if err != nil { - return nil, err - } - return &t, err -} - func newTracker[T any]() *tracker[T] { return &tracker[T]{ items: map[string]*T{}, diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/javacomponents_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/javacomponents_server.go deleted file mode 100644 index fe84627587a3..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/javacomponents_server.go +++ /dev/null @@ -1,333 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// JavaComponentsServer is a fake server for instances of the armappcontainers.JavaComponentsClient type. -type JavaComponentsServer struct { - // BeginCreateOrUpdate is the fake for method JavaComponentsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, environmentName string, name string, javaComponentEnvelope armappcontainers.JavaComponent, options *armappcontainers.JavaComponentsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armappcontainers.JavaComponentsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method JavaComponentsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, environmentName string, name string, options *armappcontainers.JavaComponentsClientBeginDeleteOptions) (resp azfake.PollerResponder[armappcontainers.JavaComponentsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method JavaComponentsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, environmentName string, name string, options *armappcontainers.JavaComponentsClientGetOptions) (resp azfake.Responder[armappcontainers.JavaComponentsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method JavaComponentsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, environmentName string, options *armappcontainers.JavaComponentsClientListOptions) (resp azfake.PagerResponder[armappcontainers.JavaComponentsClientListResponse]) - - // BeginUpdate is the fake for method JavaComponentsClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceGroupName string, environmentName string, name string, javaComponentEnvelope armappcontainers.JavaComponent, options *armappcontainers.JavaComponentsClientBeginUpdateOptions) (resp azfake.PollerResponder[armappcontainers.JavaComponentsClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewJavaComponentsServerTransport creates a new instance of JavaComponentsServerTransport with the provided implementation. -// The returned JavaComponentsServerTransport instance is connected to an instance of armappcontainers.JavaComponentsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewJavaComponentsServerTransport(srv *JavaComponentsServer) *JavaComponentsServerTransport { - return &JavaComponentsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappcontainers.JavaComponentsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armappcontainers.JavaComponentsClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armappcontainers.JavaComponentsClientListResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armappcontainers.JavaComponentsClientUpdateResponse]](), - } -} - -// JavaComponentsServerTransport connects instances of armappcontainers.JavaComponentsClient to instances of JavaComponentsServer. -// Don't use this type directly, use NewJavaComponentsServerTransport instead. -type JavaComponentsServerTransport struct { - srv *JavaComponentsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armappcontainers.JavaComponentsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armappcontainers.JavaComponentsClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armappcontainers.JavaComponentsClientListResponse]] - beginUpdate *tracker[azfake.PollerResponder[armappcontainers.JavaComponentsClientUpdateResponse]] -} - -// Do implements the policy.Transporter interface for JavaComponentsServerTransport. -func (j *JavaComponentsServerTransport) 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 "JavaComponentsClient.BeginCreateOrUpdate": - resp, err = j.dispatchBeginCreateOrUpdate(req) - case "JavaComponentsClient.BeginDelete": - resp, err = j.dispatchBeginDelete(req) - case "JavaComponentsClient.Get": - resp, err = j.dispatchGet(req) - case "JavaComponentsClient.NewListPager": - resp, err = j.dispatchNewListPager(req) - case "JavaComponentsClient.BeginUpdate": - resp, err = j.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (j *JavaComponentsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if j.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := j.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/javaComponents/(?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) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.JavaComponent](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := j.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, environmentNameParam, nameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - j.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - j.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - j.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (j *JavaComponentsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if j.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := j.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/javaComponents/(?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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := j.srv.BeginDelete(req.Context(), resourceGroupNameParam, environmentNameParam, nameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - j.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) { - j.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) { - j.beginDelete.remove(req) - } - - return resp, nil -} - -func (j *JavaComponentsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if j.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/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/javaComponents/(?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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := j.srv.Get(req.Context(), resourceGroupNameParam, environmentNameParam, nameParam, 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).JavaComponent, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (j *JavaComponentsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if j.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := j.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/javaComponents` - 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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - resp := j.srv.NewListPager(resourceGroupNameParam, environmentNameParam, nil) - newListPager = &resp - j.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armappcontainers.JavaComponentsClientListResponse, 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) { - j.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - j.newListPager.remove(req) - } - return resp, nil -} - -func (j *JavaComponentsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if j.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := j.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/javaComponents/(?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) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.JavaComponent](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - nameParam, err := url.PathUnescape(matches[regex.SubexpIndex("name")]) - if err != nil { - return nil, err - } - respr, errRespr := j.srv.BeginUpdate(req.Context(), resourceGroupNameParam, environmentNameParam, nameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - j.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - j.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - j.beginUpdate.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobs_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobs_server.go index 6813d1e1115c..9b6b24866098 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobs_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobs_server.go @@ -12,16 +12,15 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "reflect" - "regexp" - 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" + "reflect" + "regexp" ) // JobsServer is a fake server for instances of the armappcontainers.JobsClient type. @@ -62,10 +61,6 @@ type JobsServer struct { // HTTP status codes to indicate success: http.StatusOK ProxyGet func(ctx context.Context, resourceGroupName string, jobName string, apiName string, options *armappcontainers.JobsClientProxyGetOptions) (resp azfake.Responder[armappcontainers.JobsClientProxyGetResponse], errResp azfake.ErrorResponder) - // BeginResume is the fake for method JobsClient.BeginResume - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginResume func(ctx context.Context, resourceGroupName string, jobName string, options *armappcontainers.JobsClientBeginResumeOptions) (resp azfake.PollerResponder[armappcontainers.JobsClientResumeResponse], errResp azfake.ErrorResponder) - // BeginStart is the fake for method JobsClient.BeginStart // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginStart func(ctx context.Context, resourceGroupName string, jobName string, options *armappcontainers.JobsClientBeginStartOptions) (resp azfake.PollerResponder[armappcontainers.JobsClientStartResponse], errResp azfake.ErrorResponder) @@ -78,10 +73,6 @@ type JobsServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginStopMultipleExecutions func(ctx context.Context, resourceGroupName string, jobName string, options *armappcontainers.JobsClientBeginStopMultipleExecutionsOptions) (resp azfake.PollerResponder[armappcontainers.JobsClientStopMultipleExecutionsResponse], errResp azfake.ErrorResponder) - // BeginSuspend is the fake for method JobsClient.BeginSuspend - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginSuspend func(ctx context.Context, resourceGroupName string, jobName string, options *armappcontainers.JobsClientBeginSuspendOptions) (resp azfake.PollerResponder[armappcontainers.JobsClientSuspendResponse], errResp azfake.ErrorResponder) - // BeginUpdate is the fake for method JobsClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginUpdate func(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope armappcontainers.JobPatchProperties, options *armappcontainers.JobsClientBeginUpdateOptions) (resp azfake.PollerResponder[armappcontainers.JobsClientUpdateResponse], errResp azfake.ErrorResponder) @@ -98,11 +89,9 @@ func NewJobsServerTransport(srv *JobsServer) *JobsServerTransport { newListByResourceGroupPager: newTracker[azfake.PagerResponder[armappcontainers.JobsClientListByResourceGroupResponse]](), newListBySubscriptionPager: newTracker[azfake.PagerResponder[armappcontainers.JobsClientListBySubscriptionResponse]](), newListDetectorsPager: newTracker[azfake.PagerResponder[armappcontainers.JobsClientListDetectorsResponse]](), - beginResume: newTracker[azfake.PollerResponder[armappcontainers.JobsClientResumeResponse]](), beginStart: newTracker[azfake.PollerResponder[armappcontainers.JobsClientStartResponse]](), beginStopExecution: newTracker[azfake.PollerResponder[armappcontainers.JobsClientStopExecutionResponse]](), beginStopMultipleExecutions: newTracker[azfake.PollerResponder[armappcontainers.JobsClientStopMultipleExecutionsResponse]](), - beginSuspend: newTracker[azfake.PollerResponder[armappcontainers.JobsClientSuspendResponse]](), beginUpdate: newTracker[azfake.PollerResponder[armappcontainers.JobsClientUpdateResponse]](), } } @@ -116,11 +105,9 @@ type JobsServerTransport struct { newListByResourceGroupPager *tracker[azfake.PagerResponder[armappcontainers.JobsClientListByResourceGroupResponse]] newListBySubscriptionPager *tracker[azfake.PagerResponder[armappcontainers.JobsClientListBySubscriptionResponse]] newListDetectorsPager *tracker[azfake.PagerResponder[armappcontainers.JobsClientListDetectorsResponse]] - beginResume *tracker[azfake.PollerResponder[armappcontainers.JobsClientResumeResponse]] beginStart *tracker[azfake.PollerResponder[armappcontainers.JobsClientStartResponse]] beginStopExecution *tracker[azfake.PollerResponder[armappcontainers.JobsClientStopExecutionResponse]] beginStopMultipleExecutions *tracker[azfake.PollerResponder[armappcontainers.JobsClientStopMultipleExecutionsResponse]] - beginSuspend *tracker[azfake.PollerResponder[armappcontainers.JobsClientSuspendResponse]] beginUpdate *tracker[azfake.PollerResponder[armappcontainers.JobsClientUpdateResponse]] } @@ -154,16 +141,12 @@ func (j *JobsServerTransport) Do(req *http.Request) (*http.Response, error) { resp, err = j.dispatchListSecrets(req) case "JobsClient.ProxyGet": resp, err = j.dispatchProxyGet(req) - case "JobsClient.BeginResume": - resp, err = j.dispatchBeginResume(req) case "JobsClient.BeginStart": resp, err = j.dispatchBeginStart(req) case "JobsClient.BeginStopExecution": resp, err = j.dispatchBeginStopExecution(req) case "JobsClient.BeginStopMultipleExecutions": resp, err = j.dispatchBeginStopMultipleExecutions(req) - case "JobsClient.BeginSuspend": - resp, err = j.dispatchBeginSuspend(req) case "JobsClient.BeginUpdate": resp, err = j.dispatchBeginUpdate(req) default: @@ -520,50 +503,6 @@ func (j *JobsServerTransport) dispatchProxyGet(req *http.Request) (*http.Respons return resp, nil } -func (j *JobsServerTransport) dispatchBeginResume(req *http.Request) (*http.Response, error) { - if j.srv.BeginResume == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginResume not implemented")} - } - beginResume := j.beginResume.get(req) - if beginResume == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/jobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resume` - 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 - } - jobNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("jobName")]) - if err != nil { - return nil, err - } - respr, errRespr := j.srv.BeginResume(req.Context(), resourceGroupNameParam, jobNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginResume = &respr - j.beginResume.add(req, beginResume) - } - - resp, err := server.PollerResponderNext(beginResume, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - j.beginResume.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginResume) { - j.beginResume.remove(req) - } - - return resp, nil -} - func (j *JobsServerTransport) dispatchBeginStart(req *http.Request) (*http.Response, error) { if j.srv.BeginStart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} @@ -710,50 +649,6 @@ func (j *JobsServerTransport) dispatchBeginStopMultipleExecutions(req *http.Requ return resp, nil } -func (j *JobsServerTransport) dispatchBeginSuspend(req *http.Request) (*http.Response, error) { - if j.srv.BeginSuspend == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginSuspend not implemented")} - } - beginSuspend := j.beginSuspend.get(req) - if beginSuspend == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/jobs/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/suspend` - 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 - } - jobNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("jobName")]) - if err != nil { - return nil, err - } - respr, errRespr := j.srv.BeginSuspend(req.Context(), resourceGroupNameParam, jobNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginSuspend = &respr - j.beginSuspend.add(req, beginSuspend) - } - - resp, err := server.PollerResponderNext(beginSuspend, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - j.beginSuspend.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginSuspend) { - j.beginSuspend.remove(req) - } - - return resp, nil -} - func (j *JobsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { if j.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobsexecutions_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobsexecutions_server.go index 819baaab8e17..e93adae33317 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobsexecutions_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobsexecutions_server.go @@ -11,15 +11,14 @@ package fake import ( "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // JobsExecutionsServer is a fake server for instances of the armappcontainers.JobsExecutionsClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/logicapps_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/logicapps_server.go deleted file mode 100644 index f026494f5a8e..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/logicapps_server.go +++ /dev/null @@ -1,438 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "reflect" - "regexp" - - 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" -) - -// LogicAppsServer is a fake server for instances of the armappcontainers.LogicAppsClient type. -type LogicAppsServer struct { - // CreateOrUpdate is the fake for method LogicAppsClient.CreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - CreateOrUpdate func(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, resource armappcontainers.LogicApp, options *armappcontainers.LogicAppsClientCreateOrUpdateOptions) (resp azfake.Responder[armappcontainers.LogicAppsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // Delete is the fake for method LogicAppsClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent - Delete func(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *armappcontainers.LogicAppsClientDeleteOptions) (resp azfake.Responder[armappcontainers.LogicAppsClientDeleteResponse], errResp azfake.ErrorResponder) - - // DeployWorkflowArtifacts is the fake for method LogicAppsClient.DeployWorkflowArtifacts - // HTTP status codes to indicate success: http.StatusOK - DeployWorkflowArtifacts func(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *armappcontainers.LogicAppsClientDeployWorkflowArtifactsOptions) (resp azfake.Responder[armappcontainers.LogicAppsClientDeployWorkflowArtifactsResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method LogicAppsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *armappcontainers.LogicAppsClientGetOptions) (resp azfake.Responder[armappcontainers.LogicAppsClientGetResponse], errResp azfake.ErrorResponder) - - // GetWorkflow is the fake for method LogicAppsClient.GetWorkflow - // HTTP status codes to indicate success: http.StatusOK - GetWorkflow func(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, workflowName string, options *armappcontainers.LogicAppsClientGetWorkflowOptions) (resp azfake.Responder[armappcontainers.LogicAppsClientGetWorkflowResponse], errResp azfake.ErrorResponder) - - // Invoke is the fake for method LogicAppsClient.Invoke - // HTTP status codes to indicate success: http.StatusOK - Invoke func(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, xmsLogicAppsProxyPath string, xmsLogicAppsProxyMethod armappcontainers.LogicAppsProxyMethod, options *armappcontainers.LogicAppsClientInvokeOptions) (resp azfake.Responder[armappcontainers.LogicAppsClientInvokeResponse], errResp azfake.ErrorResponder) - - // NewListWorkflowsPager is the fake for method LogicAppsClient.NewListWorkflowsPager - // HTTP status codes to indicate success: http.StatusOK - NewListWorkflowsPager func(resourceGroupName string, containerAppName string, logicAppName string, options *armappcontainers.LogicAppsClientListWorkflowsOptions) (resp azfake.PagerResponder[armappcontainers.LogicAppsClientListWorkflowsResponse]) - - // ListWorkflowsConnections is the fake for method LogicAppsClient.ListWorkflowsConnections - // HTTP status codes to indicate success: http.StatusOK - ListWorkflowsConnections func(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *armappcontainers.LogicAppsClientListWorkflowsConnectionsOptions) (resp azfake.Responder[armappcontainers.LogicAppsClientListWorkflowsConnectionsResponse], errResp azfake.ErrorResponder) -} - -// NewLogicAppsServerTransport creates a new instance of LogicAppsServerTransport with the provided implementation. -// The returned LogicAppsServerTransport instance is connected to an instance of armappcontainers.LogicAppsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewLogicAppsServerTransport(srv *LogicAppsServer) *LogicAppsServerTransport { - return &LogicAppsServerTransport{ - srv: srv, - newListWorkflowsPager: newTracker[azfake.PagerResponder[armappcontainers.LogicAppsClientListWorkflowsResponse]](), - } -} - -// LogicAppsServerTransport connects instances of armappcontainers.LogicAppsClient to instances of LogicAppsServer. -// Don't use this type directly, use NewLogicAppsServerTransport instead. -type LogicAppsServerTransport struct { - srv *LogicAppsServer - newListWorkflowsPager *tracker[azfake.PagerResponder[armappcontainers.LogicAppsClientListWorkflowsResponse]] -} - -// Do implements the policy.Transporter interface for LogicAppsServerTransport. -func (l *LogicAppsServerTransport) 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 "LogicAppsClient.CreateOrUpdate": - resp, err = l.dispatchCreateOrUpdate(req) - case "LogicAppsClient.Delete": - resp, err = l.dispatchDelete(req) - case "LogicAppsClient.DeployWorkflowArtifacts": - resp, err = l.dispatchDeployWorkflowArtifacts(req) - case "LogicAppsClient.Get": - resp, err = l.dispatchGet(req) - case "LogicAppsClient.GetWorkflow": - resp, err = l.dispatchGetWorkflow(req) - case "LogicAppsClient.Invoke": - resp, err = l.dispatchInvoke(req) - case "LogicAppsClient.NewListWorkflowsPager": - resp, err = l.dispatchNewListWorkflowsPager(req) - case "LogicAppsClient.ListWorkflowsConnections": - resp, err = l.dispatchListWorkflowsConnections(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (l *LogicAppsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { - if l.srv.CreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate 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~%@]+)/providers/Microsoft\.App/logicApps/(?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) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.LogicApp](req) - if err != nil { - return nil, err - } - 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 - } - logicAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("logicAppName")]) - if err != nil { - return nil, err - } - respr, errRespr := l.srv.CreateOrUpdate(req.Context(), resourceGroupNameParam, containerAppNameParam, logicAppNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).LogicApp, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (l *LogicAppsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if l.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/containerApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/logicApps/(?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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - if err != nil { - return nil, err - } - logicAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("logicAppName")]) - if err != nil { - return nil, err - } - respr, errRespr := l.srv.Delete(req.Context(), resourceGroupNameParam, containerAppNameParam, logicAppNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (l *LogicAppsServerTransport) dispatchDeployWorkflowArtifacts(req *http.Request) (*http.Response, error) { - if l.srv.DeployWorkflowArtifacts == nil { - return nil, &nonRetriableError{errors.New("fake for method DeployWorkflowArtifacts 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~%@]+)/providers/Microsoft\.App/logicApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deployWorkflowArtifacts` - 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.WorkflowArtifacts](req) - if err != nil { - return nil, err - } - 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 - } - logicAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("logicAppName")]) - if err != nil { - return nil, err - } - var options *armappcontainers.LogicAppsClientDeployWorkflowArtifactsOptions - if !reflect.ValueOf(body).IsZero() { - options = &armappcontainers.LogicAppsClientDeployWorkflowArtifactsOptions{ - WorkflowArtifacts: &body, - } - } - respr, errRespr := l.srv.DeployWorkflowArtifacts(req.Context(), resourceGroupNameParam, containerAppNameParam, logicAppNameParam, options) - 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.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (l *LogicAppsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if l.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~%@]+)/providers/Microsoft\.App/logicApps/(?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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - if err != nil { - return nil, err - } - logicAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("logicAppName")]) - if err != nil { - return nil, err - } - respr, errRespr := l.srv.Get(req.Context(), resourceGroupNameParam, containerAppNameParam, logicAppNameParam, 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).LogicApp, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (l *LogicAppsServerTransport) dispatchGetWorkflow(req *http.Request) (*http.Response, error) { - if l.srv.GetWorkflow == nil { - return nil, &nonRetriableError{errors.New("fake for method GetWorkflow 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~%@]+)/providers/Microsoft\.App/logicApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/workflows/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - 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 - } - logicAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("logicAppName")]) - if err != nil { - return nil, err - } - workflowNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("workflowName")]) - if err != nil { - return nil, err - } - respr, errRespr := l.srv.GetWorkflow(req.Context(), resourceGroupNameParam, containerAppNameParam, logicAppNameParam, workflowNameParam, 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).WorkflowEnvelope, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (l *LogicAppsServerTransport) dispatchInvoke(req *http.Request) (*http.Response, error) { - if l.srv.Invoke == nil { - return nil, &nonRetriableError{errors.New("fake for method Invoke 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~%@]+)/providers/Microsoft\.App/logicApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/invoke` - 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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - if err != nil { - return nil, err - } - logicAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("logicAppName")]) - if err != nil { - return nil, err - } - respr, errRespr := l.srv.Invoke(req.Context(), resourceGroupNameParam, containerAppNameParam, logicAppNameParam, getHeaderValue(req.Header, "x-ms-logicApps-proxy-path"), armappcontainers.LogicAppsProxyMethod(getHeaderValue(req.Header, "x-ms-logicApps-proxy-method")), 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).Interface, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (l *LogicAppsServerTransport) dispatchNewListWorkflowsPager(req *http.Request) (*http.Response, error) { - if l.srv.NewListWorkflowsPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListWorkflowsPager not implemented")} - } - newListWorkflowsPager := l.newListWorkflowsPager.get(req) - if newListWorkflowsPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/containerApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/logicApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/workflows` - 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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - if err != nil { - return nil, err - } - logicAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("logicAppName")]) - if err != nil { - return nil, err - } - resp := l.srv.NewListWorkflowsPager(resourceGroupNameParam, containerAppNameParam, logicAppNameParam, nil) - newListWorkflowsPager = &resp - l.newListWorkflowsPager.add(req, newListWorkflowsPager) - server.PagerResponderInjectNextLinks(newListWorkflowsPager, req, func(page *armappcontainers.LogicAppsClientListWorkflowsResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListWorkflowsPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - l.newListWorkflowsPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListWorkflowsPager) { - l.newListWorkflowsPager.remove(req) - } - return resp, nil -} - -func (l *LogicAppsServerTransport) dispatchListWorkflowsConnections(req *http.Request) (*http.Response, error) { - if l.srv.ListWorkflowsConnections == nil { - return nil, &nonRetriableError{errors.New("fake for method ListWorkflowsConnections 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~%@]+)/providers/Microsoft\.App/logicApps/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listWorkflowsConnections` - 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 - } - containerAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerAppName")]) - if err != nil { - return nil, err - } - logicAppNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("logicAppName")]) - if err != nil { - return nil, err - } - respr, errRespr := l.srv.ListWorkflowsConnections(req.Context(), resourceGroupNameParam, containerAppNameParam, logicAppNameParam, 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).WorkflowEnvelope, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedcertificates_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedcertificates_server.go index 87c79b5e255f..75a8cf977fe5 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedcertificates_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedcertificates_server.go @@ -12,16 +12,15 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "reflect" - "regexp" - 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" + "reflect" + "regexp" ) // ManagedCertificatesServer is a fake server for instances of the armappcontainers.ManagedCertificatesClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentdiagnostics_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentdiagnostics_server.go index 416184a99668..5ba01c3597cf 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentdiagnostics_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentdiagnostics_server.go @@ -12,14 +12,13 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ManagedEnvironmentDiagnosticsServer is a fake server for instances of the armappcontainers.ManagedEnvironmentDiagnosticsClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentprivateendpointconnections_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentprivateendpointconnections_server.go deleted file mode 100644 index ba994e228567..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentprivateendpointconnections_server.go +++ /dev/null @@ -1,273 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// ManagedEnvironmentPrivateEndpointConnectionsServer is a fake server for instances of the armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClient type. -type ManagedEnvironmentPrivateEndpointConnectionsServer struct { - // BeginCreateOrUpdate is the fake for method ManagedEnvironmentPrivateEndpointConnectionsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, environmentName string, privateEndpointConnectionName string, privateEndpointConnectionEnvelope armappcontainers.PrivateEndpointConnection, options *armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method ManagedEnvironmentPrivateEndpointConnectionsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, environmentName string, privateEndpointConnectionName string, options *armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method ManagedEnvironmentPrivateEndpointConnectionsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, environmentName string, privateEndpointConnectionName string, options *armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientGetOptions) (resp azfake.Responder[armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method ManagedEnvironmentPrivateEndpointConnectionsClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, environmentName string, options *armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientListOptions) (resp azfake.PagerResponder[armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientListResponse]) -} - -// NewManagedEnvironmentPrivateEndpointConnectionsServerTransport creates a new instance of ManagedEnvironmentPrivateEndpointConnectionsServerTransport with the provided implementation. -// The returned ManagedEnvironmentPrivateEndpointConnectionsServerTransport instance is connected to an instance of armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewManagedEnvironmentPrivateEndpointConnectionsServerTransport(srv *ManagedEnvironmentPrivateEndpointConnectionsServer) *ManagedEnvironmentPrivateEndpointConnectionsServerTransport { - return &ManagedEnvironmentPrivateEndpointConnectionsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientListResponse]](), - } -} - -// ManagedEnvironmentPrivateEndpointConnectionsServerTransport connects instances of armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClient to instances of ManagedEnvironmentPrivateEndpointConnectionsServer. -// Don't use this type directly, use NewManagedEnvironmentPrivateEndpointConnectionsServerTransport instead. -type ManagedEnvironmentPrivateEndpointConnectionsServerTransport struct { - srv *ManagedEnvironmentPrivateEndpointConnectionsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientListResponse]] -} - -// Do implements the policy.Transporter interface for ManagedEnvironmentPrivateEndpointConnectionsServerTransport. -func (m *ManagedEnvironmentPrivateEndpointConnectionsServerTransport) 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 "ManagedEnvironmentPrivateEndpointConnectionsClient.BeginCreateOrUpdate": - resp, err = m.dispatchBeginCreateOrUpdate(req) - case "ManagedEnvironmentPrivateEndpointConnectionsClient.BeginDelete": - resp, err = m.dispatchBeginDelete(req) - case "ManagedEnvironmentPrivateEndpointConnectionsClient.Get": - resp, err = m.dispatchGet(req) - case "ManagedEnvironmentPrivateEndpointConnectionsClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (m *ManagedEnvironmentPrivateEndpointConnectionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if m.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := m.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?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) - } - body, err := server.UnmarshalRequestAsJSON[armappcontainers.PrivateEndpointConnection](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, environmentNameParam, privateEndpointConnectionNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - m.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - m.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - m.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (m *ManagedEnvironmentPrivateEndpointConnectionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if m.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := m.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.BeginDelete(req.Context(), resourceGroupNameParam, environmentNameParam, privateEndpointConnectionNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - m.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) { - m.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) { - m.beginDelete.remove(req) - } - - return resp, nil -} - -func (m *ManagedEnvironmentPrivateEndpointConnectionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if m.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/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - privateEndpointConnectionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("privateEndpointConnectionName")]) - if err != nil { - return nil, err - } - respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameParam, environmentNameParam, privateEndpointConnectionNameParam, 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).PrivateEndpointConnection, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (m *ManagedEnvironmentPrivateEndpointConnectionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if m.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := m.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections` - 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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - resp := m.srv.NewListPager(resourceGroupNameParam, environmentNameParam, nil) - newListPager = &resp - m.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armappcontainers.ManagedEnvironmentPrivateEndpointConnectionsClientListResponse, 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) { - m.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - m.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentprivatelinkresources_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentprivatelinkresources_server.go deleted file mode 100644 index f215c55c0d12..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentprivatelinkresources_server.go +++ /dev/null @@ -1,113 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "errors" - "fmt" - "net/http" - "net/url" - "regexp" - - 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" -) - -// ManagedEnvironmentPrivateLinkResourcesServer is a fake server for instances of the armappcontainers.ManagedEnvironmentPrivateLinkResourcesClient type. -type ManagedEnvironmentPrivateLinkResourcesServer struct { - // NewListPager is the fake for method ManagedEnvironmentPrivateLinkResourcesClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(resourceGroupName string, environmentName string, options *armappcontainers.ManagedEnvironmentPrivateLinkResourcesClientListOptions) (resp azfake.PagerResponder[armappcontainers.ManagedEnvironmentPrivateLinkResourcesClientListResponse]) -} - -// NewManagedEnvironmentPrivateLinkResourcesServerTransport creates a new instance of ManagedEnvironmentPrivateLinkResourcesServerTransport with the provided implementation. -// The returned ManagedEnvironmentPrivateLinkResourcesServerTransport instance is connected to an instance of armappcontainers.ManagedEnvironmentPrivateLinkResourcesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewManagedEnvironmentPrivateLinkResourcesServerTransport(srv *ManagedEnvironmentPrivateLinkResourcesServer) *ManagedEnvironmentPrivateLinkResourcesServerTransport { - return &ManagedEnvironmentPrivateLinkResourcesServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armappcontainers.ManagedEnvironmentPrivateLinkResourcesClientListResponse]](), - } -} - -// ManagedEnvironmentPrivateLinkResourcesServerTransport connects instances of armappcontainers.ManagedEnvironmentPrivateLinkResourcesClient to instances of ManagedEnvironmentPrivateLinkResourcesServer. -// Don't use this type directly, use NewManagedEnvironmentPrivateLinkResourcesServerTransport instead. -type ManagedEnvironmentPrivateLinkResourcesServerTransport struct { - srv *ManagedEnvironmentPrivateLinkResourcesServer - newListPager *tracker[azfake.PagerResponder[armappcontainers.ManagedEnvironmentPrivateLinkResourcesClientListResponse]] -} - -// Do implements the policy.Transporter interface for ManagedEnvironmentPrivateLinkResourcesServerTransport. -func (m *ManagedEnvironmentPrivateLinkResourcesServerTransport) 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 "ManagedEnvironmentPrivateLinkResourcesClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (m *ManagedEnvironmentPrivateLinkResourcesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if m.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := m.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.App/managedEnvironments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateLinkResources` - 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 - } - environmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("environmentName")]) - if err != nil { - return nil, err - } - resp := m.srv.NewListPager(resourceGroupNameParam, environmentNameParam, nil) - newListPager = &resp - m.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armappcontainers.ManagedEnvironmentPrivateLinkResourcesClientListResponse, 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) { - m.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - m.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironments_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironments_server.go index 9aa9d0e6e94b..086b1f1c52bb 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironments_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironments_server.go @@ -12,15 +12,14 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ManagedEnvironmentsServer is a fake server for instances of the armappcontainers.ManagedEnvironmentsClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsdiagnostics_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsdiagnostics_server.go index 00843cabb2fc..d7b2a86507a1 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsdiagnostics_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsdiagnostics_server.go @@ -12,14 +12,13 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ManagedEnvironmentsDiagnosticsServer is a fake server for instances of the armappcontainers.ManagedEnvironmentsDiagnosticsClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsstorages_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsstorages_server.go index c92629c5f94d..2324046f5f9b 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsstorages_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsstorages_server.go @@ -12,14 +12,13 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ManagedEnvironmentsStoragesServer is a fake server for instances of the armappcontainers.ManagedEnvironmentsStoragesClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentusages_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentusages_server.go index 68957de1289d..32087e3a5244 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentusages_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentusages_server.go @@ -11,15 +11,14 @@ package fake import ( "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // ManagedEnvironmentUsagesServer is a fake server for instances of the armappcontainers.ManagedEnvironmentUsagesClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/namespaces_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/namespaces_server.go index 01944a7af0fa..5dbe1ef42f85 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/namespaces_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/namespaces_server.go @@ -12,14 +12,13 @@ import ( "context" "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // NamespacesServer is a fake server for instances of the armappcontainers.NamespacesClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/operations_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/operations_server.go index 4d523d2865f0..167f397dca90 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/operations_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/operations_server.go @@ -11,13 +11,12 @@ package fake import ( "errors" "fmt" - "net/http" - 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" ) // OperationsServer is a fake server for instances of the armappcontainers.OperationsClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/server_factory.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/server_factory.go index 2dff12086ed7..b0f9b60b48cb 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/server_factory.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/server_factory.go @@ -11,58 +11,40 @@ package fake import ( "errors" "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "strings" "sync" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" ) // ServerFactory is a fake server for instances of the armappcontainers.ClientFactory type. type ServerFactory struct { - AppResiliencyServer AppResiliencyServer - AvailableWorkloadProfilesServer AvailableWorkloadProfilesServer - BillingMetersServer BillingMetersServer - BuildAuthTokenServer BuildAuthTokenServer - BuildersServer BuildersServer - BuildsByBuilderResourceServer BuildsByBuilderResourceServer - BuildsServer BuildsServer - CertificatesServer CertificatesServer - ConnectedEnvironmentsCertificatesServer ConnectedEnvironmentsCertificatesServer - ConnectedEnvironmentsServer ConnectedEnvironmentsServer - ConnectedEnvironmentsDaprComponentsServer ConnectedEnvironmentsDaprComponentsServer - ConnectedEnvironmentsStoragesServer ConnectedEnvironmentsStoragesServer - ContainerAppsAPIServer ContainerAppsAPIServer - ContainerAppsAuthConfigsServer ContainerAppsAuthConfigsServer - ContainerAppsBuildsByContainerAppServer ContainerAppsBuildsByContainerAppServer - ContainerAppsBuildsServer ContainerAppsBuildsServer - ContainerAppsServer ContainerAppsServer - ContainerAppsDiagnosticsServer ContainerAppsDiagnosticsServer - ContainerAppsPatchesServer ContainerAppsPatchesServer - ContainerAppsRevisionReplicasServer ContainerAppsRevisionReplicasServer - ContainerAppsRevisionsServer ContainerAppsRevisionsServer - ContainerAppsSessionPoolsServer ContainerAppsSessionPoolsServer - ContainerAppsSourceControlsServer ContainerAppsSourceControlsServer - DaprComponentResiliencyPoliciesServer DaprComponentResiliencyPoliciesServer - DaprComponentsServer DaprComponentsServer - DaprSubscriptionsServer DaprSubscriptionsServer - DotNetComponentsServer DotNetComponentsServer - FunctionsExtensionServer FunctionsExtensionServer - JavaComponentsServer JavaComponentsServer - JobsServer JobsServer - JobsExecutionsServer JobsExecutionsServer - LogicAppsServer LogicAppsServer - ManagedCertificatesServer ManagedCertificatesServer - ManagedEnvironmentDiagnosticsServer ManagedEnvironmentDiagnosticsServer - ManagedEnvironmentPrivateEndpointConnectionsServer ManagedEnvironmentPrivateEndpointConnectionsServer - ManagedEnvironmentPrivateLinkResourcesServer ManagedEnvironmentPrivateLinkResourcesServer - ManagedEnvironmentUsagesServer ManagedEnvironmentUsagesServer - ManagedEnvironmentsServer ManagedEnvironmentsServer - ManagedEnvironmentsDiagnosticsServer ManagedEnvironmentsDiagnosticsServer - ManagedEnvironmentsStoragesServer ManagedEnvironmentsStoragesServer - NamespacesServer NamespacesServer - OperationsServer OperationsServer - UsagesServer UsagesServer + AvailableWorkloadProfilesServer AvailableWorkloadProfilesServer + BillingMetersServer BillingMetersServer + CertificatesServer CertificatesServer + ConnectedEnvironmentsCertificatesServer ConnectedEnvironmentsCertificatesServer + ConnectedEnvironmentsServer ConnectedEnvironmentsServer + ConnectedEnvironmentsDaprComponentsServer ConnectedEnvironmentsDaprComponentsServer + ConnectedEnvironmentsStoragesServer ConnectedEnvironmentsStoragesServer + ContainerAppsAPIServer ContainerAppsAPIServer + ContainerAppsAuthConfigsServer ContainerAppsAuthConfigsServer + ContainerAppsServer ContainerAppsServer + ContainerAppsDiagnosticsServer ContainerAppsDiagnosticsServer + ContainerAppsRevisionReplicasServer ContainerAppsRevisionReplicasServer + ContainerAppsRevisionsServer ContainerAppsRevisionsServer + ContainerAppsSourceControlsServer ContainerAppsSourceControlsServer + DaprComponentsServer DaprComponentsServer + JobsServer JobsServer + JobsExecutionsServer JobsExecutionsServer + ManagedCertificatesServer ManagedCertificatesServer + ManagedEnvironmentDiagnosticsServer ManagedEnvironmentDiagnosticsServer + ManagedEnvironmentUsagesServer ManagedEnvironmentUsagesServer + ManagedEnvironmentsServer ManagedEnvironmentsServer + ManagedEnvironmentsDiagnosticsServer ManagedEnvironmentsDiagnosticsServer + ManagedEnvironmentsStoragesServer ManagedEnvironmentsStoragesServer + NamespacesServer NamespacesServer + OperationsServer OperationsServer + UsagesServer UsagesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -77,51 +59,34 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armappcontainers.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trAppResiliencyServer *AppResiliencyServerTransport - trAvailableWorkloadProfilesServer *AvailableWorkloadProfilesServerTransport - trBillingMetersServer *BillingMetersServerTransport - trBuildAuthTokenServer *BuildAuthTokenServerTransport - trBuildersServer *BuildersServerTransport - trBuildsByBuilderResourceServer *BuildsByBuilderResourceServerTransport - trBuildsServer *BuildsServerTransport - trCertificatesServer *CertificatesServerTransport - trConnectedEnvironmentsCertificatesServer *ConnectedEnvironmentsCertificatesServerTransport - trConnectedEnvironmentsServer *ConnectedEnvironmentsServerTransport - trConnectedEnvironmentsDaprComponentsServer *ConnectedEnvironmentsDaprComponentsServerTransport - trConnectedEnvironmentsStoragesServer *ConnectedEnvironmentsStoragesServerTransport - trContainerAppsAPIServer *ContainerAppsAPIServerTransport - trContainerAppsAuthConfigsServer *ContainerAppsAuthConfigsServerTransport - trContainerAppsBuildsByContainerAppServer *ContainerAppsBuildsByContainerAppServerTransport - trContainerAppsBuildsServer *ContainerAppsBuildsServerTransport - trContainerAppsServer *ContainerAppsServerTransport - trContainerAppsDiagnosticsServer *ContainerAppsDiagnosticsServerTransport - trContainerAppsPatchesServer *ContainerAppsPatchesServerTransport - trContainerAppsRevisionReplicasServer *ContainerAppsRevisionReplicasServerTransport - trContainerAppsRevisionsServer *ContainerAppsRevisionsServerTransport - trContainerAppsSessionPoolsServer *ContainerAppsSessionPoolsServerTransport - trContainerAppsSourceControlsServer *ContainerAppsSourceControlsServerTransport - trDaprComponentResiliencyPoliciesServer *DaprComponentResiliencyPoliciesServerTransport - trDaprComponentsServer *DaprComponentsServerTransport - trDaprSubscriptionsServer *DaprSubscriptionsServerTransport - trDotNetComponentsServer *DotNetComponentsServerTransport - trFunctionsExtensionServer *FunctionsExtensionServerTransport - trJavaComponentsServer *JavaComponentsServerTransport - trJobsServer *JobsServerTransport - trJobsExecutionsServer *JobsExecutionsServerTransport - trLogicAppsServer *LogicAppsServerTransport - trManagedCertificatesServer *ManagedCertificatesServerTransport - trManagedEnvironmentDiagnosticsServer *ManagedEnvironmentDiagnosticsServerTransport - trManagedEnvironmentPrivateEndpointConnectionsServer *ManagedEnvironmentPrivateEndpointConnectionsServerTransport - trManagedEnvironmentPrivateLinkResourcesServer *ManagedEnvironmentPrivateLinkResourcesServerTransport - trManagedEnvironmentUsagesServer *ManagedEnvironmentUsagesServerTransport - trManagedEnvironmentsServer *ManagedEnvironmentsServerTransport - trManagedEnvironmentsDiagnosticsServer *ManagedEnvironmentsDiagnosticsServerTransport - trManagedEnvironmentsStoragesServer *ManagedEnvironmentsStoragesServerTransport - trNamespacesServer *NamespacesServerTransport - trOperationsServer *OperationsServerTransport - trUsagesServer *UsagesServerTransport + srv *ServerFactory + trMu sync.Mutex + trAvailableWorkloadProfilesServer *AvailableWorkloadProfilesServerTransport + trBillingMetersServer *BillingMetersServerTransport + trCertificatesServer *CertificatesServerTransport + trConnectedEnvironmentsCertificatesServer *ConnectedEnvironmentsCertificatesServerTransport + trConnectedEnvironmentsServer *ConnectedEnvironmentsServerTransport + trConnectedEnvironmentsDaprComponentsServer *ConnectedEnvironmentsDaprComponentsServerTransport + trConnectedEnvironmentsStoragesServer *ConnectedEnvironmentsStoragesServerTransport + trContainerAppsAPIServer *ContainerAppsAPIServerTransport + trContainerAppsAuthConfigsServer *ContainerAppsAuthConfigsServerTransport + trContainerAppsServer *ContainerAppsServerTransport + trContainerAppsDiagnosticsServer *ContainerAppsDiagnosticsServerTransport + trContainerAppsRevisionReplicasServer *ContainerAppsRevisionReplicasServerTransport + trContainerAppsRevisionsServer *ContainerAppsRevisionsServerTransport + trContainerAppsSourceControlsServer *ContainerAppsSourceControlsServerTransport + trDaprComponentsServer *DaprComponentsServerTransport + trJobsServer *JobsServerTransport + trJobsExecutionsServer *JobsExecutionsServerTransport + trManagedCertificatesServer *ManagedCertificatesServerTransport + trManagedEnvironmentDiagnosticsServer *ManagedEnvironmentDiagnosticsServerTransport + trManagedEnvironmentUsagesServer *ManagedEnvironmentUsagesServerTransport + trManagedEnvironmentsServer *ManagedEnvironmentsServerTransport + trManagedEnvironmentsDiagnosticsServer *ManagedEnvironmentsDiagnosticsServerTransport + trManagedEnvironmentsStoragesServer *ManagedEnvironmentsStoragesServerTransport + trNamespacesServer *NamespacesServerTransport + trOperationsServer *OperationsServerTransport + trUsagesServer *UsagesServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -137,11 +102,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { var err error switch client { - case "AppResiliencyClient": - initServer(s, &s.trAppResiliencyServer, func() *AppResiliencyServerTransport { - return NewAppResiliencyServerTransport(&s.srv.AppResiliencyServer) - }) - resp, err = s.trAppResiliencyServer.Do(req) case "AvailableWorkloadProfilesClient": initServer(s, &s.trAvailableWorkloadProfilesServer, func() *AvailableWorkloadProfilesServerTransport { return NewAvailableWorkloadProfilesServerTransport(&s.srv.AvailableWorkloadProfilesServer) @@ -152,22 +112,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewBillingMetersServerTransport(&s.srv.BillingMetersServer) }) resp, err = s.trBillingMetersServer.Do(req) - case "BuildAuthTokenClient": - initServer(s, &s.trBuildAuthTokenServer, func() *BuildAuthTokenServerTransport { - return NewBuildAuthTokenServerTransport(&s.srv.BuildAuthTokenServer) - }) - resp, err = s.trBuildAuthTokenServer.Do(req) - case "BuildersClient": - initServer(s, &s.trBuildersServer, func() *BuildersServerTransport { return NewBuildersServerTransport(&s.srv.BuildersServer) }) - resp, err = s.trBuildersServer.Do(req) - case "BuildsByBuilderResourceClient": - initServer(s, &s.trBuildsByBuilderResourceServer, func() *BuildsByBuilderResourceServerTransport { - return NewBuildsByBuilderResourceServerTransport(&s.srv.BuildsByBuilderResourceServer) - }) - resp, err = s.trBuildsByBuilderResourceServer.Do(req) - case "BuildsClient": - initServer(s, &s.trBuildsServer, func() *BuildsServerTransport { return NewBuildsServerTransport(&s.srv.BuildsServer) }) - resp, err = s.trBuildsServer.Do(req) case "CertificatesClient": initServer(s, &s.trCertificatesServer, func() *CertificatesServerTransport { return NewCertificatesServerTransport(&s.srv.CertificatesServer) }) resp, err = s.trCertificatesServer.Do(req) @@ -201,16 +145,6 @@ 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) @@ -221,11 +155,6 @@ 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) @@ -236,46 +165,16 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewContainerAppsRevisionsServerTransport(&s.srv.ContainerAppsRevisionsServer) }) resp, err = s.trContainerAppsRevisionsServer.Do(req) - case "ContainerAppsSessionPoolsClient": - initServer(s, &s.trContainerAppsSessionPoolsServer, func() *ContainerAppsSessionPoolsServerTransport { - return NewContainerAppsSessionPoolsServerTransport(&s.srv.ContainerAppsSessionPoolsServer) - }) - resp, err = s.trContainerAppsSessionPoolsServer.Do(req) case "ContainerAppsSourceControlsClient": initServer(s, &s.trContainerAppsSourceControlsServer, func() *ContainerAppsSourceControlsServerTransport { return NewContainerAppsSourceControlsServerTransport(&s.srv.ContainerAppsSourceControlsServer) }) resp, err = s.trContainerAppsSourceControlsServer.Do(req) - case "DaprComponentResiliencyPoliciesClient": - initServer(s, &s.trDaprComponentResiliencyPoliciesServer, func() *DaprComponentResiliencyPoliciesServerTransport { - return NewDaprComponentResiliencyPoliciesServerTransport(&s.srv.DaprComponentResiliencyPoliciesServer) - }) - resp, err = s.trDaprComponentResiliencyPoliciesServer.Do(req) case "DaprComponentsClient": initServer(s, &s.trDaprComponentsServer, func() *DaprComponentsServerTransport { return NewDaprComponentsServerTransport(&s.srv.DaprComponentsServer) }) resp, err = s.trDaprComponentsServer.Do(req) - case "DaprSubscriptionsClient": - initServer(s, &s.trDaprSubscriptionsServer, func() *DaprSubscriptionsServerTransport { - return NewDaprSubscriptionsServerTransport(&s.srv.DaprSubscriptionsServer) - }) - resp, err = s.trDaprSubscriptionsServer.Do(req) - case "DotNetComponentsClient": - initServer(s, &s.trDotNetComponentsServer, func() *DotNetComponentsServerTransport { - 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) - }) - resp, err = s.trJavaComponentsServer.Do(req) case "JobsClient": initServer(s, &s.trJobsServer, func() *JobsServerTransport { return NewJobsServerTransport(&s.srv.JobsServer) }) resp, err = s.trJobsServer.Do(req) @@ -284,9 +183,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewJobsExecutionsServerTransport(&s.srv.JobsExecutionsServer) }) resp, err = s.trJobsExecutionsServer.Do(req) - case "LogicAppsClient": - initServer(s, &s.trLogicAppsServer, func() *LogicAppsServerTransport { return NewLogicAppsServerTransport(&s.srv.LogicAppsServer) }) - resp, err = s.trLogicAppsServer.Do(req) case "ManagedCertificatesClient": initServer(s, &s.trManagedCertificatesServer, func() *ManagedCertificatesServerTransport { return NewManagedCertificatesServerTransport(&s.srv.ManagedCertificatesServer) @@ -297,16 +193,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewManagedEnvironmentDiagnosticsServerTransport(&s.srv.ManagedEnvironmentDiagnosticsServer) }) resp, err = s.trManagedEnvironmentDiagnosticsServer.Do(req) - case "ManagedEnvironmentPrivateEndpointConnectionsClient": - initServer(s, &s.trManagedEnvironmentPrivateEndpointConnectionsServer, func() *ManagedEnvironmentPrivateEndpointConnectionsServerTransport { - return NewManagedEnvironmentPrivateEndpointConnectionsServerTransport(&s.srv.ManagedEnvironmentPrivateEndpointConnectionsServer) - }) - resp, err = s.trManagedEnvironmentPrivateEndpointConnectionsServer.Do(req) - case "ManagedEnvironmentPrivateLinkResourcesClient": - initServer(s, &s.trManagedEnvironmentPrivateLinkResourcesServer, func() *ManagedEnvironmentPrivateLinkResourcesServerTransport { - return NewManagedEnvironmentPrivateLinkResourcesServerTransport(&s.srv.ManagedEnvironmentPrivateLinkResourcesServer) - }) - resp, err = s.trManagedEnvironmentPrivateLinkResourcesServer.Do(req) case "ManagedEnvironmentUsagesClient": initServer(s, &s.trManagedEnvironmentUsagesServer, func() *ManagedEnvironmentUsagesServerTransport { return NewManagedEnvironmentUsagesServerTransport(&s.srv.ManagedEnvironmentUsagesServer) diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/time_rfc3339.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/time_rfc3339.go index ade6004b9922..81f308b0d343 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/time_rfc3339.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/time_rfc3339.go @@ -11,12 +11,11 @@ package fake import ( "encoding/json" "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" "regexp" "strings" "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/usages_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/usages_server.go index f6da5c8fb458..e8fb6fb0f293 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/usages_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/usages_server.go @@ -11,15 +11,14 @@ package fake import ( "errors" "fmt" - "net/http" - "net/url" - "regexp" - 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" ) // UsagesServer is a fake server for instances of the armappcontainers.UsagesClient type. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/functionsextension_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/functionsextension_client.go deleted file mode 100644 index 303593e5ad50..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/functionsextension_client.go +++ /dev/null @@ -1,120 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// 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-08-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-08-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/functionsextension_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/functionsextension_client_example_test.go deleted file mode 100644 index 7ca0fce77034..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/functionsextension_client_example_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/FunctionsExtension_Post.json -func ExampleFunctionsExtensionClient_InvokeFunctionsHost() { - 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.NewFunctionsExtensionClient().InvokeFunctionsHost(ctx, "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", "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.Value = "{\"status\":\"success\"}" -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/go.mod b/sdk/resourcemanager/appcontainers/armappcontainers/go.mod index 85797db092ca..24f4b7fe9146 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.16.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.31.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect ) diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/go.sum b/sdk/resourcemanager/appcontainers/armappcontainers/go.sum index 9620a8f197a3..823eafcd76d5 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/go.sum +++ b/sdk/resourcemanager/appcontainers/armappcontainers/go.sum @@ -1,35 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 h1:JZg6HRh6W6U4OLl6lk7BZ7BLisIzM9dG1R50zUk9C/M= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0/go.mod h1:YL1xnZ6QejvQHWJrX/AvhFl4WW4rqHVoKspWNVwFk0M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0/go.mod h1:fiPSssYvltE08HJchL04dOy+RD4hgrjph0cwGGMntdI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0 h1:+m0M/LFxN43KvULkDNfdXOgrjtg6UYJPFBJyuEcRCAw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= -github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 h1:kYRSnvJju5gYVyhkij+RTJ/VR6QIUaCfWeaFm2ycsjQ= -github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= -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/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= 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 deleted file mode 100644 index 192994842aa9..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/interfaces.go +++ /dev/null @@ -1,19 +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. 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, -// - *SpringCloudGatewayComponent -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 deleted file mode 100644 index 7cfd4fa86fc8..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client.go +++ /dev/null @@ -1,431 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// JavaComponentsClient contains the methods for the JavaComponents group. -// Don't use this type directly, use NewJavaComponentsClient() instead. -type JavaComponentsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewJavaComponentsClient creates a new instance of JavaComponentsClient 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 NewJavaComponentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JavaComponentsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &JavaComponentsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// 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 2024-08-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. -// - javaComponentEnvelope - Configuration details of the Java Component. -// - options - JavaComponentsClientBeginCreateOrUpdateOptions contains the optional parameters for the JavaComponentsClient.BeginCreateOrUpdate -// method. -func (client *JavaComponentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, name string, javaComponentEnvelope JavaComponent, options *JavaComponentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[JavaComponentsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, environmentName, name, javaComponentEnvelope, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[JavaComponentsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[JavaComponentsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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 2024-08-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" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, environmentName, name, javaComponentEnvelope, 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.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *JavaComponentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, javaComponentEnvelope JavaComponent, options *JavaComponentsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, javaComponentEnvelope); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a Java Component. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - options - JavaComponentsClientBeginDeleteOptions contains the optional parameters for the JavaComponentsClient.BeginDelete -// method. -func (client *JavaComponentsClient) BeginDelete(ctx context.Context, resourceGroupName string, environmentName string, name string, options *JavaComponentsClientBeginDeleteOptions) (*runtime.Poller[JavaComponentsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, environmentName, name, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[JavaComponentsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[JavaComponentsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a Java Component. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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" - 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, environmentName, name, 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 *JavaComponentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, options *JavaComponentsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a Java Component. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - options - JavaComponentsClientGetOptions contains the optional parameters for the JavaComponentsClient.Get method. -func (client *JavaComponentsClient) Get(ctx context.Context, resourceGroupName string, environmentName string, name string, options *JavaComponentsClientGetOptions) (JavaComponentsClientGetResponse, error) { - var err error - const operationName = "JavaComponentsClient.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, environmentName, name, options) - if err != nil { - return JavaComponentsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return JavaComponentsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return JavaComponentsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *JavaComponentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, options *JavaComponentsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - 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-08-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 *JavaComponentsClient) getHandleResponse(resp *http.Response) (JavaComponentsClientGetResponse, error) { - result := JavaComponentsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.JavaComponent); err != nil { - return JavaComponentsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Get the Java Components for a managed environment. -// -// Generated from API version 2024-08-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. -func (client *JavaComponentsClient) NewListPager(resourceGroupName string, environmentName string, options *JavaComponentsClientListOptions) *runtime.Pager[JavaComponentsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[JavaComponentsClientListResponse]{ - More: func(page JavaComponentsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *JavaComponentsClientListResponse) (JavaComponentsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "JavaComponentsClient.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, environmentName, options) - }, nil) - if err != nil { - return JavaComponentsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *JavaComponentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *JavaComponentsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - 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-08-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 *JavaComponentsClient) listHandleResponse(resp *http.Response) (JavaComponentsClientListResponse, error) { - result := JavaComponentsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.JavaComponentsCollection); err != nil { - return JavaComponentsClientListResponse{}, err - } - return result, nil -} - -// BeginUpdate - Patches a Java Component using JSON Merge Patch -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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. -// - javaComponentEnvelope - Configuration details of the Java Component. -// - options - JavaComponentsClientBeginUpdateOptions contains the optional parameters for the JavaComponentsClient.BeginUpdate -// method. -func (client *JavaComponentsClient) BeginUpdate(ctx context.Context, resourceGroupName string, environmentName string, name string, javaComponentEnvelope JavaComponent, options *JavaComponentsClientBeginUpdateOptions) (*runtime.Poller[JavaComponentsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, environmentName, name, javaComponentEnvelope, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[JavaComponentsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[JavaComponentsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Patches a Java Component using JSON Merge Patch -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-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" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, environmentName, name, javaComponentEnvelope, 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 -} - -// updateCreateRequest creates the Update request. -func (client *JavaComponentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, javaComponentEnvelope JavaComponent, options *JavaComponentsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if name == "" { - return nil, errors.New("parameter name cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{name}", url.PathEscape(name)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, javaComponentEnvelope); err != nil { - return nil, err - } - return req, 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 c26fe37fc022..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client_example_test.go +++ /dev/null @@ -1,593 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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.SpringBootAdminComponent{ - // 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), - // Scale: &armappcontainers.JavaComponentPropertiesScale{ - // MaxReplicas: to.Ptr[int32](1), - // MinReplicas: to.Ptr[int32](1), - // }, - // Ingress: &armappcontainers.JavaComponentIngress{ - // Fqdn: to.Ptr("myjavacomponent.myenvironment.test.net"), - // }, - // }, - // }, - // { - // 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.SpringCloudEurekaComponent{ - // 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), - // Scale: &armappcontainers.JavaComponentPropertiesScale{ - // MaxReplicas: to.Ptr[int32](1), - // MinReplicas: to.Ptr[int32](1), - // }, - // Ingress: &armappcontainers.JavaComponentIngress{ - // Fqdn: to.Ptr("myjavacomponent.myenvironment.test.net"), - // }, - // }, - // }, - // { - // Name: to.Ptr("reddog"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/javaComponents"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/reddog"), - // Properties: &armappcontainers.SpringCloudGatewayComponent{ - // ComponentType: to.Ptr(armappcontainers.JavaComponentTypeSpringCloudGateway), - // Configurations: []*armappcontainers.JavaComponentConfigurationProperty{ - // { - // PropertyName: to.Ptr("spring.cloud.gateway.enabled"), - // Value: to.Ptr("true"), - // }}, - // ProvisioningState: to.Ptr(armappcontainers.JavaComponentProvisioningStateSucceeded), - // Scale: &armappcontainers.JavaComponentPropertiesScale{ - // MaxReplicas: to.Ptr[int32](1), - // MinReplicas: to.Ptr[int32](1), - // }, - // Ingress: &armappcontainers.JavaComponentIngress{ - // Fqdn: to.Ptr("myjavacomponent.myenvironment.test.net"), - // }, - // SpringCloudGatewayRoutes: []*armappcontainers.ScgRoute{ - // { - // Filters: []*string{ - // to.Ptr("SetPath=/{path}")}, - // ID: to.Ptr("route1"), - // Predicates: []*string{ - // to.Ptr("Path=/v1/{path}"), - // to.Ptr("After=2024-01-20T17:42:47.789-07:00[America/Denver]")}, - // URI: to.Ptr("https://otherjavacomponent.myenvironment.test.net"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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.SpringBootAdminComponent{ - // 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), - // Scale: &armappcontainers.JavaComponentPropertiesScale{ - // MaxReplicas: to.Ptr[int32](1), - // MinReplicas: to.Ptr[int32](1), - // }, - // 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.SpringCloudEurekaComponent{ - // 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), - // Scale: &armappcontainers.JavaComponentPropertiesScale{ - // MaxReplicas: to.Ptr[int32](1), - // MinReplicas: to.Ptr[int32](1), - // }, - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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.SpringBootAdminComponent{ - // 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), - // Scale: &armappcontainers.JavaComponentPropertiesScale{ - // MaxReplicas: to.Ptr[int32](1), - // MinReplicas: to.Ptr[int32](1), - // }, - // Ingress: &armappcontainers.JavaComponentIngress{ - // Fqdn: to.Ptr("myjavacomponent.myenvironment.test.net"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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.SpringBootAdminComponent{ - // 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), - // Scale: &armappcontainers.JavaComponentPropertiesScale{ - // MaxReplicas: to.Ptr[int32](1), - // MinReplicas: to.Ptr[int32](1), - // }, - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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.SpringBootAdminComponent{ - 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"), - }}, - Scale: &armappcontainers.JavaComponentPropertiesScale{ - MaxReplicas: to.Ptr[int32](1), - MinReplicas: to.Ptr[int32](1), - }, - }, - }, 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.SpringBootAdminComponent{ - // 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), - // Scale: &armappcontainers.JavaComponentPropertiesScale{ - // MaxReplicas: to.Ptr[int32](1), - // MinReplicas: to.Ptr[int32](1), - // }, - // Ingress: &armappcontainers.JavaComponentIngress{ - // Fqdn: to.Ptr("myjavacomponent.myenvironment.test.net"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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.SpringBootAdminComponent{ - 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"), - }}, - Scale: &armappcontainers.JavaComponentPropertiesScale{ - MaxReplicas: to.Ptr[int32](1), - MinReplicas: to.Ptr[int32](1), - }, - 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.SpringBootAdminComponent{ - // 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), - // Scale: &armappcontainers.JavaComponentPropertiesScale{ - // MaxReplicas: to.Ptr[int32](1), - // MinReplicas: to.Ptr[int32](1), - // }, - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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.SpringBootAdminComponent{ - 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"), - }}, - Scale: &armappcontainers.JavaComponentPropertiesScale{ - MaxReplicas: to.Ptr[int32](1), - MinReplicas: to.Ptr[int32](1), - }, - }, - }, 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.SpringBootAdminComponent{ - // 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), - // Scale: &armappcontainers.JavaComponentPropertiesScale{ - // MaxReplicas: to.Ptr[int32](1), - // MinReplicas: to.Ptr[int32](1), - // }, - // Ingress: &armappcontainers.JavaComponentIngress{ - // Fqdn: to.Ptr("myjavacomponent.myenvironment.test.net"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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.SpringBootAdminComponent{ - 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"), - }}, - Scale: &armappcontainers.JavaComponentPropertiesScale{ - MaxReplicas: to.Ptr[int32](1), - MinReplicas: to.Ptr[int32](1), - }, - 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.SpringBootAdminComponent{ - // 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), - // Scale: &armappcontainers.JavaComponentPropertiesScale{ - // MaxReplicas: to.Ptr[int32](1), - // MinReplicas: to.Ptr[int32](1), - // }, - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 2e10df8f5ac4..4c3570d36162 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // JobsClient contains the methods for the Jobs group. @@ -29,7 +28,7 @@ type JobsClient struct { } // NewJobsClient creates a new instance of JobsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobsClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - jobEnvelope - Properties used to create a container apps job @@ -74,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 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -116,7 +115,7 @@ func (client *JobsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, jobEnvelope); err != nil { @@ -128,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -153,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 2024-08-02-preview +// Generated from API version 2025-01-01 func (client *JobsClient) deleteOperation(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "JobsClient.BeginDelete" @@ -195,7 +194,7 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -250,7 +249,7 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - detectorName - Name of the Container App Job detector. @@ -319,7 +318,7 @@ func (client *JobsClient) getDetectorCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -336,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - JobsClientListByResourceGroupOptions contains the optional parameters for the JobsClient.NewListByResourceGroupPager // method. @@ -379,7 +378,7 @@ func (client *JobsClient) listByResourceGroupCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -396,7 +395,7 @@ func (client *JobsClient) listByResourceGroupHandleResponse(resp *http.Response) // NewListBySubscriptionPager - Get the Container Apps Jobs in a given subscription. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - options - JobsClientListBySubscriptionOptions contains the optional parameters for the JobsClient.NewListBySubscriptionPager // method. func (client *JobsClient) NewListBySubscriptionPager(options *JobsClientListBySubscriptionOptions) *runtime.Pager[JobsClientListBySubscriptionResponse] { @@ -434,7 +433,7 @@ func (client *JobsClient) listBySubscriptionCreateRequest(ctx context.Context, o return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -451,7 +450,7 @@ func (client *JobsClient) listBySubscriptionHandleResponse(resp *http.Response) // NewListDetectorsPager - Get the list of diagnostics for a Container App Job. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - options - JobsClientListDetectorsOptions contains the optional parameters for the JobsClient.NewListDetectorsPager method. @@ -498,7 +497,7 @@ func (client *JobsClient) listDetectorsCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -516,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -562,7 +561,7 @@ func (client *JobsClient) listSecretsCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -580,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - apiName - Proxy API Name for Container App Job. @@ -631,7 +630,7 @@ func (client *JobsClient) proxyGetCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -646,86 +645,10 @@ func (client *JobsClient) proxyGetHandleResponse(resp *http.Response) (JobsClien return result, nil } -// BeginResume - Resumes a suspended job -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - jobName - Name of the Job. -// - options - JobsClientBeginResumeOptions contains the optional parameters for the JobsClient.BeginResume method. -func (client *JobsClient) BeginResume(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginResumeOptions) (*runtime.Poller[JobsClientResumeResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.resume(ctx, resourceGroupName, jobName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[JobsClientResumeResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[JobsClientResumeResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Resume - Resumes a suspended job -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -func (client *JobsClient) resume(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginResumeOptions) (*http.Response, error) { - var err error - const operationName = "JobsClient.BeginResume" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.resumeCreateRequest(ctx, resourceGroupName, jobName, 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 -} - -// resumeCreateRequest creates the Resume request. -func (client *JobsClient) resumeCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginResumeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/resume" - 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 jobName == "" { - return nil, errors.New("parameter jobName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - // BeginStart - Start a Container Apps Job // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -750,7 +673,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 2024-08-02-preview +// Generated from API version 2025-01-01 func (client *JobsClient) start(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "JobsClient.BeginStart" @@ -792,7 +715,7 @@ func (client *JobsClient) startCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Template != nil { @@ -807,7 +730,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - jobExecutionName - Job execution name. @@ -833,7 +756,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 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -879,7 +802,7 @@ func (client *JobsClient) stopExecutionCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -888,7 +811,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -914,7 +837,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 2024-08-02-preview +// Generated from API version 2025-01-01 func (client *JobsClient) stopMultipleExecutions(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginStopMultipleExecutionsOptions) (*http.Response, error) { var err error const operationName = "JobsClient.BeginStopMultipleExecutions" @@ -956,83 +879,7 @@ func (client *JobsClient) stopMultipleExecutionsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// BeginSuspend - Suspends a job -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - jobName - Name of the Job. -// - options - JobsClientBeginSuspendOptions contains the optional parameters for the JobsClient.BeginSuspend method. -func (client *JobsClient) BeginSuspend(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginSuspendOptions) (*runtime.Poller[JobsClientSuspendResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.suspend(ctx, resourceGroupName, jobName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[JobsClientSuspendResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[JobsClientSuspendResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Suspend - Suspends a job -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -func (client *JobsClient) suspend(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginSuspendOptions) (*http.Response, error) { - var err error - const operationName = "JobsClient.BeginSuspend" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.suspendCreateRequest(ctx, resourceGroupName, jobName, 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 -} - -// suspendCreateRequest creates the Suspend request. -func (client *JobsClient) suspendCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginSuspendOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/suspend" - 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 jobName == "" { - return nil, errors.New("parameter jobName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) - 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-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1041,7 +888,7 @@ func (client *JobsClient) suspendCreateRequest(ctx context.Context, resourceGrou // BeginUpdate - Patches a Container Apps Job using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - jobName - Job Name // - jobEnvelope - Properties used to create a container apps job @@ -1066,7 +913,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 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -1108,7 +955,7 @@ func (client *JobsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 9f9d00919379..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client_example_test.go +++ /dev/null @@ -1,1482 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ListDetectors.json -func ExampleJobsClient_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.NewJobsClient().NewListDetectorsPager("mikono-workerapp-test-rg", "mikonojob1", 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("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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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", "rootApi", 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("24adfa4f-dedf-8dc0-ca29-b6d1a69ab319"), - // TenantID: to.Ptr("23adfa4f-eedf-1dc0-ba29-a6d1a69ab3d0"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df"), - // PrincipalID: to.Ptr("74adfa4f-dedf-8dc0-ca29-b6d1a69ab312"), - // }, - // }, - // }, - // Properties: &armappcontainers.JobProperties{ - // Configuration: &armappcontainers.JobConfiguration{ - // IdentitySettings: []*armappcontainers.IdentitySettings{ - // { - // Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleAll), - // }, - // { - // Identity: to.Ptr("system"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleInit), - // }}, - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - Identity: &armappcontainers.ManagedServiceIdentity{ - Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {}, - }, - }, - Properties: &armappcontainers.JobProperties{ - Configuration: &armappcontainers.JobConfiguration{ - IdentitySettings: []*armappcontainers.IdentitySettings{ - { - Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleAll), - }, - { - Identity: to.Ptr("system"), - Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleInit), - }}, - 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"), - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("24adfa4f-dedf-8dc0-ca29-b6d1a69ab319"), - // TenantID: to.Ptr("23adfa4f-eedf-1dc0-ba29-a6d1a69ab3d0"), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df"), - // PrincipalID: to.Ptr("74adfa4f-dedf-8dc0-ca29-b6d1a69ab312"), - // }, - // }, - // }, - // Properties: &armappcontainers.JobProperties{ - // Configuration: &armappcontainers.JobConfiguration{ - // IdentitySettings: []*armappcontainers.IdentitySettings{ - // { - // Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleAll), - // }, - // { - // Identity: to.Ptr("system"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleInit), - // }}, - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - Identity: &armappcontainers.ManagedServiceIdentity{ - Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {}, - }, - }, - 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"), - Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - 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"), - // Identity: &armappcontainers.ManagedServiceIdentity{ - // Type: to.Ptr(armappcontainers.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armappcontainers.UserAssignedIdentity{ - // "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": &armappcontainers.UserAssignedIdentity{ - // ClientID: to.Ptr("14adfa4f-eedf-1dc0-ba29-a6d1a69ab3df"), - // PrincipalID: to.Ptr("74adfa4f-dedf-8dc0-ca29-b6d1a69ab312"), - // }, - // }, - // }, - // 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("servicebuscalingrule"), - // Type: to.Ptr("azure-servicebus"), - // Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - // 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"), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_Resume.json -func ExampleJobsClient_BeginResume() { - 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().BeginResume(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.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{ - // IdentitySettings: []*armappcontainers.IdentitySettings{ - // { - // Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleAll), - // }, - // { - // Identity: to.Ptr("system"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleInit), - // }}, - // 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), - // RunningState: to.Ptr(armappcontainers.JobRunningStateReady), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_Suspend.json -func ExampleJobsClient_BeginSuspend() { - 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().BeginSuspend(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.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{ - // IdentitySettings: []*armappcontainers.IdentitySettings{ - // { - // Identity: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleAll), - // }, - // { - // Identity: to.Ptr("system"), - // Lifecycle: to.Ptr(armappcontainers.IdentitySettingsLifeCycleInit), - // }}, - // 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), - // RunningState: to.Ptr(armappcontainers.JobRunningStateSuspended), - // 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), - // }}, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client.go index aeedbecf99f3..ee5441e54893 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // JobsExecutionsClient contains the methods for the JobsExecutions group. @@ -29,7 +28,7 @@ type JobsExecutionsClient struct { } // NewJobsExecutionsClient creates a new instance of JobsExecutionsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewJobsExecutionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobsExecutionsClient, error) { @@ -46,7 +45,7 @@ func NewJobsExecutionsClient(subscriptionID string, credential azcore.TokenCrede // NewListPager - Get a Container Apps Job's executions // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -96,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", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 a0766b317106..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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{ - // DetailedStatus: &armappcontainers.ExecutionStatus{ - // Replicas: []*armappcontainers.ReplicaExecutionStatus{ - // { - // Name: to.Ptr("testcontainerappsjob0-0"), - // Containers: []*armappcontainers.ContainerExecutionStatus{ - // { - // Name: to.Ptr("container1"), - // AdditionalInformation: to.Ptr("Completed"), - // Code: to.Ptr[int32](0), - // Status: to.Ptr("Succeeded"), - // }, - // { - // Name: to.Ptr("container2"), - // AdditionalInformation: to.Ptr("Completed"), - // Code: to.Ptr[int32](0), - // Status: to.Ptr("Succeeded"), - // }}, - // }}, - // }, - // 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/logicapps_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/logicapps_client.go deleted file mode 100644 index 20e0e8d952b5..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/logicapps_client.go +++ /dev/null @@ -1,600 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// LogicAppsClient contains the methods for the LogicApps group. -// Don't use this type directly, use NewLogicAppsClient() instead. -type LogicAppsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewLogicAppsClient creates a new instance of LogicAppsClient 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 NewLogicAppsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LogicAppsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &LogicAppsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Create or update a Logic App extension resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App. -// - logicAppName - Name of the Logic App, the extension resource. -// - resource - Logic app resource properties. -// - options - LogicAppsClientCreateOrUpdateOptions contains the optional parameters for the LogicAppsClient.CreateOrUpdate -// method. -func (client *LogicAppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, resource LogicApp, options *LogicAppsClientCreateOrUpdateOptions) (LogicAppsClientCreateOrUpdateResponse, error) { - var err error - const operationName = "LogicAppsClient.CreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, containerAppName, logicAppName, resource, options) - if err != nil { - return LogicAppsClientCreateOrUpdateResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return LogicAppsClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return LogicAppsClientCreateOrUpdateResponse{}, err - } - resp, err := client.createOrUpdateHandleResponse(httpResp) - return resp, err -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *LogicAppsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, resource LogicApp, options *LogicAppsClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}" - 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 logicAppName == "" { - return nil, errors.New("parameter logicAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{logicAppName}", url.PathEscape(logicAppName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, resource); err != nil { - return nil, err - } - return req, nil -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *LogicAppsClient) createOrUpdateHandleResponse(resp *http.Response) (LogicAppsClientCreateOrUpdateResponse, error) { - result := LogicAppsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LogicApp); err != nil { - return LogicAppsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Deletes a Logic App extension resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App. -// - logicAppName - Name of the Logic App, the extension resource. -// - options - LogicAppsClientDeleteOptions contains the optional parameters for the LogicAppsClient.Delete method. -func (client *LogicAppsClient) Delete(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *LogicAppsClientDeleteOptions) (LogicAppsClientDeleteResponse, error) { - var err error - const operationName = "LogicAppsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, containerAppName, logicAppName, options) - if err != nil { - return LogicAppsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return LogicAppsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return LogicAppsClientDeleteResponse{}, err - } - return LogicAppsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *LogicAppsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *LogicAppsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}" - 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 logicAppName == "" { - return nil, errors.New("parameter logicAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{logicAppName}", url.PathEscape(logicAppName)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// DeployWorkflowArtifacts - Creates or updates the artifacts for the logic app -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App. -// - logicAppName - Name of the Logic App, the extension resource. -// - options - LogicAppsClientDeployWorkflowArtifactsOptions contains the optional parameters for the LogicAppsClient.DeployWorkflowArtifacts -// method. -func (client *LogicAppsClient) DeployWorkflowArtifacts(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *LogicAppsClientDeployWorkflowArtifactsOptions) (LogicAppsClientDeployWorkflowArtifactsResponse, error) { - var err error - const operationName = "LogicAppsClient.DeployWorkflowArtifacts" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deployWorkflowArtifactsCreateRequest(ctx, resourceGroupName, containerAppName, logicAppName, options) - if err != nil { - return LogicAppsClientDeployWorkflowArtifactsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return LogicAppsClientDeployWorkflowArtifactsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return LogicAppsClientDeployWorkflowArtifactsResponse{}, err - } - return LogicAppsClientDeployWorkflowArtifactsResponse{}, nil -} - -// deployWorkflowArtifactsCreateRequest creates the DeployWorkflowArtifacts request. -func (client *LogicAppsClient) deployWorkflowArtifactsCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *LogicAppsClientDeployWorkflowArtifactsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/deployWorkflowArtifacts" - 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 logicAppName == "" { - return nil, errors.New("parameter logicAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{logicAppName}", url.PathEscape(logicAppName)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.WorkflowArtifacts != nil { - if err := runtime.MarshalAsJSON(req, *options.WorkflowArtifacts); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - -// Get - Gets a logic app extension resource. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App. -// - logicAppName - Name of the Logic App, the extension resource. -// - options - LogicAppsClientGetOptions contains the optional parameters for the LogicAppsClient.Get method. -func (client *LogicAppsClient) Get(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *LogicAppsClientGetOptions) (LogicAppsClientGetResponse, error) { - var err error - const operationName = "LogicAppsClient.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, containerAppName, logicAppName, options) - if err != nil { - return LogicAppsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return LogicAppsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return LogicAppsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *LogicAppsClient) getCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *LogicAppsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}" - 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 logicAppName == "" { - return nil, errors.New("parameter logicAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{logicAppName}", url.PathEscape(logicAppName)) - 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-08-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 *LogicAppsClient) getHandleResponse(resp *http.Response) (LogicAppsClientGetResponse, error) { - result := LogicAppsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LogicApp); err != nil { - return LogicAppsClientGetResponse{}, err - } - return result, nil -} - -// GetWorkflow - Get workflow information by its name -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App. -// - logicAppName - Name of the Logic App, the extension resource. -// - workflowName - Workflow name. -// - options - LogicAppsClientGetWorkflowOptions contains the optional parameters for the LogicAppsClient.GetWorkflow method. -func (client *LogicAppsClient) GetWorkflow(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, workflowName string, options *LogicAppsClientGetWorkflowOptions) (LogicAppsClientGetWorkflowResponse, error) { - var err error - const operationName = "LogicAppsClient.GetWorkflow" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getWorkflowCreateRequest(ctx, resourceGroupName, containerAppName, logicAppName, workflowName, options) - if err != nil { - return LogicAppsClientGetWorkflowResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return LogicAppsClientGetWorkflowResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return LogicAppsClientGetWorkflowResponse{}, err - } - resp, err := client.getWorkflowHandleResponse(httpResp) - return resp, err -} - -// getWorkflowCreateRequest creates the GetWorkflow request. -func (client *LogicAppsClient) getWorkflowCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, workflowName string, options *LogicAppsClientGetWorkflowOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName}" - 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 logicAppName == "" { - return nil, errors.New("parameter logicAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{logicAppName}", url.PathEscape(logicAppName)) - if workflowName == "" { - return nil, errors.New("parameter workflowName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{workflowName}", url.PathEscape(workflowName)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getWorkflowHandleResponse handles the GetWorkflow response. -func (client *LogicAppsClient) getWorkflowHandleResponse(resp *http.Response) (LogicAppsClientGetWorkflowResponse, error) { - result := LogicAppsClientGetWorkflowResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkflowEnvelope); err != nil { - return LogicAppsClientGetWorkflowResponse{}, err - } - return result, nil -} - -// Invoke - Proxies a the API call to the logic app backed by the container app. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App. -// - logicAppName - Name of the LogicApp App, the extension resource. -// - xmsLogicAppsProxyPath - The proxy path for the API call -// - xmsLogicAppsProxyMethod - The proxy method for the API call -// - options - LogicAppsClientInvokeOptions contains the optional parameters for the LogicAppsClient.Invoke method. -func (client *LogicAppsClient) Invoke(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, xmsLogicAppsProxyPath string, xmsLogicAppsProxyMethod LogicAppsProxyMethod, options *LogicAppsClientInvokeOptions) (LogicAppsClientInvokeResponse, error) { - var err error - const operationName = "LogicAppsClient.Invoke" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.invokeCreateRequest(ctx, resourceGroupName, containerAppName, logicAppName, xmsLogicAppsProxyPath, xmsLogicAppsProxyMethod, options) - if err != nil { - return LogicAppsClientInvokeResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return LogicAppsClientInvokeResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return LogicAppsClientInvokeResponse{}, err - } - resp, err := client.invokeHandleResponse(httpResp) - return resp, err -} - -// invokeCreateRequest creates the Invoke request. -func (client *LogicAppsClient) invokeCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, xmsLogicAppsProxyPath string, xmsLogicAppsProxyMethod LogicAppsProxyMethod, options *LogicAppsClientInvokeOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/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 logicAppName == "" { - return nil, errors.New("parameter logicAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{logicAppName}", url.PathEscape(logicAppName)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - req.Raw().Header["x-ms-logicApps-proxy-method"] = []string{string(xmsLogicAppsProxyMethod)} - req.Raw().Header["x-ms-logicApps-proxy-path"] = []string{xmsLogicAppsProxyPath} - return req, nil -} - -// invokeHandleResponse handles the Invoke response. -func (client *LogicAppsClient) invokeHandleResponse(resp *http.Response) (LogicAppsClientInvokeResponse, error) { - result := LogicAppsClientInvokeResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { - return LogicAppsClientInvokeResponse{}, err - } - return result, nil -} - -// NewListWorkflowsPager - List the workflows for a logic app. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App. -// - logicAppName - Name of the Logic App, the extension resource. -// - options - LogicAppsClientListWorkflowsOptions contains the optional parameters for the LogicAppsClient.NewListWorkflowsPager -// method. -func (client *LogicAppsClient) NewListWorkflowsPager(resourceGroupName string, containerAppName string, logicAppName string, options *LogicAppsClientListWorkflowsOptions) *runtime.Pager[LogicAppsClientListWorkflowsResponse] { - return runtime.NewPager(runtime.PagingHandler[LogicAppsClientListWorkflowsResponse]{ - More: func(page LogicAppsClientListWorkflowsResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *LogicAppsClientListWorkflowsResponse) (LogicAppsClientListWorkflowsResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "LogicAppsClient.NewListWorkflowsPager") - 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.listWorkflowsCreateRequest(ctx, resourceGroupName, containerAppName, logicAppName, options) - }, nil) - if err != nil { - return LogicAppsClientListWorkflowsResponse{}, err - } - return client.listWorkflowsHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listWorkflowsCreateRequest creates the ListWorkflows request. -func (client *LogicAppsClient) listWorkflowsCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *LogicAppsClientListWorkflowsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows" - 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 logicAppName == "" { - return nil, errors.New("parameter logicAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{logicAppName}", url.PathEscape(logicAppName)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listWorkflowsHandleResponse handles the ListWorkflows response. -func (client *LogicAppsClient) listWorkflowsHandleResponse(resp *http.Response) (LogicAppsClientListWorkflowsResponse, error) { - result := LogicAppsClientListWorkflowsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkflowEnvelopeCollection); err != nil { - return LogicAppsClientListWorkflowsResponse{}, err - } - return result, nil -} - -// ListWorkflowsConnections - Gets logic app's connections. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - containerAppName - Name of the Container App. -// - logicAppName - Name of the Logic App, the extension resource. -// - options - LogicAppsClientListWorkflowsConnectionsOptions contains the optional parameters for the LogicAppsClient.ListWorkflowsConnections -// method. -func (client *LogicAppsClient) ListWorkflowsConnections(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *LogicAppsClientListWorkflowsConnectionsOptions) (LogicAppsClientListWorkflowsConnectionsResponse, error) { - var err error - const operationName = "LogicAppsClient.ListWorkflowsConnections" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listWorkflowsConnectionsCreateRequest(ctx, resourceGroupName, containerAppName, logicAppName, options) - if err != nil { - return LogicAppsClientListWorkflowsConnectionsResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return LogicAppsClientListWorkflowsConnectionsResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return LogicAppsClientListWorkflowsConnectionsResponse{}, err - } - resp, err := client.listWorkflowsConnectionsHandleResponse(httpResp) - return resp, err -} - -// listWorkflowsConnectionsCreateRequest creates the ListWorkflowsConnections request. -func (client *LogicAppsClient) listWorkflowsConnectionsCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, logicAppName string, options *LogicAppsClientListWorkflowsConnectionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/listWorkflowsConnections" - 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 logicAppName == "" { - return nil, errors.New("parameter logicAppName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{logicAppName}", url.PathEscape(logicAppName)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listWorkflowsConnectionsHandleResponse handles the ListWorkflowsConnections response. -func (client *LogicAppsClient) listWorkflowsConnectionsHandleResponse(resp *http.Response) (LogicAppsClientListWorkflowsConnectionsResponse, error) { - result := LogicAppsClientListWorkflowsConnectionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.WorkflowEnvelope); err != nil { - return LogicAppsClientListWorkflowsConnectionsResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/logicapps_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/logicapps_client_example_test.go deleted file mode 100644 index c655b9398dd1..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/logicapps_client_example_test.go +++ /dev/null @@ -1,384 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Get.json -func ExampleLogicAppsClient_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.NewLogicAppsClient().Get(ctx, "examplerg", "testcontainerApp0", "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.LogicApp = armappcontainers.LogicApp{ - // Name: to.Ptr("testcontainerApp0"), - // Type: to.Ptr("Microsoft.App/logicApps"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/containerApps/testcontainerApp0/providers/Microsoft.App/logicApps/testcontainerApp0"), - // Properties: map[string]any{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Create.json -func ExampleLogicAppsClient_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.NewLogicAppsClient().CreateOrUpdate(ctx, "examplerg", "testcontainerApp0", "testcontainerApp0", armappcontainers.LogicApp{ - Properties: map[string]any{}, - }, 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.LogicApp = armappcontainers.LogicApp{ - // Name: to.Ptr("testcontainerApp0"), - // Type: to.Ptr("Microsoft.App/logicApps"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/containerApps/testcontainerApp0/providers/Microsoft.App/logicApps/testcontainerApp0"), - // Properties: map[string]any{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Delete.json -func ExampleLogicAppsClient_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.NewLogicAppsClient().Delete(ctx, "examplerg", "testcontainerApp0", "testcontainerApp0", 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListWorkflows.json -func ExampleLogicAppsClient_NewListWorkflowsPager() { - 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.NewLogicAppsClient().NewListWorkflowsPager("examplerg", "testcontainerApp0", "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.WorkflowEnvelopeCollection = armappcontainers.WorkflowEnvelopeCollection{ - // Value: []*armappcontainers.WorkflowEnvelope{ - // { - // Name: to.Ptr("testcontainerApp0/a1"), - // Type: to.Ptr("Microsoft.App/logicApps/workflows"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/containerApps/testcontainerApp0/providers/Microsoft.App/logicApps/testcontainerApp0/workflows/a1"), - // Kind: to.Ptr("Stateful"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.WorkflowEnvelopeProperties{ - // FlowState: to.Ptr(armappcontainers.WorkflowStateEnabled), - // Health: &armappcontainers.WorkflowHealth{ - // State: to.Ptr(armappcontainers.WorkflowHealthStateHealthy), - // }, - // }, - // }, - // { - // Name: to.Ptr("testcontainerApp0/stateful2"), - // Type: to.Ptr("Microsoft.App/logicApps/workflows"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/containerApps/testcontainerApp0/providers/Microsoft.App/logicApps/testcontainerApp0/workflows/stateful2"), - // Kind: to.Ptr("Stateful"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.WorkflowEnvelopeProperties{ - // FlowState: to.Ptr(armappcontainers.WorkflowStateEnabled), - // Health: &armappcontainers.WorkflowHealth{ - // Error: &armappcontainers.ErrorEntity{ - // Code: to.Ptr("InvalidWorkflowJson"), - // Message: to.Ptr("Invalid character after parsing property name. Expected ':' but got: \". Path '', line 2, position 2."), - // }, - // State: to.Ptr(armappcontainers.WorkflowHealthStateUnhealthy), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_GetWorkflow.json -func ExampleLogicAppsClient_GetWorkflow() { - 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.NewLogicAppsClient().GetWorkflow(ctx, "examplerg", "testcontainerApp0", "testcontainerApp0", "stateful1", 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.WorkflowEnvelope = armappcontainers.WorkflowEnvelope{ - // Name: to.Ptr("testcontainerApp0/stateful1"), - // Type: to.Ptr("Microsoft.App/logicApps/workflows"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/containerApps/testcontainerApp0/providers/Microsoft.App/logicApps/testcontainerApp0/workflows/stateful1"), - // Kind: to.Ptr("Stateful"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.WorkflowEnvelopeProperties{ - // Files: map[string]any{ - // "connections.json":map[string]any{ - // "managedApiConnections":map[string]any{ - // "office365":map[string]any{ - // "api":map[string]any{ - // "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/providers/Microsoft.Web/locations/brazilsouth/managedApis/office365", - // }, - // "authentication":map[string]any{ - // "type": "Raw", - // "parameter": "@appsetting('office365-connectionKey')", - // "scheme": "Key", - // }, - // "connection":map[string]any{ - // "id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/testrg123/providers/Microsoft.Web/connections/office365-1", - // }, - // "connectionRuntimeUrl": "string", - // }, - // }, - // }, - // "workflow.json":map[string]any{ - // "definition":map[string]any{ - // "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", - // "actions":map[string]any{ - // }, - // "contentVersion": "1.0.0.0", - // "outputs":map[string]any{ - // }, - // "parameters":map[string]any{ - // }, - // "triggers":map[string]any{ - // }, - // }, - // }, - // }, - // FlowState: to.Ptr(armappcontainers.WorkflowStateEnabled), - // Health: &armappcontainers.WorkflowHealth{ - // State: to.Ptr(armappcontainers.WorkflowHealthStateHealthy), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_DeleteDeployWorkflowArtifacts.json -func ExampleLogicAppsClient_DeployWorkflowArtifacts_deleteWorkflowArtifacts() { - 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.NewLogicAppsClient().DeployWorkflowArtifacts(ctx, "testrg123", "testapp2", "testapp2", &armappcontainers.LogicAppsClientDeployWorkflowArtifactsOptions{WorkflowArtifacts: &armappcontainers.WorkflowArtifacts{ - FilesToDelete: []*string{ - to.Ptr("test/workflow.json"), - to.Ptr("test/")}, - }, - }) - 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_PostDeployWorkflowArtifacts.json -func ExampleLogicAppsClient_DeployWorkflowArtifacts_deploysWorkflowArtifacts() { - 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.NewLogicAppsClient().DeployWorkflowArtifacts(ctx, "testrg123", "testapp2", "testapp2", &armappcontainers.LogicAppsClientDeployWorkflowArtifactsOptions{WorkflowArtifacts: &armappcontainers.WorkflowArtifacts{ - AppSettings: map[string]any{ - "eventHub_connectionString": "Endpoint=sb://example.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=EXAMPLE1a2b3c4d5e6fEXAMPLE=", - }, - Files: map[string]any{ - "connections.json": map[string]any{ - "managedApiConnections": map[string]any{}, - "serviceProviderConnections": map[string]any{ - "eventHub": map[string]any{ - "displayName": "example1", - "parameterValues": map[string]any{ - "connectionString": "@appsetting('eventHub_connectionString')", - }, - "serviceProvider": map[string]any{ - "id": "/serviceProviders/eventHub", - }, - }, - }, - }, - "test1/workflow.json": map[string]any{ - "definition": map[string]any{ - "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", - "actions": map[string]any{}, - "contentVersion": "1.0.0.0", - "outputs": map[string]any{}, - "triggers": map[string]any{ - "When_events_are_available_in_Event_hub": map[string]any{ - "type": "ServiceProvider", - "inputs": map[string]any{ - "parameters": map[string]any{ - "eventHubName": "test123", - }, - "serviceProviderConfiguration": map[string]any{ - "operationId": "receiveEvents", - "connectionName": "eventHub", - "serviceProviderId": "/serviceProviders/eventHub", - }, - }, - "splitOn": "@triggerOutputs()?['body']", - }, - }, - }, - "kind": "Stateful", - }, - }, - }, - }) - 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListConnections.json -func ExampleLogicAppsClient_ListWorkflowsConnections() { - 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.NewLogicAppsClient().ListWorkflowsConnections(ctx, "testrg123", "testapp2", "testapp2", 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.WorkflowEnvelope = armappcontainers.WorkflowEnvelope{ - // Name: to.Ptr("testapp2/connections"), - // Type: to.Ptr("Microsoft.App/logicApps/workflowsconfiguration"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/containerApps/testapp2/providers/Microsoft.App/logicApps/testapp2/workflowconfigurations/connections"), - // Location: to.Ptr("East US"), - // Properties: &armappcontainers.WorkflowEnvelopeProperties{ - // Files: map[string]any{ - // "connections.json":map[string]any{ - // "managedApiConnections":map[string]any{ - // "office365":map[string]any{ - // "api":map[string]any{ - // "id": "string", - // }, - // "authentication":map[string]any{ - // "type": "Raw", - // "parameter": "@appsetting('office365-connectionKey')", - // "scheme": "Key", - // }, - // "connection":map[string]any{ - // "id": "string", - // }, - // "connectionRuntimeUrl": "string", - // }, - // }, - // }, - // }, - // Health: &armappcontainers.WorkflowHealth{ - // State: to.Ptr(armappcontainers.WorkflowHealthStateHealthy), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListCallbackURL.json -func ExampleLogicAppsClient_Invoke() { - 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.NewLogicAppsClient().Invoke(ctx, "testrg123", "testapp2", "testapp2", "", armappcontainers.LogicAppsProxyMethodPOST, 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.Interface = map[string]any{ - // "method": "POST", - // "basePath": "https://testapp2.livelyriver-730e4fd9.eastasia.azurecontainerapps.io /api/test/triggers/When_a_HTTP_request_is_received/invoke", - // "queries":map[string]any{ - // "api-version": "2022-05-01", - // "sig": "IxEQ_ygZf6WNEQCbjV0Vs6p6Y4DyNEJVAa86U5B4xhk", - // "sp": "/triggers/When_a_HTTP_request_is_received/run", - // "sv": "1.0", - // }, - // "value": "https://testapp2.livelyriver-730e4fd9.eastasia.azurecontainerapps.io:443/api/test/triggers/When_a_HTTP_request_is_received/invoke?api-version=2022-05-01&sp=%2Ftriggers%2FWhen_a_HTTP_request_is_received%2Frun&sv=1.0&sig= ", - // } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go index 61abb6a68242..7dd463e3e8ff 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ManagedCertificatesClient contains the methods for the ManagedCertificates group. @@ -29,7 +28,7 @@ type ManagedCertificatesClient struct { } // NewManagedCertificatesClient creates a new instance of ManagedCertificatesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedCertificatesClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - managedCertificateName - Name of the Managed Certificate. @@ -74,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 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -120,7 +119,7 @@ func (client *ManagedCertificatesClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ManagedCertificateEnvelope != nil { @@ -135,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - managedCertificateName - Name of the Managed Certificate. @@ -186,7 +185,7 @@ func (client *ManagedCertificatesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - managedCertificateName - Name of the Managed Certificate. @@ -246,7 +245,7 @@ func (client *ManagedCertificatesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +262,7 @@ func (client *ManagedCertificatesClient) getHandleResponse(resp *http.Response) // NewListPager - Get the Managed Certificates in a given managed environment. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -311,7 +310,7 @@ func (client *ManagedCertificatesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - managedCertificateName - Name of the Managed Certificate. @@ -382,7 +381,7 @@ func (client *ManagedCertificatesClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 fee377ba1ccc..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 8bf0c7813b74..45fc14e6c141 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ManagedEnvironmentDiagnosticsClient contains the methods for the ManagedEnvironmentDiagnostics group. @@ -29,7 +28,7 @@ type ManagedEnvironmentDiagnosticsClient struct { } // NewManagedEnvironmentDiagnosticsClient creates a new instance of ManagedEnvironmentDiagnosticsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedEnvironmentDiagnosticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedEnvironmentDiagnosticsClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - detectorName - Name of the Managed Environment detector. @@ -99,7 +98,7 @@ func (client *ManagedEnvironmentDiagnosticsClient) getDetectorCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -164,7 +163,7 @@ func (client *ManagedEnvironmentDiagnosticsClient) listDetectorsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 6d4d02796d5d..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/managedenvironmentprivateendpointconnections_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivateendpointconnections_client.go deleted file mode 100644 index 6bc7c941c343..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivateendpointconnections_client.go +++ /dev/null @@ -1,346 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// ManagedEnvironmentPrivateEndpointConnectionsClient contains the methods for the ManagedEnvironmentPrivateEndpointConnections group. -// Don't use this type directly, use NewManagedEnvironmentPrivateEndpointConnectionsClient() instead. -type ManagedEnvironmentPrivateEndpointConnectionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewManagedEnvironmentPrivateEndpointConnectionsClient creates a new instance of ManagedEnvironmentPrivateEndpointConnectionsClient 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 NewManagedEnvironmentPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedEnvironmentPrivateEndpointConnectionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ManagedEnvironmentPrivateEndpointConnectionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Update the state of a private endpoint connection for a given managed environment. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - environmentName - Name of the Managed Environment. -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. -// - privateEndpointConnectionEnvelope - The resource of private endpoint and its properties -// - options - ManagedEnvironmentPrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters -// for the ManagedEnvironmentPrivateEndpointConnectionsClient.BeginCreateOrUpdate method. -func (client *ManagedEnvironmentPrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, privateEndpointConnectionName string, privateEndpointConnectionEnvelope PrivateEndpointConnection, options *ManagedEnvironmentPrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedEnvironmentPrivateEndpointConnectionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, environmentName, privateEndpointConnectionName, privateEndpointConnectionEnvelope, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedEnvironmentPrivateEndpointConnectionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedEnvironmentPrivateEndpointConnectionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Update the state of a private endpoint connection for a given managed environment. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -func (client *ManagedEnvironmentPrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, privateEndpointConnectionName string, privateEndpointConnectionEnvelope PrivateEndpointConnection, options *ManagedEnvironmentPrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "ManagedEnvironmentPrivateEndpointConnectionsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, environmentName, privateEndpointConnectionName, privateEndpointConnectionEnvelope, 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.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagedEnvironmentPrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, privateEndpointConnectionName string, privateEndpointConnectionEnvelope PrivateEndpointConnection, options *ManagedEnvironmentPrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, privateEndpointConnectionEnvelope); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a private endpoint connection for a given managed environment. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - environmentName - Name of the Managed Environment. -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. -// - options - ManagedEnvironmentPrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the -// ManagedEnvironmentPrivateEndpointConnectionsClient.BeginDelete method. -func (client *ManagedEnvironmentPrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, environmentName string, privateEndpointConnectionName string, options *ManagedEnvironmentPrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[ManagedEnvironmentPrivateEndpointConnectionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, environmentName, privateEndpointConnectionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ManagedEnvironmentPrivateEndpointConnectionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ManagedEnvironmentPrivateEndpointConnectionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a private endpoint connection for a given managed environment. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -func (client *ManagedEnvironmentPrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, environmentName string, privateEndpointConnectionName string, options *ManagedEnvironmentPrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "ManagedEnvironmentPrivateEndpointConnectionsClient.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, environmentName, privateEndpointConnectionName, 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 *ManagedEnvironmentPrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, privateEndpointConnectionName string, options *ManagedEnvironmentPrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - 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-08-02-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get a private endpoint connection for a given managed environment. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - environmentName - Name of the Managed Environment. -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. -// - options - ManagedEnvironmentPrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ManagedEnvironmentPrivateEndpointConnectionsClient.Get -// method. -func (client *ManagedEnvironmentPrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, environmentName string, privateEndpointConnectionName string, options *ManagedEnvironmentPrivateEndpointConnectionsClientGetOptions) (ManagedEnvironmentPrivateEndpointConnectionsClientGetResponse, error) { - var err error - const operationName = "ManagedEnvironmentPrivateEndpointConnectionsClient.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, environmentName, privateEndpointConnectionName, options) - if err != nil { - return ManagedEnvironmentPrivateEndpointConnectionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ManagedEnvironmentPrivateEndpointConnectionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ManagedEnvironmentPrivateEndpointConnectionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ManagedEnvironmentPrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, privateEndpointConnectionName string, options *ManagedEnvironmentPrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - if privateEndpointConnectionName == "" { - return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - 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-08-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 *ManagedEnvironmentPrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (ManagedEnvironmentPrivateEndpointConnectionsClientGetResponse, error) { - result := ManagedEnvironmentPrivateEndpointConnectionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { - return ManagedEnvironmentPrivateEndpointConnectionsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List private endpoint connections for a given managed environment. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - environmentName - Name of the Managed Environment. -// - options - ManagedEnvironmentPrivateEndpointConnectionsClientListOptions contains the optional parameters for the ManagedEnvironmentPrivateEndpointConnectionsClient.NewListPager -// method. -func (client *ManagedEnvironmentPrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, environmentName string, options *ManagedEnvironmentPrivateEndpointConnectionsClientListOptions) *runtime.Pager[ManagedEnvironmentPrivateEndpointConnectionsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ManagedEnvironmentPrivateEndpointConnectionsClientListResponse]{ - More: func(page ManagedEnvironmentPrivateEndpointConnectionsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ManagedEnvironmentPrivateEndpointConnectionsClientListResponse) (ManagedEnvironmentPrivateEndpointConnectionsClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedEnvironmentPrivateEndpointConnectionsClient.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, environmentName, options) - }, nil) - if err != nil { - return ManagedEnvironmentPrivateEndpointConnectionsClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ManagedEnvironmentPrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentPrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - 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-08-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 *ManagedEnvironmentPrivateEndpointConnectionsClient) listHandleResponse(resp *http.Response) (ManagedEnvironmentPrivateEndpointConnectionsClientListResponse, error) { - result := ManagedEnvironmentPrivateEndpointConnectionsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil { - return ManagedEnvironmentPrivateEndpointConnectionsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivateendpointconnections_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivateendpointconnections_client_example_test.go deleted file mode 100644 index 8a79a75723e2..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivateendpointconnections_client_example_test.go +++ /dev/null @@ -1,187 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_List.json -func ExampleManagedEnvironmentPrivateEndpointConnectionsClient_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.NewManagedEnvironmentPrivateEndpointConnectionsClient().NewListPager("examplerg", "managedEnv", 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.PrivateEndpointConnectionListResult = armappcontainers.PrivateEndpointConnectionListResult{ - // Value: []*armappcontainers.PrivateEndpointConnection{ - // { - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/managedEnv/privateEndpointConenctions/jlaw-demo1"), - // Properties: &armappcontainers.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("managedEnvironments")}, - // PrivateEndpoint: &armappcontainers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.Network/privateEndpoints/pltest"), - // }, - // PrivateLinkServiceConnectionState: &armappcontainers.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armappcontainers.PrivateEndpointServiceConnectionStatusPending), - // }, - // ProvisioningState: to.Ptr(armappcontainers.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("jlaw-demo2"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/managedEnv/privateEndpointConenctions/jlaw-demo2"), - // Properties: &armappcontainers.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("managedEnvironments")}, - // PrivateEndpoint: &armappcontainers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.Network/privateEndpoints/pltest"), - // }, - // PrivateLinkServiceConnectionState: &armappcontainers.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armappcontainers.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armappcontainers.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Get.json -func ExampleManagedEnvironmentPrivateEndpointConnectionsClient_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.NewManagedEnvironmentPrivateEndpointConnectionsClient().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.PrivateEndpointConnection = armappcontainers.PrivateEndpointConnection{ - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/managedEnv/privateEndpointConenctions/jlaw-demo1"), - // Properties: &armappcontainers.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("managedEnvironments")}, - // PrivateEndpoint: &armappcontainers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.Network/privateEndpoints/pltest"), - // }, - // PrivateLinkServiceConnectionState: &armappcontainers.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armappcontainers.PrivateEndpointServiceConnectionStatusPending), - // }, - // ProvisioningState: to.Ptr(armappcontainers.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate.json -func ExampleManagedEnvironmentPrivateEndpointConnectionsClient_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.NewManagedEnvironmentPrivateEndpointConnectionsClient().BeginCreateOrUpdate(ctx, "examplerg", "managedEnv", "jlaw-demo1", armappcontainers.PrivateEndpointConnection{ - Properties: &armappcontainers.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armappcontainers.PrivateLinkServiceConnectionState{ - ActionsRequired: to.Ptr("None"), - Status: to.Ptr(armappcontainers.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, 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.PrivateEndpointConnection = armappcontainers.PrivateEndpointConnection{ - // Name: to.Ptr("jlaw-demo1"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/managedEnv/privateEndpointConenctions/jlaw-demo1"), - // Properties: &armappcontainers.PrivateEndpointConnectionProperties{ - // GroupIDs: []*string{ - // to.Ptr("managedEnvironments")}, - // PrivateEndpoint: &armappcontainers.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.Network/privateEndpoints/pltest"), - // }, - // PrivateLinkServiceConnectionState: &armappcontainers.PrivateLinkServiceConnectionState{ - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armappcontainers.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armappcontainers.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Delete.json -func ExampleManagedEnvironmentPrivateEndpointConnectionsClient_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.NewManagedEnvironmentPrivateEndpointConnectionsClient().BeginDelete(ctx, "examplerg", "managedEnv", "jlaw-demo1", 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/managedenvironmentprivatelinkresources_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivatelinkresources_client.go deleted file mode 100644 index 0fd654634961..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivatelinkresources_client.go +++ /dev/null @@ -1,110 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armappcontainers - -import ( - "context" - "errors" - "net/http" - "net/url" - "strings" - - "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" -) - -// ManagedEnvironmentPrivateLinkResourcesClient contains the methods for the ManagedEnvironmentPrivateLinkResources group. -// Don't use this type directly, use NewManagedEnvironmentPrivateLinkResourcesClient() instead. -type ManagedEnvironmentPrivateLinkResourcesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewManagedEnvironmentPrivateLinkResourcesClient creates a new instance of ManagedEnvironmentPrivateLinkResourcesClient 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 NewManagedEnvironmentPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedEnvironmentPrivateLinkResourcesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ManagedEnvironmentPrivateLinkResourcesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - List private link resources for a given managed environment. -// -// Generated from API version 2024-08-02-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - environmentName - Name of the Managed Environment. -// - options - ManagedEnvironmentPrivateLinkResourcesClientListOptions contains the optional parameters for the ManagedEnvironmentPrivateLinkResourcesClient.NewListPager -// method. -func (client *ManagedEnvironmentPrivateLinkResourcesClient) NewListPager(resourceGroupName string, environmentName string, options *ManagedEnvironmentPrivateLinkResourcesClientListOptions) *runtime.Pager[ManagedEnvironmentPrivateLinkResourcesClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ManagedEnvironmentPrivateLinkResourcesClientListResponse]{ - More: func(page ManagedEnvironmentPrivateLinkResourcesClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ManagedEnvironmentPrivateLinkResourcesClientListResponse) (ManagedEnvironmentPrivateLinkResourcesClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ManagedEnvironmentPrivateLinkResourcesClient.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, environmentName, options) - }, nil) - if err != nil { - return ManagedEnvironmentPrivateLinkResourcesClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ManagedEnvironmentPrivateLinkResourcesClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentPrivateLinkResourcesClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateLinkResources" - 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 environmentName == "" { - return nil, errors.New("parameter environmentName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{environmentName}", url.PathEscape(environmentName)) - 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-08-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 *ManagedEnvironmentPrivateLinkResourcesClient) listHandleResponse(resp *http.Response) (ManagedEnvironmentPrivateLinkResourcesClientListResponse, error) { - result := ManagedEnvironmentPrivateLinkResourcesClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { - return ManagedEnvironmentPrivateLinkResourcesClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivatelinkresources_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivatelinkresources_client_example_test.go deleted file mode 100644 index 31b687d7c2aa..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentprivatelinkresources_client_example_test.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateLinkResources_List.json -func ExampleManagedEnvironmentPrivateLinkResourcesClient_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.NewManagedEnvironmentPrivateLinkResourcesClient().NewListPager("examplerg", "managedEnv", 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.PrivateLinkResourceListResult = armappcontainers.PrivateLinkResourceListResult{ - // Value: []*armappcontainers.PrivateLinkResource{ - // { - // Name: to.Ptr("managedEnvironments"), - // Type: to.Ptr("Microsoft.App/managedEnvironments/privateLinkResources"), - // ID: to.Ptr("/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/managedEnv/privateLinkResources/managedEnvironments"), - // Properties: &armappcontainers.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("managedEnvironments"), - // RequiredMembers: []*string{ - // to.Ptr("managedEnvironments")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.northcentralusstage.azurecontainerapps.io")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go index 8594f861c6df..e0f02a32d873 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ManagedEnvironmentsClient contains the methods for the ManagedEnvironments group. @@ -29,7 +28,7 @@ type ManagedEnvironmentsClient struct { } // NewManagedEnvironmentsClient creates a new instance of ManagedEnvironmentsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedEnvironmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedEnvironmentsClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - environmentEnvelope - Configuration details of the Environment. @@ -73,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 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -115,7 +114,7 @@ func (client *ManagedEnvironmentsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, environmentEnvelope); err != nil { @@ -127,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -152,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 2024-08-02-preview +// Generated from API version 2025-01-01 func (client *ManagedEnvironmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ManagedEnvironmentsClient.BeginDelete" @@ -194,7 +193,7 @@ func (client *ManagedEnvironmentsClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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. @@ -249,7 +248,7 @@ func (client *ManagedEnvironmentsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -314,7 +313,7 @@ func (client *ManagedEnvironmentsClient) getAuthTokenCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +330,7 @@ func (client *ManagedEnvironmentsClient) getAuthTokenHandleResponse(resp *http.R // NewListByResourceGroupPager - Get all the Managed Environments in a resource group. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ManagedEnvironmentsClientListByResourceGroupOptions contains the optional parameters for the ManagedEnvironmentsClient.NewListByResourceGroupPager // method. @@ -374,7 +373,7 @@ func (client *ManagedEnvironmentsClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -391,7 +390,7 @@ func (client *ManagedEnvironmentsClient) listByResourceGroupHandleResponse(resp // NewListBySubscriptionPager - Get all Managed Environments for a subscription. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - options - ManagedEnvironmentsClientListBySubscriptionOptions contains the optional parameters for the ManagedEnvironmentsClient.NewListBySubscriptionPager // method. func (client *ManagedEnvironmentsClient) NewListBySubscriptionPager(options *ManagedEnvironmentsClientListBySubscriptionOptions) *runtime.Pager[ManagedEnvironmentsClientListBySubscriptionResponse] { @@ -429,7 +428,7 @@ func (client *ManagedEnvironmentsClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -446,7 +445,7 @@ func (client *ManagedEnvironmentsClient) listBySubscriptionHandleResponse(resp * // NewListWorkloadProfileStatesPager - Get all workload Profile States for a Managed Environment. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -494,7 +493,7 @@ func (client *ManagedEnvironmentsClient) listWorkloadProfileStatesCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -512,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - environmentEnvelope - Configuration details of the Environment. @@ -538,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 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -580,7 +579,7 @@ func (client *ManagedEnvironmentsClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 16a949dae5b6..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client_example_test.go +++ /dev/null @@ -1,834 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - // EnableFips: to.Ptr(true), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - // EnableFips: to.Ptr(true), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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), - // }, - // }, - // PeerTrafficConfiguration: &armappcontainers.ManagedEnvironmentPropertiesPeerTrafficConfiguration{ - // Encryption: &armappcontainers.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption{ - // 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"), - // EnableFips: to.Ptr(true), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - EnableFips: to.Ptr(true), - 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"), - // EnableFips: to.Ptr(true), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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")}, - IncludeKeda: to.Ptr(true), - }, - TracesConfiguration: &armappcontainers.TracesConfiguration{ - Destinations: []*string{ - to.Ptr("appInsights")}, - IncludeDapr: to.Ptr(true), - }, - }, - PeerAuthentication: &armappcontainers.ManagedEnvironmentPropertiesPeerAuthentication{ - Mtls: &armappcontainers.Mtls{ - Enabled: to.Ptr(true), - }, - }, - PeerTrafficConfiguration: &armappcontainers.ManagedEnvironmentPropertiesPeerTrafficConfiguration{ - Encryption: &armappcontainers.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption{ - 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"), - EnableFips: to.Ptr(true), - 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"), - // EnableFips: to.Ptr(true), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - // EnableFips: to.Ptr(true), - // 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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 e93563d0e58d..2c9c53cb34cf 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ManagedEnvironmentsDiagnosticsClient contains the methods for the ManagedEnvironmentsDiagnostics group. @@ -29,7 +28,7 @@ type ManagedEnvironmentsDiagnosticsClient struct { } // NewManagedEnvironmentsDiagnosticsClient creates a new instance of ManagedEnvironmentsDiagnosticsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedEnvironmentsDiagnosticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedEnvironmentsDiagnosticsClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -94,7 +93,7 @@ func (client *ManagedEnvironmentsDiagnosticsClient) getRootCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 0b5a0dcd3a0e..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client_example_test.go +++ /dev/null @@ -1,104 +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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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), - // }, - // }, - // PeerTrafficConfiguration: &armappcontainers.ManagedEnvironmentPropertiesPeerTrafficConfiguration{ - // Encryption: &armappcontainers.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption{ - // 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"), - // EnableFips: to.Ptr(true), - // 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 0115419b12ee..228c72f1499d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ManagedEnvironmentsStoragesClient contains the methods for the ManagedEnvironmentsStorages group. @@ -29,7 +28,7 @@ type ManagedEnvironmentsStoragesClient struct { } // NewManagedEnvironmentsStoragesClient creates a new instance of ManagedEnvironmentsStoragesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedEnvironmentsStoragesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedEnvironmentsStoragesClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - storageName - Name of the storage. @@ -100,7 +99,7 @@ func (client *ManagedEnvironmentsStoragesClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, storageEnvelope); err != nil { @@ -121,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - storageName - Name of the storage. @@ -172,7 +171,7 @@ func (client *ManagedEnvironmentsStoragesClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Environment. // - storageName - Name of the storage. @@ -233,7 +232,7 @@ func (client *ManagedEnvironmentsStoragesClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -298,7 +297,7 @@ func (client *ManagedEnvironmentsStoragesClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 063691e7291d..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 9f7b5b3a1f94..41a8397b1b3c 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentusages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentusages_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // ManagedEnvironmentUsagesClient contains the methods for the ManagedEnvironmentUsages group. @@ -29,7 +28,7 @@ type ManagedEnvironmentUsagesClient struct { } // NewManagedEnvironmentUsagesClient creates a new instance of ManagedEnvironmentUsagesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagedEnvironmentUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedEnvironmentUsagesClient, error) { @@ -46,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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 @@ -94,7 +93,7 @@ func (client *ManagedEnvironmentUsagesClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 731f8e4d5274..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 fd954fb505fc..a6ddf6fe82c8 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/models.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/models.go @@ -25,12 +25,6 @@ type AllowedPrincipals struct { Identities []*string } -// AppInsightsConfiguration - Configuration of Application Insights -type AppInsightsConfiguration struct { - // Application Insights connection string - ConnectionString *string -} - // AppLogsConfiguration - Configuration of application logs type AppLogsConfiguration struct { // Logs destination, can be 'log-analytics', 'azure-monitor' or 'none' @@ -49,54 +43,6 @@ type AppRegistration struct { AppSecretSettingName *string } -// AppResiliency - Configuration to setup App Resiliency -type AppResiliency struct { - // App Resiliency resource specific properties - Properties *AppResiliencyProperties - - // 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 -} - -// AppResiliencyCollection - Collection of AppResiliency policies -type AppResiliencyCollection struct { - // REQUIRED; Collection of resources. - Value []*AppResiliency - - // READ-ONLY; Link to next page of resources. - NextLink *string -} - -// AppResiliencyProperties - App Resiliency resource specific properties -type AppResiliencyProperties struct { - // Policy that defines circuit breaker conditions - CircuitBreakerPolicy *CircuitBreakerPolicy - - // Defines parameters for http connection pooling - HTTPConnectionPool *HTTPConnectionPool - - // Policy that defines http request retry conditions - HTTPRetryPolicy *HTTPRetryPolicy - - // Defines parameters for tcp connection pooling - TCPConnectionPool *TCPConnectionPool - - // Policy that defines tcp request retry conditions - TCPRetryPolicy *TCPRetryPolicy - - // Policy to set request timeouts - TimeoutPolicy *TimeoutPolicy -} - // Apple - The configuration settings of the Apple provider. type Apple struct { // false if the Apple provider should not be enabled despite the set registration; otherwise, true. @@ -123,7 +69,7 @@ type AuthConfig struct { // AuthConfig resource specific properties Properties *AuthConfigProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -195,7 +141,7 @@ type AvailableWorkloadProfile struct { // Revision resource specific properties Properties *AvailableWorkloadProfileProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -374,10 +320,6 @@ 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 @@ -433,150 +375,6 @@ type BlobStorageTokenStore struct { SasURLSettingName *string } -// BuildCollection - The response of a BuildResource list operation. -type BuildCollection struct { - // REQUIRED; The BuildResource items on this page - Value []*BuildResource - - // The link to the next page of items - NextLink *string -} - -// BuildConfiguration - Configuration of the build. -type BuildConfiguration struct { - // Base OS used to build and run the app. - BaseOs *string - - // List of environment variables to be passed to the build, secrets should not be used in environment variable. - EnvironmentVariables []*EnvironmentVariable - - // Platform to be used to build and run the app. - Platform *string - - // Platform version to be used to build and run the app. - PlatformVersion *string - - // List of steps to perform before the build. - PreBuildSteps []*PreBuildStep -} - -// BuildProperties - The build properties. -type BuildProperties struct { - // Configuration of the build. - Configuration *BuildConfiguration - - // Container registry that the final image will be uploaded to. - DestinationContainerRegistry *ContainerRegistryWithCustomImage - - // READ-ONLY; Status of the build once it has been provisioned. - BuildStatus *BuildStatus - - // READ-ONLY; Endpoint from which the build logs can be streamed. - LogStreamEndpoint *string - - // READ-ONLY; Build provisioning state. - ProvisioningState *BuildProvisioningState - - // READ-ONLY; Endpoint to use to retrieve an authentication token for log streaming and uploading source code. - TokenEndpoint *string - - // READ-ONLY; Endpoint to which the source code should be uploaded. - UploadEndpoint *string -} - -// BuildResource - Information pertaining to an individual build. -type BuildResource struct { - // The resource-specific properties for this resource. - Properties *BuildProperties - - // 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 -} - -// BuildToken - Build Auth Token. -type BuildToken struct { - // READ-ONLY; Token expiration date. - Expires *time.Time - - // READ-ONLY; Authentication token. - Token *string -} - -// BuilderCollection - The response of a BuilderResource list operation. -type BuilderCollection struct { - // REQUIRED; The BuilderResource items on this page - Value []*BuilderResource - - // The link to the next page of items - NextLink *string -} - -// BuilderProperties - The builder properties. -type BuilderProperties struct { - // REQUIRED; Resource ID of the container apps environment that the builder is associated with. - EnvironmentID *string - - // List of mappings of container registries and the managed identity used to connect to it. - ContainerRegistries []*ContainerRegistry - - // READ-ONLY; Provisioning state of a builder resource. - ProvisioningState *BuilderProvisioningState -} - -// BuilderResource - Information about the SourceToCloud builder resource. -type BuilderResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // The managed service identities assigned to this resource. - Identity *ManagedServiceIdentity - - // The resource-specific properties for this resource. - Properties *BuilderProperties - - // Resource tags. - Tags map[string]*string - - // 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 -} - -// BuilderResourceUpdate - The type used for update operations of the BuilderResource. -type BuilderResourceUpdate struct { - // The managed service identities assigned to this resource. - Identity *ManagedServiceIdentity - - // The updatable properties of the BuilderResource. - Properties *BuilderResourceUpdateProperties - - // Resource tags. - Tags map[string]*string -} - -// BuilderResourceUpdateProperties - The updatable properties of the BuilderResource. -type BuilderResourceUpdateProperties struct { - // Resource ID of the container apps environment that the builder is associated with. - EnvironmentID *string -} - // Certificate used for Custom Domain bindings of Container Apps in a Managed Environment type Certificate struct { // REQUIRED; The geo-location where the resource lives @@ -588,7 +386,7 @@ type Certificate struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -610,15 +408,6 @@ type CertificateCollection struct { NextLink *string } -// CertificateKeyVaultProperties - Properties for a certificate stored in a Key Vault. -type CertificateKeyVaultProperties struct { - // Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned identity. - Identity *string - - // URL pointing to the Azure Key Vault secret that holds the certificate. - KeyVaultURL *string -} - // CertificatePatch - A certificate to update type CertificatePatch struct { // Application-specific metadata in the form of key-value pairs. @@ -627,12 +416,6 @@ type CertificatePatch struct { // CertificateProperties - Certificate resource specific properties type CertificateProperties struct { - // Properties for a certificate stored in a Key Vault. - CertificateKeyVaultProperties *CertificateKeyVaultProperties - - // The type of the certificate. Allowed values are ServerSSLCertificate and ImagePullTrustedCA - CertificateType *CertificateType - // Certificate password. Password *string @@ -688,19 +471,6 @@ type CheckNameAvailabilityResponse struct { Reason *CheckNameAvailabilityReason } -// CircuitBreakerPolicy - Policy that defines circuit breaker conditions -type CircuitBreakerPolicy struct { - // Number of consecutive errors before the circuit breaker opens - ConsecutiveErrors *int32 - - // The time interval, in seconds, between endpoint checks. This can result in opening the circuit breaker if the check fails - // as well as closing the circuit breaker if the check succeeds. Defaults to 10s. - IntervalInSeconds *int32 - - // Maximum percentage of hosts that will be ejected after failure threshold has been met - MaxEjectionPercent *int32 -} - // ClientRegistration - The configuration settings of the app registration for providers that have client ids and client secrets type ClientRegistration struct { // The Client ID of the app used for login. @@ -720,10 +490,6 @@ type Configuration struct { // Dapr configuration for the Container App. Dapr *Dapr - // Optional settings for Managed Identities that are assigned to the Container App. If a Managed Identity is not specified - // here, default settings will be used. - IdentitySettings []*IdentitySettings - // Ingress configurations. Ingress *Ingress @@ -757,7 +523,7 @@ type ConnectedEnvironment struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -805,7 +571,7 @@ type ConnectedEnvironmentStorage struct { // Storage properties Properties *ConnectedEnvironmentStorageProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -822,9 +588,6 @@ type ConnectedEnvironmentStorage struct { type ConnectedEnvironmentStorageProperties struct { // Azure file properties AzureFile *AzureFileProperties - - // SMB storage properties - Smb *SmbStorage } // ConnectedEnvironmentStoragesCollection - Collection of Storage for Environments @@ -847,10 +610,6 @@ 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 @@ -876,11 +635,6 @@ type ContainerApp struct { // in code. Identity *ManagedServiceIdentity - // Metadata used to render different experiences for resources of the same type; e.g. WorkflowApp is a kind of Microsoft.App/ContainerApps - // type. If supported, the resource provider must validate and - // persist this value. - Kind *Kind - // The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another // Azure resource. If this is present, complete mode deployment will not // delete the resource if it is removed from the template since it is managed by another resource. @@ -892,7 +646,7 @@ type ContainerApp struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -916,7 +670,7 @@ type ContainerAppAuthToken struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -1046,9 +800,6 @@ 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 @@ -1058,9 +809,6 @@ type ContainerAppProperties struct { // READ-ONLY; Id used to verify domain name ownership CustomDomainVerificationID *string - // READ-ONLY; Any errors that occurred during deployment - DeploymentErrors *string - // READ-ONLY; The endpoint of the eventstream of the container app. EventStreamEndpoint *string @@ -1080,14 +828,6 @@ 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. @@ -1103,121 +843,6 @@ 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 []*PreBuildStep -} - -// 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 *ContainerRegistryWithCustomImage - - // 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. E.g. "/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 -} - -// ContainerExecutionStatus - Container Apps Job execution container status. Contains status code and reason -type ContainerExecutionStatus struct { - // Additional information for the container status - AdditionalInformation *string - - // Exit code - Code *int32 - - // Container Name. - Name *string - - // Status of the container - Status *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. - ContainerRegistryServer *string - - // REQUIRED; Resource ID of the managed identity. - IdentityResourceID *string -} - -// ContainerRegistryWithCustomImage - Container registry that the final image will be uploaded to. -type ContainerRegistryWithCustomImage struct { - // REQUIRED; Login server of the container registry that the final image should be uploaded to. Builder resource needs to - // have this container registry defined along with an identity to use to access it. - Server *string - - // 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 @@ -1260,18 +885,6 @@ type CorsPolicy struct { MaxAge *int32 } -// CustomContainerTemplate - Custom container configuration. -type CustomContainerTemplate struct { - // List of container definitions for the sessions of the session pool. - Containers []*SessionContainer - - // Session pool ingress configuration. - Ingress *SessionIngress - - // Private container registry credentials for containers used by the sessions of the session pool. - RegistryCredentials *SessionRegistryCredentials -} - // CustomDomain - Custom Domain of a Container App type CustomDomain struct { // REQUIRED; Hostname. @@ -1286,9 +899,6 @@ type CustomDomain struct { // CustomDomainConfiguration - Configuration properties for apps environment custom domain type CustomDomainConfiguration struct { - // Certificate stored in Azure Key Vault. - CertificateKeyVaultProperties *CertificateKeyVaultProperties - // Certificate password CertificatePassword *string @@ -1438,7 +1048,7 @@ type DaprComponent struct { // Dapr Component resource specific properties Properties *DaprComponentProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -1474,111 +1084,10 @@ type DaprComponentProperties struct { // Collection of secrets used by a Dapr component Secrets []*Secret - // List of container app services that are bound to the Dapr component - ServiceComponentBind []*DaprComponentServiceBinding - // Component version Version *string } -// DaprComponentResiliencyPoliciesCollection - Dapr Component Resiliency Policies ARM resource. -type DaprComponentResiliencyPoliciesCollection struct { - // REQUIRED; Collection of resources. - Value []*DaprComponentResiliencyPolicy - - // READ-ONLY; Link to next page of resources. - NextLink *string -} - -// DaprComponentResiliencyPolicy - Dapr Component Resiliency Policy. -type DaprComponentResiliencyPolicy struct { - // Dapr Component Resiliency Policy resource specific properties - Properties *DaprComponentResiliencyPolicyProperties - - // 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 -} - -// DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration - Dapr Component Resiliency Policy Circuit Breaker Policy -// Configuration. -type DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration struct { - // The number of consecutive errors before the circuit is opened. - ConsecutiveErrors *int32 - - // The optional interval in seconds after which the error count resets to 0. An interval of 0 will never reset. If not specified, - // the timeoutInSeconds value will be used. - IntervalInSeconds *int32 - - // The interval in seconds until a retry attempt is made after the circuit is opened. - TimeoutInSeconds *int32 -} - -// DaprComponentResiliencyPolicyConfiguration - Dapr Component Resiliency Policy Configuration. -type DaprComponentResiliencyPolicyConfiguration struct { - // The optional circuit breaker policy configuration - CircuitBreakerPolicy *DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration - - // The optional HTTP retry policy configuration - HTTPRetryPolicy *DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration - - // The optional timeout policy configuration - TimeoutPolicy *DaprComponentResiliencyPolicyTimeoutPolicyConfiguration -} - -// DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration - Dapr Component Resiliency Policy HTTP Retry Backoff Configuration. -type DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration struct { - // The optional initial delay in milliseconds before an operation is retried - InitialDelayInMilliseconds *int32 - - // The optional maximum time interval in milliseconds between retry attempts - MaxIntervalInMilliseconds *int32 -} - -// DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration - Dapr Component Resiliency Policy HTTP Retry Policy Configuration. -type DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration struct { - // The optional maximum number of retries - MaxRetries *int32 - - // The optional retry backoff configuration - RetryBackOff *DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration -} - -// DaprComponentResiliencyPolicyProperties - Dapr Component Resiliency Policy resource specific properties -type DaprComponentResiliencyPolicyProperties struct { - // The optional inbound component resiliency policy configuration - InboundPolicy *DaprComponentResiliencyPolicyConfiguration - - // The optional outbound component resiliency policy configuration - OutboundPolicy *DaprComponentResiliencyPolicyConfiguration -} - -// DaprComponentResiliencyPolicyTimeoutPolicyConfiguration - Dapr Component Resiliency Policy Timeout Policy Configuration. -type DaprComponentResiliencyPolicyTimeoutPolicyConfiguration struct { - // The optional response timeout in seconds - ResponseTimeoutInSeconds *int32 -} - -// DaprComponentServiceBinding - Configuration to bind a Dapr Component to a dev ContainerApp Service -type DaprComponentServiceBinding struct { - // Service bind metadata - Metadata *DaprServiceBindMetadata - - // Name of the service bind - Name *string - - // Resource id of the target service - ServiceID *string -} - // DaprComponentsCollection - Dapr Components ARM resource. type DaprComponentsCollection struct { // REQUIRED; Collection of resources. @@ -1621,115 +1130,13 @@ type DaprSecretsCollection struct { Value []*DaprSecret } -// DaprServiceBindMetadata - Dapr component metadata. -type DaprServiceBindMetadata struct { - // Service bind metadata property name. - Name *string +// DefaultAuthorizationPolicy - The configuration settings of the Azure Active Directory default authorization policy. +type DefaultAuthorizationPolicy struct { + // The configuration settings of the Azure Active Directory allowed applications. + AllowedApplications []*string - // Service bind metadata property value. - Value *string -} - -// DaprSubscription - Dapr PubSub Event Subscription. -type DaprSubscription struct { - // Dapr PubSub Event Subscription resource specific properties - Properties *DaprSubscriptionProperties - - // 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 -} - -// DaprSubscriptionBulkSubscribeOptions - Dapr PubSub Bulk Subscription Options. -type DaprSubscriptionBulkSubscribeOptions struct { - // Enable bulk subscription - Enabled *bool - - // Maximum duration in milliseconds to wait before a bulk message is sent to the app. - MaxAwaitDurationMs *int32 - - // Maximum number of messages to deliver in a bulk message. - MaxMessagesCount *int32 -} - -// DaprSubscriptionProperties - Dapr PubSub Event Subscription resource specific properties -type DaprSubscriptionProperties struct { - // Bulk subscription options - BulkSubscribe *DaprSubscriptionBulkSubscribeOptions - - // Deadletter topic name - DeadLetterTopic *string - - // Subscription metadata - Metadata map[string]*string - - // Dapr PubSub component name - PubsubName *string - - // Subscription routes - Routes *DaprSubscriptionRoutes - - // Application scopes to restrict the subscription to specific apps. - Scopes []*string - - // Topic name - Topic *string -} - -// DaprSubscriptionRouteRule - Dapr Pubsub Event Subscription Route Rule is used to specify the condition for sending a message -// to a specific path. -type DaprSubscriptionRouteRule struct { - // The optional CEL expression used to match the event. If the match is not specified, then the route is considered the default. - // The rules are tested in the order specified, so they should be define from - // most-to-least specific. The default route should appear last in the list. - Match *string - - // The path for events that match this rule - Path *string -} - -// DaprSubscriptionRoutes - Dapr PubSub Event Subscription Routes configuration. -type DaprSubscriptionRoutes struct { - // The default path to deliver events that do not match any of the rules. - Default *string - - // The list of Dapr PubSub Event Subscription Route Rules. - Rules []*DaprSubscriptionRouteRule -} - -// DaprSubscriptionsCollection - Dapr Subscriptions ARM resource. -type DaprSubscriptionsCollection struct { - // REQUIRED; Collection of resources. - Value []*DaprSubscription - - // READ-ONLY; Link to next page of resources. - NextLink *string -} - -// DataDogConfiguration - Configuration of datadog -type DataDogConfiguration struct { - // The data dog api key - Key *string - - // The data dog site - Site *string -} - -// DefaultAuthorizationPolicy - The configuration settings of the Azure Active Directory default authorization policy. -type DefaultAuthorizationPolicy struct { - // The configuration settings of the Azure Active Directory allowed applications. - AllowedApplications []*string - - // The configuration settings of the Azure Active Directory allowed principals. - AllowedPrincipals *AllowedPrincipals + // The configuration settings of the Azure Active Directory allowed principals. + AllowedPrincipals *AllowedPrincipals } // DefaultErrorResponse - App Service error response. @@ -1768,15 +1175,6 @@ type DefaultErrorResponseErrorDetailsItem struct { Target *string } -// DestinationsConfiguration - Configuration of Open Telemetry destinations -type DestinationsConfiguration struct { - // Open telemetry datadog destination configuration - DataDogConfiguration *DataDogConfiguration - - // Open telemetry otlp configurations - OtlpConfigurations []*OtlpConfiguration -} - // DiagnosticDataProviderMetadata - Details of a diagnostics data provider type DiagnosticDataProviderMetadata struct { // Collection of properties @@ -1848,7 +1246,7 @@ type Diagnostics struct { // Diagnostics resource specific properties Properties *DiagnosticsProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -1933,75 +1331,6 @@ type DiagnosticsStatus struct { StatusID *int32 } -// DotNetComponent - .NET Component. -type DotNetComponent struct { - // .NET Component resource specific properties - Properties *DotNetComponentProperties - - // 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 -} - -// DotNetComponentConfigurationProperty - Configuration properties for a .NET Component -type DotNetComponentConfigurationProperty struct { - // The name of the property - PropertyName *string - - // The value of the property - Value *string -} - -// DotNetComponentProperties - .NET Component resource specific properties -type DotNetComponentProperties struct { - // Type of the .NET Component. - ComponentType *DotNetComponentType - - // List of .NET Components configuration properties - Configurations []*DotNetComponentConfigurationProperty - - // List of .NET Components that are bound to the .NET component - ServiceBinds []*DotNetComponentServiceBind - - // READ-ONLY; Provisioning state of the .NET Component. - ProvisioningState *DotNetComponentProvisioningState -} - -// DotNetComponentServiceBind - Configuration to bind a .NET Component to another .NET Component -type DotNetComponentServiceBind struct { - // Name of the service bind - Name *string - - // Resource id of the target service - ServiceID *string -} - -// DotNetComponentsCollection - .NET Components ARM resource. -type DotNetComponentsCollection struct { - // REQUIRED; Collection of resources. - Value []*DotNetComponent - - // READ-ONLY; Link to next page of resources. - NextLink *string -} - -// DynamicPoolConfiguration - Dynamic pool configuration. -type DynamicPoolConfiguration struct { - // The cooldown period of a session in seconds. - CooldownPeriodInSeconds *int32 - - // The execution type of the session pool. - ExecutionType *ExecutionType -} - // EncryptionSettings - The configuration settings of the secrets references of encryption key and signing key for ContainerApp // Service Authentication/Authorization. type EncryptionSettings struct { @@ -2023,7 +1352,7 @@ type EnvironmentAuthToken struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -2057,15 +1386,6 @@ type EnvironmentVar struct { Value *string } -// EnvironmentVariable - Model representing an environment variable. -type EnvironmentVariable struct { - // REQUIRED; Environment variable name. - Name *string - - // REQUIRED; Environment variable value. - Value *string -} - // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -2093,33 +1413,6 @@ type ErrorDetail struct { Target *string } -// ErrorEntity - Body of the error response returned from the API. -type ErrorEntity struct { - // Basic error code. - Code *string - - // Error Details. - Details []*ErrorEntity - - // Type of error. - ExtendedCode *string - - // Inner errors. - InnerErrors []*ErrorEntity - - // Any details of the error. - Message *string - - // Message template. - MessageTemplate *string - - // Parameters for the template. - Parameters []*string - - // 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 { @@ -2127,12 +1420,6 @@ type ErrorResponse struct { Error *ErrorDetail } -// ExecutionStatus - Container Apps Job execution status. -type ExecutionStatus struct { - // Replicas in the execution. - Replicas []*ReplicaExecutionStatus -} - // ExtendedLocation - The complex type of the extended location. type ExtendedLocation struct { // The name of the extended location. @@ -2186,15 +1473,9 @@ type GithubActionConfiguration struct { // AzureCredentials configurations. AzureCredentials *AzureCredentials - // List of environment variables to be passed to the build. - BuildEnvironmentVariables []*EnvironmentVariable - // Context path ContextPath *string - // Dockerfile path - DockerfilePath *string - // One time Github PAT to configure github environment GithubPersonalAccessToken *string @@ -2246,60 +1527,6 @@ type Google struct { Validation *AllowedAudiencesValidation } -// HTTPConnectionPool - Defines parameters for http connection pooling -type HTTPConnectionPool struct { - // Maximum number of pending http1 requests allowed - HTTP1MaxPendingRequests *int32 - - // Maximum number of http2 requests allowed - HTTP2MaxRequests *int32 -} - -// HTTPGet - Model representing a http get request. -type HTTPGet struct { - // REQUIRED; URL to make HTTP GET request against. - URL *string - - // Name of the file that the request should be saved to. - FileName *string - - // 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 - Matches *HTTPRetryPolicyMatches - - // Maximum number of times a request will retry - MaxRetries *int32 - - // Settings for retry backoff characteristics - RetryBackOff *HTTPRetryPolicyRetryBackOff -} - -// HTTPRetryPolicyMatches - Conditions that must be met for a request to be retried -type HTTPRetryPolicyMatches struct { - // Errors that can trigger a retry - Errors []*string - - // Additional http status codes that can trigger a retry - HTTPStatusCodes []*int32 - - // Headers that must be present for a request to be retried - Headers []*HeaderMatch -} - -// HTTPRetryPolicyRetryBackOff - Settings for retry backoff characteristics -type HTTPRetryPolicyRetryBackOff struct { - // Initial delay, in milliseconds, before retrying a request - InitialDelayInMilliseconds *int64 - - // Maximum interval, in milliseconds, between retries - MaxIntervalInMilliseconds *int64 -} - // HTTPScaleRule - Container App container Http scaling rule. type HTTPScaleRule struct { // Authentication secrets for the custom scale rule. @@ -2332,39 +1559,6 @@ type HTTPSettingsRoutes struct { APIPrefix *string } -// Header of otlp configuration -type Header struct { - // The key of otlp configuration header - Key *string - - // The value of otlp configuration header - Value *string -} - -// HeaderMatch - Conditions required to match a header -type HeaderMatch struct { - // Name of the header - Header *string - - // Type of match to perform - Match *HeaderMatchMatch -} - -// HeaderMatchMatch - Type of match to perform -type HeaderMatchMatch struct { - // Exact value of the header - ExactMatch *string - - // Prefix value of the header - PrefixMatch *string - - // Regex value of the header - RegexMatch *string - - // Suffix value of the header - SuffixMatch *string -} - // IPSecurityRestrictionRule - Rule to restrict incoming IP address. type IPSecurityRestrictionRule struct { // REQUIRED; Allow or Deny rules to determine for incoming IP. Note: Rules can only consist of ALL Allow or ALL Deny @@ -2409,16 +1603,6 @@ type IdentityProviders struct { Twitter *Twitter } -// IdentitySettings - Optional settings for a Managed Identity that is assigned to the Container App. -type IdentitySettings struct { - // REQUIRED; The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for system-assigned - // identity. - Identity *string - - // Use to select the lifecycle stages of a Container App during which the Managed Identity should be available. - Lifecycle *IdentitySettingsLifeCycle -} - // Ingress - Container App Ingress configuration. type Ingress struct { // Settings to expose additional ports on container app @@ -2454,9 +1638,6 @@ type Ingress struct { // Target Port in containers for traffic from ingress TargetPort *int32 - // Whether an http app listens on http or https - TargetPortHTTPScheme *IngressTargetPortHTTPScheme - // Traffic weights for app's revisions Traffic []*TrafficWeight @@ -2499,10 +1680,6 @@ 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 @@ -2513,95 +1690,11 @@ type InitContainer struct { VolumeMounts []*VolumeMount } -// JavaComponent - Java Component. -type JavaComponent struct { - // Java Component resource specific properties - Properties JavaComponentPropertiesClassification - - // 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 -} - -// JavaComponentConfigurationProperty - Configuration properties for a Java Component -type JavaComponentConfigurationProperty struct { - // The name of the property - PropertyName *string - - // The value of the property - Value *string -} - -// 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 { - // REQUIRED; Type of the Java Component. - ComponentType *JavaComponentType - - // List of Java Components configuration properties - Configurations []*JavaComponentConfigurationProperty - - // Java component scaling configurations - Scale *JavaComponentPropertiesScale - - // 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 JavaComponentProperties. -func (j *JavaComponentProperties) GetJavaComponentProperties() *JavaComponentProperties { return j } - -// JavaComponentPropertiesScale - Java component scaling configurations -type JavaComponentPropertiesScale struct { - // Optional. Maximum number of Java component replicas - MaxReplicas *int32 - - // Optional. Minimum number of Java component replicas. Defaults to 1 if not set - MinReplicas *int32 -} - -// JavaComponentServiceBind - Configuration to bind a Java Component to another Java Component -type JavaComponentServiceBind struct { - // Name of the service bind - Name *string - - // Resource id of the target service - ServiceID *string -} - -// JavaComponentsCollection - Java Components ARM resource. -type JavaComponentsCollection struct { - // REQUIRED; Collection of resources. - Value []*JavaComponent - - // READ-ONLY; Link to next page of resources. - NextLink *string -} - // Job - Container App Job type Job struct { // REQUIRED; The geo-location where the resource lives Location *string - // The complex type of the extended location. - ExtendedLocation *ExtendedLocation - // Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials // in code. Identity *ManagedServiceIdentity @@ -2612,7 +1705,7 @@ type Job struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -2636,10 +1729,6 @@ type JobConfiguration struct { // Trigger configuration of an event driven job. EventTriggerConfig *JobConfigurationEventTriggerConfig - // Optional settings for Managed Identities that are assigned to the Container App Job. If a Managed Identity is not specified - // here, default settings will be used. - IdentitySettings []*IdentitySettings - // Manual trigger configuration for a single execution job. Properties replicaCompletionCount and parallelism would be set // to 1 by default ManualTriggerConfig *JobConfigurationManualTriggerConfig @@ -2746,9 +1835,6 @@ type JobExecutionNamesCollection struct { // JobExecutionProperties - Container Apps Job execution specific properties. type JobExecutionProperties struct { - // Detailed status of the job execution. - DetailedStatus *ExecutionStatus - // Job execution end time. EndTime *time.Time @@ -2773,9 +1859,6 @@ type JobExecutionTemplate struct { // JobPatchProperties - Container Apps Job resource specific properties. type JobPatchProperties struct { - // The complex type of the extended location. - ExtendedLocation *ExtendedLocation - // Managed identities needed by a container app job to interact with other Azure services to not maintain any secrets or credentials // in code. Identity *ManagedServiceIdentity @@ -2824,9 +1907,6 @@ type JobProperties struct { // READ-ONLY; Provisioning state of the Container Apps Job. ProvisioningState *JobProvisioningState - - // READ-ONLY; Current running state of the job - RunningState *JobRunningState } // JobScale - Scaling configurations for event driven jobs. @@ -2849,7 +1929,8 @@ type JobScaleRule struct { // Authentication secrets for the scale rule. Auth []*ScaleRuleAuth - // The resource ID of a user-assigned managed identity that is assigned to the job, or 'system' for system-assigned identity. + // The resource ID of a user-assigned managed identity that is assigned to the Container App, or 'system' for system-assigned + // identity. Identity *string // Metadata properties to describe the scale rule. @@ -2919,9 +2000,6 @@ type LogAnalyticsConfiguration struct { // Log analytics customer id CustomerID *string - // Boolean indicating whether to parse json string log into dynamic json columns - DynamicJSONColumns *bool - // Log analytics customer key SharedKey *string } @@ -2935,24 +2013,6 @@ type LoggerSetting struct { Logger *string } -// LogicApp - A logic app extension resource -type LogicApp struct { - // The resource-specific properties for this resource. - Properties any - - // 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 -} - // 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 @@ -2988,12 +2048,6 @@ type LoginScopes struct { Scopes []*string } -// LogsConfiguration - Configuration of Open Telemetry logs -type LogsConfiguration struct { - // Open telemetry logs destinations - Destinations []*string -} - // ManagedCertificate - Managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment type ManagedCertificate struct { // REQUIRED; The geo-location where the resource lives @@ -3005,7 +2059,7 @@ type ManagedCertificate struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -3056,10 +2110,6 @@ type ManagedEnvironment struct { // REQUIRED; The geo-location where the resource lives Location *string - // Managed identities for the Managed Environment to interact with other Azure services without maintaining any secrets or - // credentials in code. - Identity *ManagedServiceIdentity - // Kind of the Environment. Kind *string @@ -3069,7 +2119,7 @@ type ManagedEnvironment struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -3084,11 +2134,7 @@ type ManagedEnvironment struct { // ManagedEnvironmentProperties - Managed environment resource specific properties type ManagedEnvironmentProperties struct { - // Environment level Application Insights configuration - AppInsightsConfiguration *AppInsightsConfiguration - - // Cluster configuration which enables the log daemon to export app logs to a destination. Currently only "log-analytics" - // is supported + // Cluster configuration which enables the log daemon to export app logs to configured destination. AppLogsConfiguration *AppLogsConfiguration // Custom domain configuration for the environment @@ -3111,18 +2157,12 @@ type ManagedEnvironmentProperties struct { // The configuration of Keda component. KedaConfiguration *KedaConfiguration - // Environment Open Telemetry configuration - OpenTelemetryConfiguration *OpenTelemetryConfiguration - // Peer authentication settings for the Managed Environment PeerAuthentication *ManagedEnvironmentPropertiesPeerAuthentication // Peer traffic settings for the Managed Environment PeerTrafficConfiguration *ManagedEnvironmentPropertiesPeerTrafficConfiguration - // Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled'. - PublicNetworkAccess *PublicNetworkAccess - // Vnet configuration for the environment VnetConfiguration *VnetConfiguration @@ -3141,9 +2181,6 @@ type ManagedEnvironmentProperties struct { // READ-ONLY; The endpoint of the eventstream of the Environment. EventStreamEndpoint *string - // READ-ONLY; Private endpoint connections to the resource. - PrivateEndpointConnections []*PrivateEndpointConnection - // READ-ONLY; Provisioning state of the Environment. ProvisioningState *EnvironmentProvisioningState @@ -3174,7 +2211,7 @@ type ManagedEnvironmentStorage struct { // Storage properties Properties *ManagedEnvironmentStorageProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -3231,59 +2268,18 @@ type ManagedServiceIdentity struct { TenantID *string } -// MetricsConfiguration - Configuration of Open Telemetry metrics -type MetricsConfiguration struct { - // Open telemetry metrics destinations - Destinations []*string - - // Boolean indicating if including keda metrics - IncludeKeda *bool -} - // Mtls - Configuration properties for mutual TLS authentication type Mtls struct { // Boolean indicating whether the mutual TLS authentication is enabled 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 - - // Java component scaling configurations - Scale *JavaComponentPropertiesScale - - // 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, - Scale: n.Scale, - ServiceBinds: n.ServiceBinds, - } -} - // NfsAzureFileProperties - NFS Azure File Properties. type NfsAzureFileProperties struct { // Access mode for storage AccessMode *AccessMode - // Server for NFS azure file. + // Server for NFS azure file. Specify the Azure storage account server address. Server *string // NFS Azure file share name. @@ -3347,21 +2343,6 @@ type OpenIDConnectRegistration struct { OpenIDConnectConfiguration *OpenIDConnectConfig } -// OpenTelemetryConfiguration - Configuration of Open Telemetry -type OpenTelemetryConfiguration struct { - // Open telemetry destinations configuration - DestinationsConfiguration *DestinationsConfiguration - - // Open telemetry logs configuration - LogsConfiguration *LogsConfiguration - - // Open telemetry metrics configuration - MetricsConfiguration *MetricsConfiguration - - // Open telemetry trace configuration - TracesConfiguration *TracesConfiguration -} - // OperationDetail - Operation detail payload type OperationDetail struct { // Display of the operation @@ -3392,228 +2373,11 @@ type OperationDisplay struct { Resource *string } -// OtlpConfiguration - Configuration of otlp -type OtlpConfiguration struct { - // The endpoint of otlp configuration - Endpoint *string - - // Headers of otlp configurations - Headers []*Header - - // Boolean indicating if otlp configuration is insecure - Insecure *bool - - // The name of otlp configuration - 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. - Description *string - - // Http get request to send before the build. - HTTPGet *HTTPGet - - // List of custom commands to run. - Scripts []*string -} - -// PrivateEndpoint - The Private Endpoint resource. -type PrivateEndpoint struct { - // READ-ONLY; The ARM identifier for Private Endpoint - ID *string -} - -// PrivateEndpointConnection - The Private Endpoint Connection resource. -type PrivateEndpointConnection struct { - // Resource properties. - Properties *PrivateEndpointConnectionProperties - - // 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 -} - -// PrivateEndpointConnectionListResult - List of private endpoint connection associated with the specified resource -type PrivateEndpointConnectionListResult struct { - // Array of private endpoint connections - Value []*PrivateEndpointConnection - - // READ-ONLY; URL to get the next set of operation list results (if there are any). - NextLink *string -} - -// PrivateEndpointConnectionProperties - Properties of the private endpoint connection. -type PrivateEndpointConnectionProperties struct { - // REQUIRED; A collection of information about the state of the connection between service consumer and provider. - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState - - // The resource of private end point. - PrivateEndpoint *PrivateEndpoint - - // READ-ONLY; The group ids for the private endpoint resource. - GroupIDs []*string - - // READ-ONLY; The provisioning state of the private endpoint connection resource. - ProvisioningState *PrivateEndpointConnectionProvisioningState -} - -// PrivateLinkResource - A private link resource -type PrivateLinkResource struct { - // Resource properties. - Properties *PrivateLinkResourceProperties - - // 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 -} - -// PrivateLinkResourceListResult - A list of private link resources -type PrivateLinkResourceListResult struct { - // Array of private link resources - Value []*PrivateLinkResource - - // READ-ONLY; URL to get the next set of operation list results (if there are any). - NextLink *string -} - -// PrivateLinkResourceProperties - Properties of a private link resource. -type PrivateLinkResourceProperties struct { - // The private link resource private link DNS zone name. - RequiredZoneNames []*string - - // READ-ONLY; The private link resource group id. - GroupID *string - - // READ-ONLY; The private link resource required member names. - RequiredMembers []*string -} - -// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer -// and provider. -type PrivateLinkServiceConnectionState struct { - // A message indicating if changes on the service provider require any updates on the consumer. - ActionsRequired *string - - // The reason for approval/rejection of the connection. - Description *string - - // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. - Status *PrivateEndpointServiceConnectionStatus -} - -// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a -// location -type ProxyResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string +// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a +// location +type ProxyResource 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 @@ -3677,7 +2441,7 @@ type Replica struct { // Replica resource specific properties Properties *ReplicaProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -3713,9 +2477,6 @@ type ReplicaContainer struct { // The container start status Started *bool - // READ-ONLY; Container debug endpoint - DebugEndpoint *string - // READ-ONLY; Container exec endpoint ExecEndpoint *string @@ -3729,15 +2490,6 @@ type ReplicaContainer struct { RunningStateDetails *string } -// ReplicaExecutionStatus - Container Apps Job execution replica status. -type ReplicaExecutionStatus struct { - // Containers in the execution replica - Containers []*ContainerExecutionStatus - - // Replica Name. - Name *string -} - // ReplicaProperties - Replica resource specific properties type ReplicaProperties struct { // The containers collection under a replica. @@ -3758,7 +2510,7 @@ type ReplicaProperties struct { // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -3776,7 +2528,7 @@ type Revision struct { // Revision resource specific properties Properties *RevisionProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -3837,19 +2589,10 @@ type RevisionProperties struct { // 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 @@ -3876,7 +2619,7 @@ type RuntimeJavaAgentLogging struct { // Scale - Container App scaling configurations. type Scale struct { - // Optional. KEDA Cooldown Period. Defaults to 300 seconds if not set. + // Optional. KEDA Cooldown Period in seconds. Defaults to 300 seconds if not set. CooldownPeriod *int32 // Optional. Maximum number of container replicas. Defaults to 10 if not set. @@ -3885,22 +2628,13 @@ type Scale struct { // Optional. Minimum number of container replicas. MinReplicas *int32 - // Optional. KEDA Polling Interval. Defaults to 30 seconds if not set. + // Optional. KEDA Polling Interval in seconds. Defaults to 30 seconds if not set. PollingInterval *int32 // Scaling rules. Rules []*ScaleRule } -// ScaleConfiguration - Scale configuration. -type ScaleConfiguration struct { - // The maximum count of sessions at the same time. - MaxConcurrentSessions *int32 - - // The minimum count of ready session instances. - ReadySessionInstances *int32 -} - // ScaleRule - Container App container scaling rule. type ScaleRule struct { // Azure Queue based scaling. @@ -3928,24 +2662,6 @@ type ScaleRuleAuth struct { TriggerParameter *string } -// ScgRoute - Spring Cloud Gateway route definition -type ScgRoute struct { - // REQUIRED; Id of the route - ID *string - - // REQUIRED; Uri of the route - URI *string - - // Filters of the route - Filters []*string - - // Order of the route - Order *int64 - - // Predicates of the route - Predicates []*string -} - // Secret definition. type Secret struct { // Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned identity. @@ -3984,12 +2700,6 @@ type Service struct { // ServiceBind - Configuration to bind a ContainerApp to a dev ContainerApp Service type ServiceBind struct { - // Type of the client to be used to connect to the service - ClientType *string - - // Customized keys for customizing injected values to the app - CustomizedKeys map[string]*string - // Name of the service bind Name *string @@ -3997,193 +2707,12 @@ type ServiceBind struct { ServiceID *string } -// SessionContainer - Container definitions for the sessions of the session pool. -type SessionContainer struct { - // Container start command arguments. - Args []*string - - // Container start command. - Command []*string - - // Container environment variables. - Env []*EnvironmentVar - - // Container image tag. - Image *string - - // Custom container name. - Name *string - - // Container resource requirements. - Resources *SessionContainerResources -} - -// SessionContainerResources - Container resource requirements for sessions of the session pool. -type SessionContainerResources struct { - // Required CPU in cores, e.g. 0.5 - CPU *float64 - - // Required memory, e.g. "250Mb" - Memory *string -} - -// SessionIngress - Session pool ingress configuration. -type SessionIngress struct { - // Target port in containers for traffic from ingress - TargetPort *int32 -} - -// SessionNetworkConfiguration - Session network configuration. -type SessionNetworkConfiguration struct { - // Network status for the sessions. - Status *SessionNetworkStatus -} - -// SessionPool - Container App session pool. -type SessionPool struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Container App session pool resource specific properties - Properties *SessionPoolProperties - - // Resource tags. - Tags map[string]*string - - // 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 -} - -// SessionPoolCollection - Session pool collection Azure resource. -type SessionPoolCollection struct { - // REQUIRED; Collection of resources. - Value []*SessionPool - - // READ-ONLY; Link to next page of resources. - NextLink *string -} - -// SessionPoolProperties - Container App session pool resource specific properties -type SessionPoolProperties struct { - // The container type of the sessions. - ContainerType *ContainerType - - // The custom container configuration if the containerType is CustomContainer. - CustomContainerTemplate *CustomContainerTemplate - - // The pool configuration if the poolManagementType is dynamic. - DynamicPoolConfiguration *DynamicPoolConfiguration - - // Resource ID of the session pool's environment. - EnvironmentID *string - - // The pool management type of the session pool. - PoolManagementType *PoolManagementType - - // The scale configuration of the session pool. - ScaleConfiguration *ScaleConfiguration - - // The secrets of the session pool. - Secrets []*SessionPoolSecret - - // The network configuration of the sessions in the session pool. - SessionNetworkConfiguration *SessionNetworkConfiguration - - // READ-ONLY; The number of nodes the session pool is using. - NodeCount *int32 - - // READ-ONLY; The endpoint to manage the pool. - PoolManagementEndpoint *string - - // READ-ONLY; Provisioning state of the session pool. - ProvisioningState *SessionPoolProvisioningState -} - -// SessionPoolSecret - Secret definition. -type SessionPoolSecret struct { - // Secret Name. - Name *string - - // Secret Value. - Value *string -} - -// SessionPoolUpdatableProperties - Container App session pool updatable properties. -type SessionPoolUpdatableProperties struct { - // Session pool resource specific updatable properties. - Properties *SessionPoolUpdatablePropertiesProperties -} - -// SessionPoolUpdatablePropertiesProperties - Session pool resource specific updatable properties. -type SessionPoolUpdatablePropertiesProperties struct { - // The custom container configuration if the containerType is CustomContainer. - CustomContainerTemplate *CustomContainerTemplate - - // The pool configuration if the poolManagementType is dynamic. - DynamicPoolConfiguration *DynamicPoolConfiguration - - // The scale configuration of the session pool. - ScaleConfiguration *ScaleConfiguration - - // The secrets of the session pool. - Secrets []*SessionPoolSecret - - // The network configuration of the sessions in the session pool. - SessionNetworkConfiguration *SessionNetworkConfiguration -} - -// SessionRegistryCredentials - Session pool private registry credentials. -type SessionRegistryCredentials struct { - // A Managed Identity to use to authenticate with Azure Container Registry. For user-assigned identities, use the full user-assigned - // identity Resource ID. For system-assigned identities, use 'system' - Identity *string - - // The name of the secret that contains the registry login password - PasswordSecretRef *string - - // Container registry server. - Server *string - - // Container registry username. - Username *string -} - -// SmbStorage - SMB storage properties -type SmbStorage struct { - // Access mode for storage - AccessMode *AccessMode - - // The domain name for the user. - Domain *string - - // The host name or IP address of the SMB server. - Host *string - - // The password for the user. - Password *string - - // The path to the SMB shared folder. - ShareName *string - - // The user to log on to the SMB server. - Username *string -} - // SourceControl - Container App SourceControl. type SourceControl struct { // SourceControl resource specific properties Properties *SourceControlProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -4221,134 +2750,6 @@ 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 - - // Java component scaling configurations - Scale *JavaComponentPropertiesScale - - // 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, - Scale: s.Scale, - 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 - - // Java component scaling configurations - Scale *JavaComponentPropertiesScale - - // 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, - Scale: s.Scale, - 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 - - // Java component scaling configurations - Scale *JavaComponentPropertiesScale - - // 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, - Scale: s.Scale, - ServiceBinds: s.ServiceBinds, - } -} - -// SpringCloudGatewayComponent - Spring Cloud Gateway properties. -type SpringCloudGatewayComponent struct { - // REQUIRED; Type of the Java Component. - ComponentType *JavaComponentType - - // List of Java Components configuration properties - Configurations []*JavaComponentConfigurationProperty - - // Java Component Ingress configurations. - Ingress *JavaComponentIngress - - // Java component scaling configurations - Scale *JavaComponentPropertiesScale - - // List of Java Components that are bound to the Java component - ServiceBinds []*JavaComponentServiceBind - - // Gateway route definition - SpringCloudGatewayRoutes []*ScgRoute - - // READ-ONLY; Provisioning state of the Java Component. - ProvisioningState *JavaComponentProvisioningState -} - -// GetJavaComponentProperties implements the JavaComponentPropertiesClassification interface for type SpringCloudGatewayComponent. -func (s *SpringCloudGatewayComponent) GetJavaComponentProperties() *JavaComponentProperties { - return &JavaComponentProperties{ - ComponentType: s.ComponentType, - Configurations: s.Configurations, - ProvisioningState: s.ProvisioningState, - Scale: s.Scale, - ServiceBinds: s.ServiceBinds, - } -} - // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -4370,18 +2771,6 @@ type SystemData struct { LastModifiedByType *CreatedByType } -// TCPConnectionPool - Defines parameters for tcp connection pooling -type TCPConnectionPool struct { - // Maximum number of tcp connections allowed - MaxConnections *int32 -} - -// TCPRetryPolicy - Policy that defines tcp request retry conditions -type TCPRetryPolicy struct { - // Maximum number of attempts to connect to the tcp service - MaxConnectAttempts *int32 -} - // TCPScaleRule - Container App container Tcp scaling rule. type TCPScaleRule struct { // Authentication secrets for the tcp scale rule. @@ -4423,15 +2812,6 @@ type Template struct { Volumes []*Volume } -// TimeoutPolicy - Policy to set request timeouts -type TimeoutPolicy struct { - // Timeout, in seconds, for a request to initiate a connection - ConnectionTimeoutInSeconds *int32 - - // Timeout, in seconds, for a request to respond - ResponseTimeoutInSeconds *int32 -} - // TokenStore - The configuration settings of the token store. type TokenStore struct { // The configuration settings of the storage of the tokens if blob storage is used. @@ -4446,15 +2826,6 @@ type TokenStore struct { TokenRefreshExtensionHours *float64 } -// TracesConfiguration - Configuration of Open Telemetry traces -type TracesConfiguration struct { - // Open telemetry traces destinations - Destinations []*string - - // Boolean indicating if including dapr traces - IncludeDapr *bool -} - // TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' // and a 'location' type TrackedResource struct { @@ -4464,7 +2835,7 @@ type TrackedResource struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 @@ -4594,69 +2965,6 @@ type VolumeMount struct { VolumeName *string } -// WorkflowArtifacts - The workflow filter. -type WorkflowArtifacts struct { - // Application settings of the workflow. - AppSettings any - - // Files of the app. - Files any - - // Files of the app to delete. - FilesToDelete []*string -} - -// WorkflowEnvelope - Workflow properties definition. -type WorkflowEnvelope struct { - // The resource kind. - Kind *string - - // The resource location. - Location *string - - // Additional workflow properties. - Properties *WorkflowEnvelopeProperties - - // READ-ONLY; The resource id. - ID *string - - // READ-ONLY; Gets the resource name. - Name *string - - // READ-ONLY; Gets the resource type. - Type *string -} - -// WorkflowEnvelopeCollection - Collection of workflow information elements. -type WorkflowEnvelopeCollection struct { - // REQUIRED; Collection of resources. - Value []*WorkflowEnvelope - - // READ-ONLY; Link to next page of resources. - NextLink *string -} - -// WorkflowEnvelopeProperties - Additional workflow properties. -type WorkflowEnvelopeProperties struct { - // Gets or sets the files. - Files any - - // Gets or sets the state of the workflow. - FlowState *WorkflowState - - // Gets or sets workflow health. - Health *WorkflowHealth -} - -// WorkflowHealth - Represents the workflow health. -type WorkflowHealth struct { - // REQUIRED; Gets or sets the workflow health state. - State *WorkflowHealthState - - // Gets or sets the workflow error. - Error *ErrorEntity -} - // WorkloadProfile - Workload profile to scope container app execution. type WorkloadProfile struct { // REQUIRED; Workload profile type for the workloads to run on. @@ -4665,9 +2973,6 @@ type WorkloadProfile struct { // REQUIRED; Workload profile type for the workloads to run on. WorkloadProfileType *string - // Whether to use a FIPS-enabled OS. Supported only for dedicated workload profiles. - EnableFips *bool - // The maximum capacity. MaximumCount *int32 @@ -4680,7 +2985,7 @@ type WorkloadProfileStates struct { // Workload Profile resource specific properties. Properties *WorkloadProfileStatesProperties - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // 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 diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go b/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go index 18fc9972a2b5..60b3bd2ef432 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go @@ -11,10 +11,9 @@ package armappcontainers import ( "encoding/json" "fmt" - "reflect" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "reflect" ) // MarshalJSON implements the json.Marshaller interface for type AllowedAudiencesValidation. @@ -75,33 +74,6 @@ func (a *AllowedPrincipals) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AppInsightsConfiguration. -func (a AppInsightsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "connectionString", a.ConnectionString) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AppInsightsConfiguration. -func (a *AppInsightsConfiguration) 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", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionString": - err = unpopulate(val, "ConnectionString", &a.ConnectionString) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type AppLogsConfiguration. func (a AppLogsConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -164,127 +136,6 @@ func (a *AppRegistration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AppResiliency. -func (a AppResiliency) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AppResiliency. -func (a *AppResiliency) 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", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AppResiliencyCollection. -func (a AppResiliencyCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AppResiliencyCollection. -func (a *AppResiliencyCollection) 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", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AppResiliencyProperties. -func (a AppResiliencyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "circuitBreakerPolicy", a.CircuitBreakerPolicy) - populate(objectMap, "httpConnectionPool", a.HTTPConnectionPool) - populate(objectMap, "httpRetryPolicy", a.HTTPRetryPolicy) - populate(objectMap, "tcpConnectionPool", a.TCPConnectionPool) - populate(objectMap, "tcpRetryPolicy", a.TCPRetryPolicy) - populate(objectMap, "timeoutPolicy", a.TimeoutPolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AppResiliencyProperties. -func (a *AppResiliencyProperties) 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", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "circuitBreakerPolicy": - err = unpopulate(val, "CircuitBreakerPolicy", &a.CircuitBreakerPolicy) - delete(rawMsg, key) - case "httpConnectionPool": - err = unpopulate(val, "HTTPConnectionPool", &a.HTTPConnectionPool) - delete(rawMsg, key) - case "httpRetryPolicy": - err = unpopulate(val, "HTTPRetryPolicy", &a.HTTPRetryPolicy) - delete(rawMsg, key) - case "tcpConnectionPool": - err = unpopulate(val, "TCPConnectionPool", &a.TCPConnectionPool) - delete(rawMsg, key) - case "tcpRetryPolicy": - err = unpopulate(val, "TCPRetryPolicy", &a.TCPRetryPolicy) - delete(rawMsg, key) - case "timeoutPolicy": - err = unpopulate(val, "TimeoutPolicy", &a.TimeoutPolicy) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Apple. func (a Apple) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -962,7 +813,6 @@ 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) @@ -990,9 +840,6 @@ 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) @@ -1146,391 +993,342 @@ func (b *BlobStorageTokenStore) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildCollection. -func (b BuildCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Certificate. +func (c Certificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildCollection. -func (b *BuildCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Certificate. +func (c *Certificate) 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", b, err) + 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", &b.NextLink) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &b.Value) + case "location": + err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BuildConfiguration. -func (b BuildConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "baseOs", b.BaseOs) - populate(objectMap, "environmentVariables", b.EnvironmentVariables) - populate(objectMap, "platform", b.Platform) - populate(objectMap, "platformVersion", b.PlatformVersion) - populate(objectMap, "preBuildSteps", b.PreBuildSteps) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildConfiguration. -func (b *BuildConfiguration) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "baseOs": - err = unpopulate(val, "BaseOs", &b.BaseOs) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "environmentVariables": - err = unpopulate(val, "EnvironmentVariables", &b.EnvironmentVariables) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "platform": - err = unpopulate(val, "Platform", &b.Platform) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) - case "platformVersion": - err = unpopulate(val, "PlatformVersion", &b.PlatformVersion) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) - case "preBuildSteps": - err = unpopulate(val, "PreBuildSteps", &b.PreBuildSteps) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildProperties. -func (b BuildProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CertificateCollection. +func (c CertificateCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "buildStatus", b.BuildStatus) - populate(objectMap, "configuration", b.Configuration) - populate(objectMap, "destinationContainerRegistry", b.DestinationContainerRegistry) - populate(objectMap, "logStreamEndpoint", b.LogStreamEndpoint) - populate(objectMap, "provisioningState", b.ProvisioningState) - populate(objectMap, "tokenEndpoint", b.TokenEndpoint) - populate(objectMap, "uploadEndpoint", b.UploadEndpoint) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildProperties. -func (b *BuildProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCollection. +func (c *CertificateCollection) 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", b, err) + 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", &b.BuildStatus) - delete(rawMsg, key) - case "configuration": - err = unpopulate(val, "Configuration", &b.Configuration) - delete(rawMsg, key) - case "destinationContainerRegistry": - err = unpopulate(val, "DestinationContainerRegistry", &b.DestinationContainerRegistry) - delete(rawMsg, key) - case "logStreamEndpoint": - err = unpopulate(val, "LogStreamEndpoint", &b.LogStreamEndpoint) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) - delete(rawMsg, key) - case "tokenEndpoint": - err = unpopulate(val, "TokenEndpoint", &b.TokenEndpoint) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "uploadEndpoint": - err = unpopulate(val, "UploadEndpoint", &b.UploadEndpoint) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildResource. -func (b BuildResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CertificatePatch. +func (c CertificatePatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "systemData", b.SystemData) - populate(objectMap, "type", b.Type) + populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildResource. -func (b *BuildResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificatePatch. +func (c *CertificatePatch) 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", b, err) + 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", &b.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &b.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildToken. -func (b BuildToken) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CertificateProperties. +func (c CertificateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "expires", b.Expires) - populate(objectMap, "token", b.Token) + populateDateTimeRFC3339(objectMap, "expirationDate", c.ExpirationDate) + populateDateTimeRFC3339(objectMap, "issueDate", c.IssueDate) + populate(objectMap, "issuer", c.Issuer) + populate(objectMap, "password", c.Password) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "publicKeyHash", c.PublicKeyHash) + populate(objectMap, "subjectAlternativeNames", c.SubjectAlternativeNames) + populate(objectMap, "subjectName", c.SubjectName) + populate(objectMap, "thumbprint", c.Thumbprint) + populate(objectMap, "valid", c.Valid) + populateByteArray(objectMap, "value", c.Value, func() any { + return runtime.EncodeByteArray(c.Value, runtime.Base64StdFormat) + }) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildToken. -func (b *BuildToken) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateProperties. +func (c *CertificateProperties) 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", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "expires": - err = unpopulateDateTimeRFC3339(val, "Expires", &b.Expires) + case "expirationDate": + err = unpopulateDateTimeRFC3339(val, "ExpirationDate", &c.ExpirationDate) delete(rawMsg, key) - case "token": - err = unpopulate(val, "Token", &b.Token) + case "issueDate": + err = unpopulateDateTimeRFC3339(val, "IssueDate", &c.IssueDate) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BuilderCollection. -func (b BuilderCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BuilderCollection. -func (b *BuilderCollection) 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", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) + case "issuer": + err = unpopulate(val, "Issuer", &c.Issuer) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &c.Password) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "publicKeyHash": + err = unpopulate(val, "PublicKeyHash", &c.PublicKeyHash) + delete(rawMsg, key) + case "subjectAlternativeNames": + err = unpopulate(val, "SubjectAlternativeNames", &c.SubjectAlternativeNames) + delete(rawMsg, key) + case "subjectName": + err = unpopulate(val, "SubjectName", &c.SubjectName) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) + delete(rawMsg, key) + case "valid": + err = unpopulate(val, "Valid", &c.Valid) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &b.Value) + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &c.Value, runtime.Base64StdFormat) + } delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuilderProperties. -func (b BuilderProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. +func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "containerRegistries", b.ContainerRegistries) - populate(objectMap, "environmentId", b.EnvironmentID) - populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "name", c.Name) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuilderProperties. -func (b *BuilderProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest. +func (c *CheckNameAvailabilityRequest) 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", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "containerRegistries": - err = unpopulate(val, "ContainerRegistries", &b.ContainerRegistries) - delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &b.EnvironmentID) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuilderResource. -func (b BuilderResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse. +func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "identity", b.Identity) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "systemData", b.SystemData) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) + populate(objectMap, "message", c.Message) + populate(objectMap, "nameAvailable", c.NameAvailable) + populate(objectMap, "reason", c.Reason) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuilderResource. -func (b *BuilderResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse. +func (c *CheckNameAvailabilityResponse) 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", b, err) + 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", &b.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &b.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &b.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &b.SystemData) + case "message": + err = unpopulate(val, "Message", &c.Message) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &b.Tags) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &c.NameAvailable) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuilderResourceUpdate. -func (b BuilderResourceUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClientRegistration. +func (c ClientRegistration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", b.Identity) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) + populate(objectMap, "clientId", c.ClientID) + populate(objectMap, "clientSecretSettingName", c.ClientSecretSettingName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuilderResourceUpdate. -func (b *BuilderResourceUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientRegistration. +func (c *ClientRegistration) 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", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &b.Identity) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) + case "clientId": + err = unpopulate(val, "ClientID", &c.ClientID) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &b.Tags) + case "clientSecretSettingName": + err = unpopulate(val, "ClientSecretSettingName", &c.ClientSecretSettingName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuilderResourceUpdateProperties. -func (b BuilderResourceUpdateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Configuration. +func (c Configuration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "environmentId", b.EnvironmentID) + populate(objectMap, "activeRevisionsMode", c.ActiveRevisionsMode) + populate(objectMap, "dapr", c.Dapr) + 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) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuilderResourceUpdateProperties. -func (b *BuilderResourceUpdateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Configuration. +func (c *Configuration) 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", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "environmentId": - err = unpopulate(val, "EnvironmentID", &b.EnvironmentID) + case "activeRevisionsMode": + err = unpopulate(val, "ActiveRevisionsMode", &c.ActiveRevisionsMode) + delete(rawMsg, key) + case "dapr": + err = unpopulate(val, "Dapr", &c.Dapr) + delete(rawMsg, key) + case "ingress": + err = unpopulate(val, "Ingress", &c.Ingress) + delete(rawMsg, key) + case "maxInactiveRevisions": + err = unpopulate(val, "MaxInactiveRevisions", &c.MaxInactiveRevisions) + delete(rawMsg, key) + 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) + case "service": + err = unpopulate(val, "Service", &c.Service) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Certificate. -func (c Certificate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironment. +func (c ConnectedEnvironment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "extendedLocation", c.ExtendedLocation) populate(objectMap, "id", c.ID) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) @@ -1541,8 +1339,8 @@ func (c Certificate) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Certificate. -func (c *Certificate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedEnvironment. +func (c *ConnectedEnvironment) 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) @@ -1550,6 +1348,9 @@ func (c *Certificate) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &c.ExtendedLocation) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) @@ -1579,16 +1380,16 @@ func (c *Certificate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateCollection. -func (c CertificateCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentCollection. +func (c ConnectedEnvironmentCollection) 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 CertificateCollection. -func (c *CertificateCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedEnvironmentCollection. +func (c *ConnectedEnvironmentCollection) 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) @@ -1610,16 +1411,20 @@ func (c *CertificateCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateKeyVaultProperties. -func (c CertificateKeyVaultProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentProperties. +func (c ConnectedEnvironmentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "keyVaultUrl", c.KeyVaultURL) + populate(objectMap, "customDomainConfiguration", c.CustomDomainConfiguration) + populate(objectMap, "daprAIConnectionString", c.DaprAIConnectionString) + populate(objectMap, "defaultDomain", c.DefaultDomain) + populate(objectMap, "deploymentErrors", c.DeploymentErrors) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "staticIp", c.StaticIP) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateKeyVaultProperties. -func (c *CertificateKeyVaultProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedEnvironmentProperties. +func (c *ConnectedEnvironmentProperties) 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) @@ -1627,11 +1432,23 @@ func (c *CertificateKeyVaultProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &c.Identity) + case "customDomainConfiguration": + err = unpopulate(val, "CustomDomainConfiguration", &c.CustomDomainConfiguration) delete(rawMsg, key) - case "keyVaultUrl": - err = unpopulate(val, "KeyVaultURL", &c.KeyVaultURL) + case "daprAIConnectionString": + err = unpopulate(val, "DaprAIConnectionString", &c.DaprAIConnectionString) + delete(rawMsg, key) + case "defaultDomain": + err = unpopulate(val, "DefaultDomain", &c.DefaultDomain) + delete(rawMsg, key) + case "deploymentErrors": + err = unpopulate(val, "DeploymentErrors", &c.DeploymentErrors) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "staticIp": + err = unpopulate(val, "StaticIP", &c.StaticIP) delete(rawMsg, key) } if err != nil { @@ -1641,15 +1458,19 @@ func (c *CertificateKeyVaultProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificatePatch. -func (c CertificatePatch) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentStorage. +func (c ConnectedEnvironmentStorage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "tags", c.Tags) + 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 CertificatePatch. -func (c *CertificatePatch) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedEnvironmentStorage. +func (c *ConnectedEnvironmentStorage) 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) @@ -1657,8 +1478,20 @@ func (c *CertificatePatch) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + 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 { @@ -1668,29 +1501,15 @@ func (c *CertificatePatch) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateProperties. -func (c CertificateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentStorageProperties. +func (c ConnectedEnvironmentStorageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "certificateKeyVaultProperties", c.CertificateKeyVaultProperties) - populate(objectMap, "certificateType", c.CertificateType) - populateDateTimeRFC3339(objectMap, "expirationDate", c.ExpirationDate) - populateDateTimeRFC3339(objectMap, "issueDate", c.IssueDate) - populate(objectMap, "issuer", c.Issuer) - populate(objectMap, "password", c.Password) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "publicKeyHash", c.PublicKeyHash) - populate(objectMap, "subjectAlternativeNames", c.SubjectAlternativeNames) - populate(objectMap, "subjectName", c.SubjectName) - populate(objectMap, "thumbprint", c.Thumbprint) - populate(objectMap, "valid", c.Valid) - populateByteArray(objectMap, "value", c.Value, func() any { - return runtime.EncodeByteArray(c.Value, runtime.Base64StdFormat) - }) + populate(objectMap, "azureFile", c.AzureFile) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateProperties. -func (c *CertificateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedEnvironmentStorageProperties. +func (c *ConnectedEnvironmentStorageProperties) 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) @@ -1698,46 +1517,8 @@ func (c *CertificateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "certificateKeyVaultProperties": - err = unpopulate(val, "CertificateKeyVaultProperties", &c.CertificateKeyVaultProperties) - delete(rawMsg, key) - case "certificateType": - err = unpopulate(val, "CertificateType", &c.CertificateType) - delete(rawMsg, key) - case "expirationDate": - err = unpopulateDateTimeRFC3339(val, "ExpirationDate", &c.ExpirationDate) - delete(rawMsg, key) - case "issueDate": - err = unpopulateDateTimeRFC3339(val, "IssueDate", &c.IssueDate) - delete(rawMsg, key) - case "issuer": - err = unpopulate(val, "Issuer", &c.Issuer) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &c.Password) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "publicKeyHash": - err = unpopulate(val, "PublicKeyHash", &c.PublicKeyHash) - delete(rawMsg, key) - case "subjectAlternativeNames": - err = unpopulate(val, "SubjectAlternativeNames", &c.SubjectAlternativeNames) - delete(rawMsg, key) - case "subjectName": - err = unpopulate(val, "SubjectName", &c.SubjectName) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) - delete(rawMsg, key) - case "valid": - err = unpopulate(val, "Valid", &c.Valid) - delete(rawMsg, key) - case "value": - if val != nil && string(val) != "null" { - err = runtime.DecodeByteArray(string(val), &c.Value, runtime.Base64StdFormat) - } + case "azureFile": + err = unpopulate(val, "AzureFile", &c.AzureFile) delete(rawMsg, key) } if err != nil { @@ -1747,16 +1528,15 @@ func (c *CertificateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. -func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentStoragesCollection. +func (c ConnectedEnvironmentStoragesCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "type", c.Type) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest. -func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedEnvironmentStoragesCollection. +func (c *ConnectedEnvironmentStoragesCollection) 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) @@ -1764,11 +1544,8 @@ func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -1778,17 +1555,22 @@ func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse. -func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Container. +func (c Container) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "message", c.Message) - populate(objectMap, "nameAvailable", c.NameAvailable) - populate(objectMap, "reason", c.Reason) + populate(objectMap, "args", c.Args) + populate(objectMap, "command", c.Command) + populate(objectMap, "env", c.Env) + populate(objectMap, "image", c.Image) + populate(objectMap, "name", c.Name) + populate(objectMap, "probes", c.Probes) + populate(objectMap, "resources", c.Resources) + populate(objectMap, "volumeMounts", c.VolumeMounts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse. -func (c *CheckNameAvailabilityResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Container. +func (c *Container) 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) @@ -1796,80 +1578,29 @@ func (c *CheckNameAvailabilityResponse) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "message": - err = unpopulate(val, "Message", &c.Message) + case "args": + err = unpopulate(val, "Args", &c.Args) delete(rawMsg, key) - case "nameAvailable": - err = unpopulate(val, "NameAvailable", &c.NameAvailable) + case "command": + err = unpopulate(val, "Command", &c.Command) delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &c.Reason) + case "env": + err = unpopulate(val, "Env", &c.Env) 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 CircuitBreakerPolicy. -func (c CircuitBreakerPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "consecutiveErrors", c.ConsecutiveErrors) - populate(objectMap, "intervalInSeconds", c.IntervalInSeconds) - populate(objectMap, "maxEjectionPercent", c.MaxEjectionPercent) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CircuitBreakerPolicy. -func (c *CircuitBreakerPolicy) 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 "consecutiveErrors": - err = unpopulate(val, "ConsecutiveErrors", &c.ConsecutiveErrors) + case "image": + err = unpopulate(val, "Image", &c.Image) delete(rawMsg, key) - case "intervalInSeconds": - err = unpopulate(val, "IntervalInSeconds", &c.IntervalInSeconds) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "maxEjectionPercent": - err = unpopulate(val, "MaxEjectionPercent", &c.MaxEjectionPercent) + case "probes": + err = unpopulate(val, "Probes", &c.Probes) 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 ClientRegistration. -func (c ClientRegistration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "clientId", c.ClientID) - populate(objectMap, "clientSecretSettingName", c.ClientSecretSettingName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClientRegistration. -func (c *ClientRegistration) 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 "clientId": - err = unpopulate(val, "ClientID", &c.ClientID) + case "resources": + err = unpopulate(val, "Resources", &c.Resources) delete(rawMsg, key) - case "clientSecretSettingName": - err = unpopulate(val, "ClientSecretSettingName", &c.ClientSecretSettingName) + case "volumeMounts": + err = unpopulate(val, "VolumeMounts", &c.VolumeMounts) delete(rawMsg, key) } if err != nil { @@ -1879,23 +1610,24 @@ func (c *ClientRegistration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Configuration. -func (c Configuration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerApp. +func (c ContainerApp) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "activeRevisionsMode", c.ActiveRevisionsMode) - populate(objectMap, "dapr", c.Dapr) - populate(objectMap, "identitySettings", c.IdentitySettings) - 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) + populate(objectMap, "extendedLocation", c.ExtendedLocation) + populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "location", c.Location) + populate(objectMap, "managedBy", c.ManagedBy) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Configuration. -func (c *Configuration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerApp. +func (c *ContainerApp) 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) @@ -1903,32 +1635,35 @@ func (c *Configuration) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "activeRevisionsMode": - err = unpopulate(val, "ActiveRevisionsMode", &c.ActiveRevisionsMode) + case "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &c.ExtendedLocation) delete(rawMsg, key) - case "dapr": - err = unpopulate(val, "Dapr", &c.Dapr) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "identitySettings": - err = unpopulate(val, "IdentitySettings", &c.IdentitySettings) + case "identity": + err = unpopulate(val, "Identity", &c.Identity) delete(rawMsg, key) - case "ingress": - err = unpopulate(val, "Ingress", &c.Ingress) + case "location": + err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) - case "maxInactiveRevisions": - err = unpopulate(val, "MaxInactiveRevisions", &c.MaxInactiveRevisions) + case "managedBy": + err = unpopulate(val, "ManagedBy", &c.ManagedBy) delete(rawMsg, key) - case "registries": - err = unpopulate(val, "Registries", &c.Registries) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "runtime": - err = unpopulate(val, "Runtime", &c.Runtime) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &c.Secrets) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) - case "service": - err = unpopulate(val, "Service", &c.Service) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -1938,10 +1673,9 @@ func (c *Configuration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironment. -func (c ConnectedEnvironment) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerAppAuthToken. +func (c ContainerAppAuthToken) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", c.ExtendedLocation) populate(objectMap, "id", c.ID) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) @@ -1952,8 +1686,8 @@ func (c ConnectedEnvironment) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedEnvironment. -func (c *ConnectedEnvironment) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppAuthToken. +func (c *ContainerAppAuthToken) 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) @@ -1961,9 +1695,6 @@ func (c *ConnectedEnvironment) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &c.ExtendedLocation) - delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) @@ -1993,16 +1724,16 @@ func (c *ConnectedEnvironment) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentCollection. -func (c ConnectedEnvironmentCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerAppAuthTokenProperties. +func (c ContainerAppAuthTokenProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populateDateTimeRFC3339(objectMap, "expires", c.Expires) + populate(objectMap, "token", c.Token) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedEnvironmentCollection. -func (c *ConnectedEnvironmentCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppAuthTokenProperties. +func (c *ContainerAppAuthTokenProperties) 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) @@ -2010,11 +1741,11 @@ func (c *ConnectedEnvironmentCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "expires": + err = unpopulateDateTimeRFC3339(val, "Expires", &c.Expires) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "token": + err = unpopulate(val, "Token", &c.Token) delete(rawMsg, key) } if err != nil { @@ -2024,20 +1755,16 @@ func (c *ConnectedEnvironmentCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentProperties. -func (c ConnectedEnvironmentProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerAppCollection. +func (c ContainerAppCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "customDomainConfiguration", c.CustomDomainConfiguration) - populate(objectMap, "daprAIConnectionString", c.DaprAIConnectionString) - populate(objectMap, "defaultDomain", c.DefaultDomain) - populate(objectMap, "deploymentErrors", c.DeploymentErrors) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "staticIp", c.StaticIP) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedEnvironmentProperties. -func (c *ConnectedEnvironmentProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppCollection. +func (c *ContainerAppCollection) 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) @@ -2045,23 +1772,11 @@ func (c *ConnectedEnvironmentProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "customDomainConfiguration": - err = unpopulate(val, "CustomDomainConfiguration", &c.CustomDomainConfiguration) - delete(rawMsg, key) - case "daprAIConnectionString": - err = unpopulate(val, "DaprAIConnectionString", &c.DaprAIConnectionString) - delete(rawMsg, key) - case "defaultDomain": - err = unpopulate(val, "DefaultDomain", &c.DefaultDomain) - delete(rawMsg, key) - case "deploymentErrors": - err = unpopulate(val, "DeploymentErrors", &c.DeploymentErrors) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "staticIp": - err = unpopulate(val, "StaticIP", &c.StaticIP) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -2071,19 +1786,16 @@ func (c *ConnectedEnvironmentProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentStorage. -func (c ConnectedEnvironmentStorage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerAppJobExecutions. +func (c ContainerAppJobExecutions) 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) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedEnvironmentStorage. -func (c *ConnectedEnvironmentStorage) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppJobExecutions. +func (c *ContainerAppJobExecutions) 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) @@ -2091,20 +1803,11 @@ func (c *ConnectedEnvironmentStorage) UnmarshalJSON(data []byte) error { 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) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -2114,16 +1817,23 @@ func (c *ConnectedEnvironmentStorage) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentStorageProperties. -func (c ConnectedEnvironmentStorageProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerAppProbe. +func (c ContainerAppProbe) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "azureFile", c.AzureFile) - populate(objectMap, "smb", c.Smb) + populate(objectMap, "failureThreshold", c.FailureThreshold) + populate(objectMap, "httpGet", c.HTTPGet) + populate(objectMap, "initialDelaySeconds", c.InitialDelaySeconds) + populate(objectMap, "periodSeconds", c.PeriodSeconds) + populate(objectMap, "successThreshold", c.SuccessThreshold) + populate(objectMap, "tcpSocket", c.TCPSocket) + populate(objectMap, "terminationGracePeriodSeconds", c.TerminationGracePeriodSeconds) + populate(objectMap, "timeoutSeconds", c.TimeoutSeconds) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedEnvironmentStorageProperties. -func (c *ConnectedEnvironmentStorageProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppProbe. +func (c *ContainerAppProbe) 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) @@ -2131,11 +1841,32 @@ func (c *ConnectedEnvironmentStorageProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "azureFile": - err = unpopulate(val, "AzureFile", &c.AzureFile) + case "failureThreshold": + err = unpopulate(val, "FailureThreshold", &c.FailureThreshold) + delete(rawMsg, key) + case "httpGet": + err = unpopulate(val, "HTTPGet", &c.HTTPGet) + delete(rawMsg, key) + case "initialDelaySeconds": + err = unpopulate(val, "InitialDelaySeconds", &c.InitialDelaySeconds) + delete(rawMsg, key) + case "periodSeconds": + err = unpopulate(val, "PeriodSeconds", &c.PeriodSeconds) + delete(rawMsg, key) + case "successThreshold": + err = unpopulate(val, "SuccessThreshold", &c.SuccessThreshold) + delete(rawMsg, key) + case "tcpSocket": + err = unpopulate(val, "TCPSocket", &c.TCPSocket) delete(rawMsg, key) - case "smb": - err = unpopulate(val, "Smb", &c.Smb) + case "terminationGracePeriodSeconds": + err = unpopulate(val, "TerminationGracePeriodSeconds", &c.TerminationGracePeriodSeconds) + delete(rawMsg, key) + case "timeoutSeconds": + err = unpopulate(val, "TimeoutSeconds", &c.TimeoutSeconds) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -2145,15 +1876,19 @@ func (c *ConnectedEnvironmentStorageProperties) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentStoragesCollection. -func (c ConnectedEnvironmentStoragesCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerAppProbeHTTPGet. +func (c ContainerAppProbeHTTPGet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", c.Value) + populate(objectMap, "httpHeaders", c.HTTPHeaders) + populate(objectMap, "host", c.Host) + populate(objectMap, "path", c.Path) + populate(objectMap, "port", c.Port) + populate(objectMap, "scheme", c.Scheme) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedEnvironmentStoragesCollection. -func (c *ConnectedEnvironmentStoragesCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppProbeHTTPGet. +func (c *ContainerAppProbeHTTPGet) 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) @@ -2161,8 +1896,20 @@ func (c *ConnectedEnvironmentStoragesCollection) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &c.Value) + case "httpHeaders": + err = unpopulate(val, "HTTPHeaders", &c.HTTPHeaders) + delete(rawMsg, key) + case "host": + err = unpopulate(val, "Host", &c.Host) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &c.Path) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &c.Port) + delete(rawMsg, key) + case "scheme": + err = unpopulate(val, "Scheme", &c.Scheme) delete(rawMsg, key) } if err != nil { @@ -2172,23 +1919,16 @@ func (c *ConnectedEnvironmentStoragesCollection) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type Container. -func (c Container) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerAppProbeHTTPGetHTTPHeadersItem. +func (c ContainerAppProbeHTTPGetHTTPHeadersItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "args", c.Args) - 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) - populate(objectMap, "volumeMounts", c.VolumeMounts) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Container. -func (c *Container) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppProbeHTTPGetHTTPHeadersItem. +func (c *ContainerAppProbeHTTPGetHTTPHeadersItem) 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) @@ -2196,32 +1936,11 @@ func (c *Container) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "args": - err = unpopulate(val, "Args", &c.Args) - delete(rawMsg, key) - case "command": - err = unpopulate(val, "Command", &c.Command) - delete(rawMsg, key) - case "env": - err = unpopulate(val, "Env", &c.Env) - delete(rawMsg, key) - 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) - case "probes": - err = unpopulate(val, "Probes", &c.Probes) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &c.Resources) - delete(rawMsg, key) - case "volumeMounts": - err = unpopulate(val, "VolumeMounts", &c.VolumeMounts) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -2231,25 +1950,16 @@ func (c *Container) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerApp. -func (c ContainerApp) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerAppProbeTCPSocket. +func (c ContainerAppProbeTCPSocket) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", c.ExtendedLocation) - populate(objectMap, "id", c.ID) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "kind", c.Kind) - populate(objectMap, "location", c.Location) - populate(objectMap, "managedBy", c.ManagedBy) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) + populate(objectMap, "host", c.Host) + populate(objectMap, "port", c.Port) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerApp. -func (c *ContainerApp) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppProbeTCPSocket. +func (c *ContainerAppProbeTCPSocket) 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) @@ -2257,38 +1967,11 @@ func (c *ContainerApp) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &c.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &c.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - delete(rawMsg, key) - case "managedBy": - err = unpopulate(val, "ManagedBy", &c.ManagedBy) - 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 "tags": - err = unpopulate(val, "Tags", &c.Tags) + case "host": + err = unpopulate(val, "Host", &c.Host) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "port": + err = unpopulate(val, "Port", &c.Port) delete(rawMsg, key) } if err != nil { @@ -2298,21 +1981,26 @@ func (c *ContainerApp) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppAuthToken. -func (c ContainerAppAuthToken) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerAppProperties. +func (c ContainerAppProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) + populate(objectMap, "configuration", c.Configuration) + populate(objectMap, "customDomainVerificationId", c.CustomDomainVerificationID) + populate(objectMap, "environmentId", c.EnvironmentID) + populate(objectMap, "eventStreamEndpoint", c.EventStreamEndpoint) + populate(objectMap, "latestReadyRevisionName", c.LatestReadyRevisionName) + populate(objectMap, "latestRevisionFqdn", c.LatestRevisionFqdn) + populate(objectMap, "latestRevisionName", c.LatestRevisionName) + populate(objectMap, "managedEnvironmentId", c.ManagedEnvironmentID) + populate(objectMap, "outboundIpAddresses", c.OutboundIPAddresses) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "template", c.Template) + populate(objectMap, "workloadProfileName", c.WorkloadProfileName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppAuthToken. -func (c *ContainerAppAuthToken) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppProperties. +func (c *ContainerAppProperties) 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) @@ -2320,26 +2008,41 @@ func (c *ContainerAppAuthToken) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) + case "configuration": + err = unpopulate(val, "Configuration", &c.Configuration) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) + case "customDomainVerificationId": + err = unpopulate(val, "CustomDomainVerificationID", &c.CustomDomainVerificationID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &c.EnvironmentID) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "eventStreamEndpoint": + err = unpopulate(val, "EventStreamEndpoint", &c.EventStreamEndpoint) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "latestReadyRevisionName": + err = unpopulate(val, "LatestReadyRevisionName", &c.LatestReadyRevisionName) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + case "latestRevisionFqdn": + err = unpopulate(val, "LatestRevisionFqdn", &c.LatestRevisionFqdn) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "latestRevisionName": + err = unpopulate(val, "LatestRevisionName", &c.LatestRevisionName) + delete(rawMsg, key) + case "managedEnvironmentId": + err = unpopulate(val, "ManagedEnvironmentID", &c.ManagedEnvironmentID) + delete(rawMsg, key) + case "outboundIpAddresses": + err = unpopulate(val, "OutboundIPAddresses", &c.OutboundIPAddresses) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "template": + err = unpopulate(val, "Template", &c.Template) + delete(rawMsg, key) + case "workloadProfileName": + err = unpopulate(val, "WorkloadProfileName", &c.WorkloadProfileName) delete(rawMsg, key) } if err != nil { @@ -2349,16 +2052,18 @@ func (c *ContainerAppAuthToken) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppAuthTokenProperties. -func (c ContainerAppAuthTokenProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerAppSecret. +func (c ContainerAppSecret) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "expires", c.Expires) - populate(objectMap, "token", c.Token) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "keyVaultUrl", c.KeyVaultURL) + populate(objectMap, "name", c.Name) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppAuthTokenProperties. -func (c *ContainerAppAuthTokenProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppSecret. +func (c *ContainerAppSecret) 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) @@ -2366,11 +2071,17 @@ func (c *ContainerAppAuthTokenProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "expires": - err = unpopulateDateTimeRFC3339(val, "Expires", &c.Expires) + case "identity": + err = unpopulate(val, "Identity", &c.Identity) delete(rawMsg, key) - case "token": - err = unpopulate(val, "Token", &c.Token) + case "keyVaultUrl": + err = unpopulate(val, "KeyVaultURL", &c.KeyVaultURL) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -2380,16 +2091,17 @@ func (c *ContainerAppAuthTokenProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppCollection. -func (c ContainerAppCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerResources. +func (c ContainerResources) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "cpu", c.CPU) + populate(objectMap, "ephemeralStorage", c.EphemeralStorage) + populate(objectMap, "memory", c.Memory) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppCollection. -func (c *ContainerAppCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerResources. +func (c *ContainerResources) 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) @@ -2397,11 +2109,14 @@ func (c *ContainerAppCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "cpu": + err = unpopulate(val, "CPU", &c.CPU) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "ephemeralStorage": + err = unpopulate(val, "EphemeralStorage", &c.EphemeralStorage) + delete(rawMsg, key) + case "memory": + err = unpopulate(val, "Memory", &c.Memory) delete(rawMsg, key) } if err != nil { @@ -2411,16 +2126,16 @@ func (c *ContainerAppCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppJobExecutions. -func (c ContainerAppJobExecutions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CookieExpiration. +func (c CookieExpiration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "convention", c.Convention) + populate(objectMap, "timeToExpiration", c.TimeToExpiration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppJobExecutions. -func (c *ContainerAppJobExecutions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CookieExpiration. +func (c *CookieExpiration) 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) @@ -2428,11 +2143,11 @@ func (c *ContainerAppJobExecutions) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "convention": + err = unpopulate(val, "Convention", &c.Convention) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "timeToExpiration": + err = unpopulate(val, "TimeToExpiration", &c.TimeToExpiration) delete(rawMsg, key) } if err != nil { @@ -2442,23 +2157,20 @@ func (c *ContainerAppJobExecutions) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppProbe. -func (c ContainerAppProbe) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CorsPolicy. +func (c CorsPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "failureThreshold", c.FailureThreshold) - populate(objectMap, "httpGet", c.HTTPGet) - populate(objectMap, "initialDelaySeconds", c.InitialDelaySeconds) - populate(objectMap, "periodSeconds", c.PeriodSeconds) - populate(objectMap, "successThreshold", c.SuccessThreshold) - populate(objectMap, "tcpSocket", c.TCPSocket) - populate(objectMap, "terminationGracePeriodSeconds", c.TerminationGracePeriodSeconds) - populate(objectMap, "timeoutSeconds", c.TimeoutSeconds) - populate(objectMap, "type", c.Type) + populate(objectMap, "allowCredentials", c.AllowCredentials) + populate(objectMap, "allowedHeaders", c.AllowedHeaders) + populate(objectMap, "allowedMethods", c.AllowedMethods) + populate(objectMap, "allowedOrigins", c.AllowedOrigins) + populate(objectMap, "exposeHeaders", c.ExposeHeaders) + populate(objectMap, "maxAge", c.MaxAge) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppProbe. -func (c *ContainerAppProbe) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CorsPolicy. +func (c *CorsPolicy) 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) @@ -2466,32 +2178,23 @@ func (c *ContainerAppProbe) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "failureThreshold": - err = unpopulate(val, "FailureThreshold", &c.FailureThreshold) - delete(rawMsg, key) - case "httpGet": - err = unpopulate(val, "HTTPGet", &c.HTTPGet) - delete(rawMsg, key) - case "initialDelaySeconds": - err = unpopulate(val, "InitialDelaySeconds", &c.InitialDelaySeconds) - delete(rawMsg, key) - case "periodSeconds": - err = unpopulate(val, "PeriodSeconds", &c.PeriodSeconds) + case "allowCredentials": + err = unpopulate(val, "AllowCredentials", &c.AllowCredentials) delete(rawMsg, key) - case "successThreshold": - err = unpopulate(val, "SuccessThreshold", &c.SuccessThreshold) + case "allowedHeaders": + err = unpopulate(val, "AllowedHeaders", &c.AllowedHeaders) delete(rawMsg, key) - case "tcpSocket": - err = unpopulate(val, "TCPSocket", &c.TCPSocket) + case "allowedMethods": + err = unpopulate(val, "AllowedMethods", &c.AllowedMethods) delete(rawMsg, key) - case "terminationGracePeriodSeconds": - err = unpopulate(val, "TerminationGracePeriodSeconds", &c.TerminationGracePeriodSeconds) + case "allowedOrigins": + err = unpopulate(val, "AllowedOrigins", &c.AllowedOrigins) delete(rawMsg, key) - case "timeoutSeconds": - err = unpopulate(val, "TimeoutSeconds", &c.TimeoutSeconds) + case "exposeHeaders": + err = unpopulate(val, "ExposeHeaders", &c.ExposeHeaders) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "maxAge": + err = unpopulate(val, "MaxAge", &c.MaxAge) delete(rawMsg, key) } if err != nil { @@ -2501,19 +2204,17 @@ func (c *ContainerAppProbe) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppProbeHTTPGet. -func (c ContainerAppProbeHTTPGet) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomDomain. +func (c CustomDomain) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "httpHeaders", c.HTTPHeaders) - populate(objectMap, "host", c.Host) - populate(objectMap, "path", c.Path) - populate(objectMap, "port", c.Port) - populate(objectMap, "scheme", c.Scheme) + populate(objectMap, "bindingType", c.BindingType) + populate(objectMap, "certificateId", c.CertificateID) + populate(objectMap, "name", c.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppProbeHTTPGet. -func (c *ContainerAppProbeHTTPGet) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomain. +func (c *CustomDomain) 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) @@ -2521,20 +2222,14 @@ func (c *ContainerAppProbeHTTPGet) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "httpHeaders": - err = unpopulate(val, "HTTPHeaders", &c.HTTPHeaders) - delete(rawMsg, key) - case "host": - err = unpopulate(val, "Host", &c.Host) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &c.Path) + case "bindingType": + err = unpopulate(val, "BindingType", &c.BindingType) delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &c.Port) + case "certificateId": + err = unpopulate(val, "CertificateID", &c.CertificateID) delete(rawMsg, key) - case "scheme": - err = unpopulate(val, "Scheme", &c.Scheme) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) } if err != nil { @@ -2544,16 +2239,23 @@ func (c *ContainerAppProbeHTTPGet) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppProbeHTTPGetHTTPHeadersItem. -func (c ContainerAppProbeHTTPGetHTTPHeadersItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomDomainConfiguration. +func (c CustomDomainConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "value", c.Value) + populate(objectMap, "certificatePassword", c.CertificatePassword) + populateByteArray(objectMap, "certificateValue", c.CertificateValue, func() any { + return runtime.EncodeByteArray(c.CertificateValue, runtime.Base64StdFormat) + }) + populate(objectMap, "customDomainVerificationId", c.CustomDomainVerificationID) + populate(objectMap, "dnsSuffix", c.DNSSuffix) + populateDateTimeRFC3339(objectMap, "expirationDate", c.ExpirationDate) + populate(objectMap, "subjectName", c.SubjectName) + populate(objectMap, "thumbprint", c.Thumbprint) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppProbeHTTPGetHTTPHeadersItem. -func (c *ContainerAppProbeHTTPGetHTTPHeadersItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainConfiguration. +func (c *CustomDomainConfiguration) 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) @@ -2561,11 +2263,28 @@ func (c *ContainerAppProbeHTTPGetHTTPHeadersItem) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) + case "certificatePassword": + err = unpopulate(val, "CertificatePassword", &c.CertificatePassword) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "certificateValue": + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &c.CertificateValue, runtime.Base64StdFormat) + } + delete(rawMsg, key) + case "customDomainVerificationId": + err = unpopulate(val, "CustomDomainVerificationID", &c.CustomDomainVerificationID) + delete(rawMsg, key) + case "dnsSuffix": + err = unpopulate(val, "DNSSuffix", &c.DNSSuffix) + delete(rawMsg, key) + case "expirationDate": + err = unpopulateDateTimeRFC3339(val, "ExpirationDate", &c.ExpirationDate) + delete(rawMsg, key) + case "subjectName": + err = unpopulate(val, "SubjectName", &c.SubjectName) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) delete(rawMsg, key) } if err != nil { @@ -2575,59 +2294,26 @@ func (c *ContainerAppProbeHTTPGetHTTPHeadersItem) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppProbeTCPSocket. -func (c ContainerAppProbeTCPSocket) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomHostnameAnalysisResult. +func (c CustomHostnameAnalysisResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "host", c.Host) - populate(objectMap, "port", c.Port) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppProbeTCPSocket. -func (c *ContainerAppProbeTCPSocket) 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 "host": - err = unpopulate(val, "Host", &c.Host) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &c.Port) - 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 ContainerAppProperties. -func (c ContainerAppProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "configuration", c.Configuration) - populate(objectMap, "customDomainVerificationId", c.CustomDomainVerificationID) - populate(objectMap, "deploymentErrors", c.DeploymentErrors) - populate(objectMap, "environmentId", c.EnvironmentID) - populate(objectMap, "eventStreamEndpoint", c.EventStreamEndpoint) - populate(objectMap, "latestReadyRevisionName", c.LatestReadyRevisionName) - populate(objectMap, "latestRevisionFqdn", c.LatestRevisionFqdn) - 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) + populate(objectMap, "aRecords", c.ARecords) + populate(objectMap, "alternateCNameRecords", c.AlternateCNameRecords) + populate(objectMap, "alternateTxtRecords", c.AlternateTxtRecords) + populate(objectMap, "cNameRecords", c.CNameRecords) + populate(objectMap, "conflictWithEnvironmentCustomDomain", c.ConflictWithEnvironmentCustomDomain) + populate(objectMap, "conflictingContainerAppResourceId", c.ConflictingContainerAppResourceID) + populate(objectMap, "customDomainVerificationFailureInfo", c.CustomDomainVerificationFailureInfo) + populate(objectMap, "customDomainVerificationTest", c.CustomDomainVerificationTest) + populate(objectMap, "hasConflictOnManagedEnvironment", c.HasConflictOnManagedEnvironment) + populate(objectMap, "hostName", c.HostName) + populate(objectMap, "isHostnameAlreadyVerified", c.IsHostnameAlreadyVerified) + populate(objectMap, "txtRecords", c.TxtRecords) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppProperties. -func (c *ContainerAppProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomHostnameAnalysisResult. +func (c *CustomHostnameAnalysisResult) 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) @@ -2635,47 +2321,41 @@ func (c *ContainerAppProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "configuration": - err = unpopulate(val, "Configuration", &c.Configuration) - delete(rawMsg, key) - case "customDomainVerificationId": - err = unpopulate(val, "CustomDomainVerificationID", &c.CustomDomainVerificationID) - delete(rawMsg, key) - case "deploymentErrors": - err = unpopulate(val, "DeploymentErrors", &c.DeploymentErrors) + case "aRecords": + err = unpopulate(val, "ARecords", &c.ARecords) delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &c.EnvironmentID) + case "alternateCNameRecords": + err = unpopulate(val, "AlternateCNameRecords", &c.AlternateCNameRecords) delete(rawMsg, key) - case "eventStreamEndpoint": - err = unpopulate(val, "EventStreamEndpoint", &c.EventStreamEndpoint) + case "alternateTxtRecords": + err = unpopulate(val, "AlternateTxtRecords", &c.AlternateTxtRecords) delete(rawMsg, key) - case "latestReadyRevisionName": - err = unpopulate(val, "LatestReadyRevisionName", &c.LatestReadyRevisionName) + case "cNameRecords": + err = unpopulate(val, "CNameRecords", &c.CNameRecords) delete(rawMsg, key) - case "latestRevisionFqdn": - err = unpopulate(val, "LatestRevisionFqdn", &c.LatestRevisionFqdn) + case "conflictWithEnvironmentCustomDomain": + err = unpopulate(val, "ConflictWithEnvironmentCustomDomain", &c.ConflictWithEnvironmentCustomDomain) delete(rawMsg, key) - case "latestRevisionName": - err = unpopulate(val, "LatestRevisionName", &c.LatestRevisionName) + case "conflictingContainerAppResourceId": + err = unpopulate(val, "ConflictingContainerAppResourceID", &c.ConflictingContainerAppResourceID) delete(rawMsg, key) - case "managedEnvironmentId": - err = unpopulate(val, "ManagedEnvironmentID", &c.ManagedEnvironmentID) + case "customDomainVerificationFailureInfo": + err = unpopulate(val, "CustomDomainVerificationFailureInfo", &c.CustomDomainVerificationFailureInfo) delete(rawMsg, key) - case "outboundIpAddresses": - err = unpopulate(val, "OutboundIPAddresses", &c.OutboundIPAddresses) + case "customDomainVerificationTest": + err = unpopulate(val, "CustomDomainVerificationTest", &c.CustomDomainVerificationTest) delete(rawMsg, key) - case "patchingConfiguration": - err = unpopulate(val, "PatchingConfiguration", &c.PatchingConfiguration) + case "hasConflictOnManagedEnvironment": + err = unpopulate(val, "HasConflictOnManagedEnvironment", &c.HasConflictOnManagedEnvironment) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + case "hostName": + err = unpopulate(val, "HostName", &c.HostName) delete(rawMsg, key) - case "template": - err = unpopulate(val, "Template", &c.Template) + case "isHostnameAlreadyVerified": + err = unpopulate(val, "IsHostnameAlreadyVerified", &c.IsHostnameAlreadyVerified) delete(rawMsg, key) - case "workloadProfileName": - err = unpopulate(val, "WorkloadProfileName", &c.WorkloadProfileName) + case "txtRecords": + err = unpopulate(val, "TxtRecords", &c.TxtRecords) delete(rawMsg, key) } if err != nil { @@ -2685,15 +2365,18 @@ func (c *ContainerAppProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppPropertiesPatchingConfiguration. -func (c ContainerAppPropertiesPatchingConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo. +func (c CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "patchingMode", c.PatchingMode) + populate(objectMap, "code", c.Code) + populate(objectMap, "details", c.Details) + populate(objectMap, "message", c.Message) + populate(objectMap, "target", c.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppPropertiesPatchingConfiguration. -func (c *ContainerAppPropertiesPatchingConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo. +func (c *CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo) 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) @@ -2701,8 +2384,17 @@ func (c *ContainerAppPropertiesPatchingConfiguration) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "patchingMode": - err = unpopulate(val, "PatchingMode", &c.PatchingMode) + case "code": + err = unpopulate(val, "Code", &c.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &c.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &c.Target) delete(rawMsg, key) } if err != nil { @@ -2712,18 +2404,17 @@ func (c *ContainerAppPropertiesPatchingConfiguration) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppSecret. -func (c ContainerAppSecret) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem. +func (c CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "keyVaultUrl", c.KeyVaultURL) - populate(objectMap, "name", c.Name) - populate(objectMap, "value", c.Value) + populate(objectMap, "code", c.Code) + populate(objectMap, "message", c.Message) + populate(objectMap, "target", c.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppSecret. -func (c *ContainerAppSecret) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem. +func (c *CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem) 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) @@ -2731,17 +2422,14 @@ func (c *ContainerAppSecret) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) - case "keyVaultUrl": - err = unpopulate(val, "KeyVaultURL", &c.KeyVaultURL) + case "code": + err = unpopulate(val, "Code", &c.Code) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "message": + err = unpopulate(val, "Message", &c.Message) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "target": + err = unpopulate(val, "Target", &c.Target) delete(rawMsg, key) } if err != nil { @@ -2751,16 +2439,17 @@ func (c *ContainerAppSecret) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppsBuildCollection. -func (c ContainerAppsBuildCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomOpenIDConnectProvider. +func (c CustomOpenIDConnectProvider) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "enabled", c.Enabled) + populate(objectMap, "login", c.Login) + populate(objectMap, "registration", c.Registration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppsBuildCollection. -func (c *ContainerAppsBuildCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomOpenIDConnectProvider. +func (c *CustomOpenIDConnectProvider) 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) @@ -2768,11 +2457,14 @@ func (c *ContainerAppsBuildCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "enabled": + err = unpopulate(val, "Enabled", &c.Enabled) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "login": + err = unpopulate(val, "Login", &c.Login) + delete(rawMsg, key) + case "registration": + err = unpopulate(val, "Registration", &c.Registration) delete(rawMsg, key) } if err != nil { @@ -2782,19 +2474,18 @@ func (c *ContainerAppsBuildCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppsBuildConfiguration. -func (c ContainerAppsBuildConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomScaleRule. +func (c CustomScaleRule) 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) + populate(objectMap, "auth", c.Auth) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "metadata", c.Metadata) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppsBuildConfiguration. -func (c *ContainerAppsBuildConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomScaleRule. +func (c *CustomScaleRule) 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) @@ -2802,20 +2493,17 @@ func (c *ContainerAppsBuildConfiguration) UnmarshalJSON(data []byte) error { 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) + case "auth": + err = unpopulate(val, "Auth", &c.Auth) delete(rawMsg, key) - case "platform": - err = unpopulate(val, "Platform", &c.Platform) + case "identity": + err = unpopulate(val, "Identity", &c.Identity) delete(rawMsg, key) - case "platformVersion": - err = unpopulate(val, "PlatformVersion", &c.PlatformVersion) + case "metadata": + err = unpopulate(val, "Metadata", &c.Metadata) delete(rawMsg, key) - case "preBuildSteps": - err = unpopulate(val, "PreBuildSteps", &c.PreBuildSteps) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -2825,713 +2513,627 @@ func (c *ContainerAppsBuildConfiguration) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppsBuildProperties. -func (c ContainerAppsBuildProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Dapr. +func (d Dapr) 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) + populate(objectMap, "appId", d.AppID) + populate(objectMap, "appPort", d.AppPort) + populate(objectMap, "appProtocol", d.AppProtocol) + populate(objectMap, "enableApiLogging", d.EnableAPILogging) + populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "httpMaxRequestSize", d.HTTPMaxRequestSize) + populate(objectMap, "httpReadBufferSize", d.HTTPReadBufferSize) + populate(objectMap, "logLevel", d.LogLevel) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppsBuildProperties. -func (c *ContainerAppsBuildProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Dapr. +func (d *Dapr) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "buildStatus": - err = unpopulate(val, "BuildStatus", &c.BuildStatus) + case "appId": + err = unpopulate(val, "AppID", &d.AppID) delete(rawMsg, key) - case "configuration": - err = unpopulate(val, "Configuration", &c.Configuration) + case "appPort": + err = unpopulate(val, "AppPort", &d.AppPort) delete(rawMsg, key) - case "destinationContainerRegistry": - err = unpopulate(val, "DestinationContainerRegistry", &c.DestinationContainerRegistry) + case "appProtocol": + err = unpopulate(val, "AppProtocol", &d.AppProtocol) delete(rawMsg, key) - case "logStreamEndpoint": - err = unpopulate(val, "LogStreamEndpoint", &c.LogStreamEndpoint) + case "enableApiLogging": + err = unpopulate(val, "EnableAPILogging", &d.EnableAPILogging) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + case "httpMaxRequestSize": + err = unpopulate(val, "HTTPMaxRequestSize", &d.HTTPMaxRequestSize) + delete(rawMsg, key) + case "httpReadBufferSize": + err = unpopulate(val, "HTTPReadBufferSize", &d.HTTPReadBufferSize) + delete(rawMsg, key) + case "logLevel": + err = unpopulate(val, "LogLevel", &d.LogLevel) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppsBuildResource. -func (c ContainerAppsBuildResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DaprComponent. +func (d DaprComponent) 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) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppsBuildResource. -func (c *ContainerAppsBuildResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponent. +func (d *DaprComponent) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &c.ID) + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &c.Name) + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &c.Properties) + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &c.Type) + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppsPatchResource. -func (c ContainerAppsPatchResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DaprComponentProperties. +func (d DaprComponentProperties) 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) + populate(objectMap, "componentType", d.ComponentType) + populate(objectMap, "ignoreErrors", d.IgnoreErrors) + populate(objectMap, "initTimeout", d.InitTimeout) + populate(objectMap, "metadata", d.Metadata) + populate(objectMap, "scopes", d.Scopes) + populate(objectMap, "secretStoreComponent", d.SecretStoreComponent) + populate(objectMap, "secrets", d.Secrets) + populate(objectMap, "version", d.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerAppsPatchResource. -func (c *ContainerAppsPatchResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentProperties. +func (d *DaprComponentProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) + case "componentType": + err = unpopulate(val, "ComponentType", &d.ComponentType) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "ignoreErrors": + err = unpopulate(val, "IgnoreErrors", &d.IgnoreErrors) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "initTimeout": + err = unpopulate(val, "InitTimeout", &d.InitTimeout) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "metadata": + err = unpopulate(val, "Metadata", &d.Metadata) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "scopes": + err = unpopulate(val, "Scopes", &d.Scopes) + delete(rawMsg, key) + case "secretStoreComponent": + err = unpopulate(val, "SecretStoreComponent", &d.SecretStoreComponent) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &d.Secrets) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &d.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerExecutionStatus. -func (c ContainerExecutionStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DaprComponentsCollection. +func (d DaprComponentsCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "additionalInformation", c.AdditionalInformation) - populate(objectMap, "code", c.Code) - populate(objectMap, "name", c.Name) - populate(objectMap, "status", c.Status) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerExecutionStatus. -func (c *ContainerExecutionStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentsCollection. +func (d *DaprComponentsCollection) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "additionalInformation": - err = unpopulate(val, "AdditionalInformation", &c.AdditionalInformation) - delete(rawMsg, key) - case "code": - err = unpopulate(val, "Code", &c.Code) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerRegistry. -func (c ContainerRegistry) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DaprConfiguration. +func (d DaprConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "containerRegistryServer", c.ContainerRegistryServer) - populate(objectMap, "identityResourceId", c.IdentityResourceID) + populate(objectMap, "version", d.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerRegistry. -func (c *ContainerRegistry) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprConfiguration. +func (d *DaprConfiguration) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "containerRegistryServer": - err = unpopulate(val, "ContainerRegistryServer", &c.ContainerRegistryServer) - delete(rawMsg, key) - case "identityResourceId": - err = unpopulate(val, "IdentityResourceID", &c.IdentityResourceID) + case "version": + err = unpopulate(val, "Version", &d.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryWithCustomImage. -func (c ContainerRegistryWithCustomImage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DaprMetadata. +func (d DaprMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "image", c.Image) - populate(objectMap, "server", c.Server) + populate(objectMap, "name", d.Name) + populate(objectMap, "secretRef", d.SecretRef) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerRegistryWithCustomImage. -func (c *ContainerRegistryWithCustomImage) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprMetadata. +func (d *DaprMetadata) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "image": - err = unpopulate(val, "Image", &c.Image) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &c.Server) + case "secretRef": + err = unpopulate(val, "SecretRef", &d.SecretRef) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerResources. -func (c ContainerResources) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DaprSecret. +func (d DaprSecret) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cpu", c.CPU) - populate(objectMap, "ephemeralStorage", c.EphemeralStorage) - populate(objectMap, "memory", c.Memory) + populate(objectMap, "name", d.Name) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerResources. -func (c *ContainerResources) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSecret. +func (d *DaprSecret) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "cpu": - err = unpopulate(val, "CPU", &c.CPU) - delete(rawMsg, key) - case "ephemeralStorage": - err = unpopulate(val, "EphemeralStorage", &c.EphemeralStorage) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "memory": - err = unpopulate(val, "Memory", &c.Memory) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CookieExpiration. -func (c CookieExpiration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DaprSecretsCollection. +func (d DaprSecretsCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "convention", c.Convention) - populate(objectMap, "timeToExpiration", c.TimeToExpiration) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CookieExpiration. -func (c *CookieExpiration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSecretsCollection. +func (d *DaprSecretsCollection) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "convention": - err = unpopulate(val, "Convention", &c.Convention) - delete(rawMsg, key) - case "timeToExpiration": - err = unpopulate(val, "TimeToExpiration", &c.TimeToExpiration) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CorsPolicy. -func (c CorsPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefaultAuthorizationPolicy. +func (d DefaultAuthorizationPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowCredentials", c.AllowCredentials) - populate(objectMap, "allowedHeaders", c.AllowedHeaders) - populate(objectMap, "allowedMethods", c.AllowedMethods) - populate(objectMap, "allowedOrigins", c.AllowedOrigins) - populate(objectMap, "exposeHeaders", c.ExposeHeaders) - populate(objectMap, "maxAge", c.MaxAge) + populate(objectMap, "allowedApplications", d.AllowedApplications) + populate(objectMap, "allowedPrincipals", d.AllowedPrincipals) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CorsPolicy. -func (c *CorsPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultAuthorizationPolicy. +func (d *DefaultAuthorizationPolicy) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "allowCredentials": - err = unpopulate(val, "AllowCredentials", &c.AllowCredentials) - delete(rawMsg, key) - case "allowedHeaders": - err = unpopulate(val, "AllowedHeaders", &c.AllowedHeaders) - delete(rawMsg, key) - case "allowedMethods": - err = unpopulate(val, "AllowedMethods", &c.AllowedMethods) - delete(rawMsg, key) - case "allowedOrigins": - err = unpopulate(val, "AllowedOrigins", &c.AllowedOrigins) - delete(rawMsg, key) - case "exposeHeaders": - err = unpopulate(val, "ExposeHeaders", &c.ExposeHeaders) + case "allowedApplications": + err = unpopulate(val, "AllowedApplications", &d.AllowedApplications) delete(rawMsg, key) - case "maxAge": - err = unpopulate(val, "MaxAge", &c.MaxAge) + case "allowedPrincipals": + err = unpopulate(val, "AllowedPrincipals", &d.AllowedPrincipals) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomContainerTemplate. -func (c CustomContainerTemplate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefaultErrorResponse. +func (d DefaultErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "containers", c.Containers) - populate(objectMap, "ingress", c.Ingress) - populate(objectMap, "registryCredentials", c.RegistryCredentials) + populate(objectMap, "error", d.Error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomContainerTemplate. -func (c *CustomContainerTemplate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultErrorResponse. +func (d *DefaultErrorResponse) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "containers": - err = unpopulate(val, "Containers", &c.Containers) - delete(rawMsg, key) - case "ingress": - err = unpopulate(val, "Ingress", &c.Ingress) - delete(rawMsg, key) - case "registryCredentials": - err = unpopulate(val, "RegistryCredentials", &c.RegistryCredentials) + case "error": + err = unpopulate(val, "Error", &d.Error) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomDomain. -func (c CustomDomain) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefaultErrorResponseError. +func (d DefaultErrorResponseError) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bindingType", c.BindingType) - populate(objectMap, "certificateId", c.CertificateID) - populate(objectMap, "name", c.Name) + populate(objectMap, "code", d.Code) + populate(objectMap, "details", d.Details) + populate(objectMap, "innererror", d.Innererror) + populate(objectMap, "message", d.Message) + populate(objectMap, "target", d.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomain. -func (c *CustomDomain) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultErrorResponseError. +func (d *DefaultErrorResponseError) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "bindingType": - err = unpopulate(val, "BindingType", &c.BindingType) + case "code": + err = unpopulate(val, "Code", &d.Code) delete(rawMsg, key) - case "certificateId": - err = unpopulate(val, "CertificateID", &c.CertificateID) + case "details": + err = unpopulate(val, "Details", &d.Details) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "innererror": + err = unpopulate(val, "Innererror", &d.Innererror) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } + case "message": + err = unpopulate(val, "Message", &d.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &d.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomDomainConfiguration. -func (c CustomDomainConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefaultErrorResponseErrorDetailsItem. +func (d DefaultErrorResponseErrorDetailsItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "certificateKeyVaultProperties", c.CertificateKeyVaultProperties) - populate(objectMap, "certificatePassword", c.CertificatePassword) - populateByteArray(objectMap, "certificateValue", c.CertificateValue, func() any { - return runtime.EncodeByteArray(c.CertificateValue, runtime.Base64StdFormat) - }) - populate(objectMap, "customDomainVerificationId", c.CustomDomainVerificationID) - populate(objectMap, "dnsSuffix", c.DNSSuffix) - populateDateTimeRFC3339(objectMap, "expirationDate", c.ExpirationDate) - populate(objectMap, "subjectName", c.SubjectName) - populate(objectMap, "thumbprint", c.Thumbprint) + populate(objectMap, "code", d.Code) + populate(objectMap, "message", d.Message) + populate(objectMap, "target", d.Target) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainConfiguration. -func (c *CustomDomainConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultErrorResponseErrorDetailsItem. +func (d *DefaultErrorResponseErrorDetailsItem) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "certificateKeyVaultProperties": - err = unpopulate(val, "CertificateKeyVaultProperties", &c.CertificateKeyVaultProperties) - delete(rawMsg, key) - case "certificatePassword": - err = unpopulate(val, "CertificatePassword", &c.CertificatePassword) - delete(rawMsg, key) - case "certificateValue": - if val != nil && string(val) != "null" { - err = runtime.DecodeByteArray(string(val), &c.CertificateValue, runtime.Base64StdFormat) - } - delete(rawMsg, key) - case "customDomainVerificationId": - err = unpopulate(val, "CustomDomainVerificationID", &c.CustomDomainVerificationID) - delete(rawMsg, key) - case "dnsSuffix": - err = unpopulate(val, "DNSSuffix", &c.DNSSuffix) - delete(rawMsg, key) - case "expirationDate": - err = unpopulateDateTimeRFC3339(val, "ExpirationDate", &c.ExpirationDate) + case "code": + err = unpopulate(val, "Code", &d.Code) delete(rawMsg, key) - case "subjectName": - err = unpopulate(val, "SubjectName", &c.SubjectName) + case "message": + err = unpopulate(val, "Message", &d.Message) delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) + case "target": + err = unpopulate(val, "Target", &d.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomHostnameAnalysisResult. -func (c CustomHostnameAnalysisResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticDataProviderMetadata. +func (d DiagnosticDataProviderMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "aRecords", c.ARecords) - populate(objectMap, "alternateCNameRecords", c.AlternateCNameRecords) - populate(objectMap, "alternateTxtRecords", c.AlternateTxtRecords) - populate(objectMap, "cNameRecords", c.CNameRecords) - populate(objectMap, "conflictWithEnvironmentCustomDomain", c.ConflictWithEnvironmentCustomDomain) - populate(objectMap, "conflictingContainerAppResourceId", c.ConflictingContainerAppResourceID) - populate(objectMap, "customDomainVerificationFailureInfo", c.CustomDomainVerificationFailureInfo) - populate(objectMap, "customDomainVerificationTest", c.CustomDomainVerificationTest) - populate(objectMap, "hasConflictOnManagedEnvironment", c.HasConflictOnManagedEnvironment) - populate(objectMap, "hostName", c.HostName) - populate(objectMap, "isHostnameAlreadyVerified", c.IsHostnameAlreadyVerified) - populate(objectMap, "txtRecords", c.TxtRecords) + populate(objectMap, "propertyBag", d.PropertyBag) + populate(objectMap, "providerName", d.ProviderName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomHostnameAnalysisResult. -func (c *CustomHostnameAnalysisResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticDataProviderMetadata. +func (d *DiagnosticDataProviderMetadata) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "aRecords": - err = unpopulate(val, "ARecords", &c.ARecords) - delete(rawMsg, key) - case "alternateCNameRecords": - err = unpopulate(val, "AlternateCNameRecords", &c.AlternateCNameRecords) - delete(rawMsg, key) - case "alternateTxtRecords": - err = unpopulate(val, "AlternateTxtRecords", &c.AlternateTxtRecords) - delete(rawMsg, key) - case "cNameRecords": - err = unpopulate(val, "CNameRecords", &c.CNameRecords) - delete(rawMsg, key) - case "conflictWithEnvironmentCustomDomain": - err = unpopulate(val, "ConflictWithEnvironmentCustomDomain", &c.ConflictWithEnvironmentCustomDomain) - delete(rawMsg, key) - case "conflictingContainerAppResourceId": - err = unpopulate(val, "ConflictingContainerAppResourceID", &c.ConflictingContainerAppResourceID) - delete(rawMsg, key) - case "customDomainVerificationFailureInfo": - err = unpopulate(val, "CustomDomainVerificationFailureInfo", &c.CustomDomainVerificationFailureInfo) - delete(rawMsg, key) - case "customDomainVerificationTest": - err = unpopulate(val, "CustomDomainVerificationTest", &c.CustomDomainVerificationTest) - delete(rawMsg, key) - case "hasConflictOnManagedEnvironment": - err = unpopulate(val, "HasConflictOnManagedEnvironment", &c.HasConflictOnManagedEnvironment) - delete(rawMsg, key) - case "hostName": - err = unpopulate(val, "HostName", &c.HostName) - delete(rawMsg, key) - case "isHostnameAlreadyVerified": - err = unpopulate(val, "IsHostnameAlreadyVerified", &c.IsHostnameAlreadyVerified) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &d.PropertyBag) delete(rawMsg, key) - case "txtRecords": - err = unpopulate(val, "TxtRecords", &c.TxtRecords) + case "providerName": + err = unpopulate(val, "ProviderName", &d.ProviderName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo. -func (c CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticDataProviderMetadataPropertyBagItem. +func (d DiagnosticDataProviderMetadataPropertyBagItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", c.Code) - populate(objectMap, "details", c.Details) - populate(objectMap, "message", c.Message) - populate(objectMap, "target", c.Target) + populate(objectMap, "name", d.Name) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo. -func (c *CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticDataProviderMetadataPropertyBagItem. +func (d *DiagnosticDataProviderMetadataPropertyBagItem) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &c.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &c.Details) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &c.Message) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &c.Target) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem. -func (c CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticDataTableResponseColumn. +func (d DiagnosticDataTableResponseColumn) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", c.Code) - populate(objectMap, "message", c.Message) - populate(objectMap, "target", c.Target) + populate(objectMap, "columnName", d.ColumnName) + populate(objectMap, "columnType", d.ColumnType) + populate(objectMap, "dataType", d.DataType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem. -func (c *CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticDataTableResponseColumn. +func (d *DiagnosticDataTableResponseColumn) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &c.Code) + case "columnName": + err = unpopulate(val, "ColumnName", &d.ColumnName) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &c.Message) + case "columnType": + err = unpopulate(val, "ColumnType", &d.ColumnType) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &c.Target) + case "dataType": + err = unpopulate(val, "DataType", &d.DataType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomOpenIDConnectProvider. -func (c CustomOpenIDConnectProvider) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticDataTableResponseObject. +func (d DiagnosticDataTableResponseObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", c.Enabled) - populate(objectMap, "login", c.Login) - populate(objectMap, "registration", c.Registration) + populate(objectMap, "columns", d.Columns) + populate(objectMap, "rows", d.Rows) + populate(objectMap, "tableName", d.TableName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomOpenIDConnectProvider. -func (c *CustomOpenIDConnectProvider) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticDataTableResponseObject. +func (d *DiagnosticDataTableResponseObject) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &c.Enabled) + case "columns": + err = unpopulate(val, "Columns", &d.Columns) delete(rawMsg, key) - case "login": - err = unpopulate(val, "Login", &c.Login) + case "rows": + err = unpopulate(val, "Rows", &d.Rows) delete(rawMsg, key) - case "registration": - err = unpopulate(val, "Registration", &c.Registration) + case "tableName": + err = unpopulate(val, "TableName", &d.TableName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomScaleRule. -func (c CustomScaleRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticRendering. +func (d DiagnosticRendering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "auth", c.Auth) - populate(objectMap, "identity", c.Identity) - populate(objectMap, "metadata", c.Metadata) - populate(objectMap, "type", c.Type) + populate(objectMap, "description", d.Description) + populate(objectMap, "isVisible", d.IsVisible) + populate(objectMap, "title", d.Title) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomScaleRule. -func (c *CustomScaleRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticRendering. +func (d *DiagnosticRendering) 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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "auth": - err = unpopulate(val, "Auth", &c.Auth) + case "description": + err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) + case "isVisible": + err = unpopulate(val, "IsVisible", &d.IsVisible) delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &c.Metadata) + case "title": + err = unpopulate(val, "Title", &d.Title) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &c.Type) + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Dapr. -func (d Dapr) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticSupportTopic. +func (d DiagnosticSupportTopic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "appId", d.AppID) - populate(objectMap, "appPort", d.AppPort) - populate(objectMap, "appProtocol", d.AppProtocol) - populate(objectMap, "enableApiLogging", d.EnableAPILogging) - populate(objectMap, "enabled", d.Enabled) - populate(objectMap, "httpMaxRequestSize", d.HTTPMaxRequestSize) - populate(objectMap, "httpReadBufferSize", d.HTTPReadBufferSize) - populate(objectMap, "logLevel", d.LogLevel) + populate(objectMap, "id", d.ID) + populate(objectMap, "pesId", d.PesID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Dapr. -func (d *Dapr) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticSupportTopic. +func (d *DiagnosticSupportTopic) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -3539,29 +3141,11 @@ func (d *Dapr) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "appId": - err = unpopulate(val, "AppID", &d.AppID) - delete(rawMsg, key) - case "appPort": - err = unpopulate(val, "AppPort", &d.AppPort) - delete(rawMsg, key) - case "appProtocol": - err = unpopulate(val, "AppProtocol", &d.AppProtocol) - delete(rawMsg, key) - case "enableApiLogging": - err = unpopulate(val, "EnableAPILogging", &d.EnableAPILogging) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) - delete(rawMsg, key) - case "httpMaxRequestSize": - err = unpopulate(val, "HTTPMaxRequestSize", &d.HTTPMaxRequestSize) - delete(rawMsg, key) - case "httpReadBufferSize": - err = unpopulate(val, "HTTPReadBufferSize", &d.HTTPReadBufferSize) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "logLevel": - err = unpopulate(val, "LogLevel", &d.LogLevel) + case "pesId": + err = unpopulate(val, "PesID", &d.PesID) delete(rawMsg, key) } if err != nil { @@ -3571,8 +3155,8 @@ func (d *Dapr) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprComponent. -func (d DaprComponent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Diagnostics. +func (d Diagnostics) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) @@ -3582,8 +3166,8 @@ func (d DaprComponent) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponent. -func (d *DaprComponent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Diagnostics. +func (d *Diagnostics) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -3614,23 +3198,16 @@ func (d *DaprComponent) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprComponentProperties. -func (d DaprComponentProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticsCollection. +func (d DiagnosticsCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "componentType", d.ComponentType) - populate(objectMap, "ignoreErrors", d.IgnoreErrors) - populate(objectMap, "initTimeout", d.InitTimeout) - populate(objectMap, "metadata", d.Metadata) - populate(objectMap, "scopes", d.Scopes) - populate(objectMap, "secretStoreComponent", d.SecretStoreComponent) - populate(objectMap, "secrets", d.Secrets) - populate(objectMap, "serviceComponentBind", d.ServiceComponentBind) - populate(objectMap, "version", d.Version) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentProperties. -func (d *DaprComponentProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsCollection. +func (d *DiagnosticsCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -3638,32 +3215,11 @@ func (d *DaprComponentProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "componentType": - err = unpopulate(val, "ComponentType", &d.ComponentType) - delete(rawMsg, key) - case "ignoreErrors": - err = unpopulate(val, "IgnoreErrors", &d.IgnoreErrors) - delete(rawMsg, key) - case "initTimeout": - err = unpopulate(val, "InitTimeout", &d.InitTimeout) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) - case "scopes": - err = unpopulate(val, "Scopes", &d.Scopes) - delete(rawMsg, key) - case "secretStoreComponent": - err = unpopulate(val, "SecretStoreComponent", &d.SecretStoreComponent) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &d.Secrets) - delete(rawMsg, key) - case "serviceComponentBind": - err = unpopulate(val, "ServiceComponentBind", &d.ServiceComponentBind) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &d.Version) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { @@ -3673,16 +3229,16 @@ func (d *DaprComponentProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprComponentResiliencyPoliciesCollection. -func (d DaprComponentResiliencyPoliciesCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticsDataAPIResponse. +func (d DiagnosticsDataAPIResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "renderingProperties", d.RenderingProperties) + populate(objectMap, "table", d.Table) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPoliciesCollection. -func (d *DaprComponentResiliencyPoliciesCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsDataAPIResponse. +func (d *DiagnosticsDataAPIResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -3690,11 +3246,11 @@ func (d *DaprComponentResiliencyPoliciesCollection) UnmarshalJSON(data []byte) e for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "renderingProperties": + err = unpopulate(val, "RenderingProperties", &d.RenderingProperties) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "table": + err = unpopulate(val, "Table", &d.Table) delete(rawMsg, key) } if err != nil { @@ -3704,19 +3260,23 @@ func (d *DaprComponentResiliencyPoliciesCollection) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprComponentResiliencyPolicy. -func (d DaprComponentResiliencyPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticsDefinition. +func (d DiagnosticsDefinition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "analysisTypes", d.AnalysisTypes) + populate(objectMap, "author", d.Author) + populate(objectMap, "category", d.Category) + populate(objectMap, "description", d.Description) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "score", d.Score) + populate(objectMap, "supportTopicList", d.SupportTopicList) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicy. -func (d *DaprComponentResiliencyPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsDefinition. +func (d *DiagnosticsDefinition) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -3724,17 +3284,29 @@ func (d *DaprComponentResiliencyPolicy) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "analysisTypes": + err = unpopulate(val, "AnalysisTypes", &d.AnalysisTypes) + delete(rawMsg, key) + case "author": + err = unpopulate(val, "Author", &d.Author) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &d.Category) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "score": + err = unpopulate(val, "Score", &d.Score) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + case "supportTopicList": + err = unpopulate(val, "SupportTopicList", &d.SupportTopicList) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &d.Type) @@ -3747,17 +3319,18 @@ func (d *DaprComponentResiliencyPolicy) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration. -func (d DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticsProperties. +func (d DiagnosticsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "consecutiveErrors", d.ConsecutiveErrors) - populate(objectMap, "intervalInSeconds", d.IntervalInSeconds) - populate(objectMap, "timeoutInSeconds", d.TimeoutInSeconds) + populate(objectMap, "dataProviderMetadata", d.DataProviderMetadata) + populate(objectMap, "dataset", d.Dataset) + populate(objectMap, "metadata", d.Metadata) + populate(objectMap, "status", d.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration. -func (d *DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsProperties. +func (d *DiagnosticsProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -3765,14 +3338,17 @@ func (d *DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration) Unmarsh for key, val := range rawMsg { var err error switch key { - case "consecutiveErrors": - err = unpopulate(val, "ConsecutiveErrors", &d.ConsecutiveErrors) + case "dataProviderMetadata": + err = unpopulate(val, "DataProviderMetadata", &d.DataProviderMetadata) + delete(rawMsg, key) + case "dataset": + err = unpopulate(val, "Dataset", &d.Dataset) delete(rawMsg, key) - case "intervalInSeconds": - err = unpopulate(val, "IntervalInSeconds", &d.IntervalInSeconds) + case "metadata": + err = unpopulate(val, "Metadata", &d.Metadata) delete(rawMsg, key) - case "timeoutInSeconds": - err = unpopulate(val, "TimeoutInSeconds", &d.TimeoutInSeconds) + case "status": + err = unpopulate(val, "Status", &d.Status) delete(rawMsg, key) } if err != nil { @@ -3782,17 +3358,16 @@ func (d *DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration) Unmarsh return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprComponentResiliencyPolicyConfiguration. -func (d DaprComponentResiliencyPolicyConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticsStatus. +func (d DiagnosticsStatus) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "circuitBreakerPolicy", d.CircuitBreakerPolicy) - populate(objectMap, "httpRetryPolicy", d.HTTPRetryPolicy) - populate(objectMap, "timeoutPolicy", d.TimeoutPolicy) + populate(objectMap, "message", d.Message) + populate(objectMap, "statusId", d.StatusID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicyConfiguration. -func (d *DaprComponentResiliencyPolicyConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsStatus. +func (d *DiagnosticsStatus) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -3800,14 +3375,11 @@ func (d *DaprComponentResiliencyPolicyConfiguration) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "circuitBreakerPolicy": - err = unpopulate(val, "CircuitBreakerPolicy", &d.CircuitBreakerPolicy) - delete(rawMsg, key) - case "httpRetryPolicy": - err = unpopulate(val, "HTTPRetryPolicy", &d.HTTPRetryPolicy) + case "message": + err = unpopulate(val, "Message", &d.Message) delete(rawMsg, key) - case "timeoutPolicy": - err = unpopulate(val, "TimeoutPolicy", &d.TimeoutPolicy) + case "statusId": + err = unpopulate(val, "StatusID", &d.StatusID) delete(rawMsg, key) } if err != nil { @@ -3817,7001 +3389,3386 @@ func (d *DaprComponentResiliencyPolicyConfiguration) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration. -func (d DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EncryptionSettings. +func (e EncryptionSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "initialDelayInMilliseconds", d.InitialDelayInMilliseconds) - populate(objectMap, "maxIntervalInMilliseconds", d.MaxIntervalInMilliseconds) + populate(objectMap, "containerAppAuthEncryptionSecretName", e.ContainerAppAuthEncryptionSecretName) + populate(objectMap, "containerAppAuthSigningSecretName", e.ContainerAppAuthSigningSecretName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration. -func (d *DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSettings. +func (e *EncryptionSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "initialDelayInMilliseconds": - err = unpopulate(val, "InitialDelayInMilliseconds", &d.InitialDelayInMilliseconds) + case "containerAppAuthEncryptionSecretName": + err = unpopulate(val, "ContainerAppAuthEncryptionSecretName", &e.ContainerAppAuthEncryptionSecretName) delete(rawMsg, key) - case "maxIntervalInMilliseconds": - err = unpopulate(val, "MaxIntervalInMilliseconds", &d.MaxIntervalInMilliseconds) + case "containerAppAuthSigningSecretName": + err = unpopulate(val, "ContainerAppAuthSigningSecretName", &e.ContainerAppAuthSigningSecretName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration. -func (d DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EnvironmentAuthToken. +func (e EnvironmentAuthToken) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maxRetries", d.MaxRetries) - populate(objectMap, "retryBackOff", d.RetryBackOff) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration. -func (d *DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentAuthToken. +func (e *EnvironmentAuthToken) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "maxRetries": - err = unpopulate(val, "MaxRetries", &d.MaxRetries) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) delete(rawMsg, key) - case "retryBackOff": - err = unpopulate(val, "RetryBackOff", &d.RetryBackOff) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprComponentResiliencyPolicyProperties. -func (d DaprComponentResiliencyPolicyProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EnvironmentAuthTokenProperties. +func (e EnvironmentAuthTokenProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "inboundPolicy", d.InboundPolicy) - populate(objectMap, "outboundPolicy", d.OutboundPolicy) + populateDateTimeRFC3339(objectMap, "expires", e.Expires) + populate(objectMap, "token", e.Token) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicyProperties. -func (d *DaprComponentResiliencyPolicyProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentAuthTokenProperties. +func (e *EnvironmentAuthTokenProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "inboundPolicy": - err = unpopulate(val, "InboundPolicy", &d.InboundPolicy) + case "expires": + err = unpopulateDateTimeRFC3339(val, "Expires", &e.Expires) delete(rawMsg, key) - case "outboundPolicy": - err = unpopulate(val, "OutboundPolicy", &d.OutboundPolicy) + case "token": + err = unpopulate(val, "Token", &e.Token) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprComponentResiliencyPolicyTimeoutPolicyConfiguration. -func (d DaprComponentResiliencyPolicyTimeoutPolicyConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type EnvironmentVar. +func (e EnvironmentVar) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "responseTimeoutInSeconds", d.ResponseTimeoutInSeconds) + populate(objectMap, "name", e.Name) + populate(objectMap, "secretRef", e.SecretRef) + populate(objectMap, "value", e.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicyTimeoutPolicyConfiguration. -func (d *DaprComponentResiliencyPolicyTimeoutPolicyConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVar. +func (e *EnvironmentVar) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "responseTimeoutInSeconds": - err = unpopulate(val, "ResponseTimeoutInSeconds", &d.ResponseTimeoutInSeconds) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "secretRef": + err = unpopulate(val, "SecretRef", &e.SecretRef) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprComponentServiceBinding. -func (d DaprComponentServiceBinding) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "metadata", d.Metadata) - populate(objectMap, "name", d.Name) - populate(objectMap, "serviceId", d.ServiceID) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentServiceBinding. -func (d *DaprComponentServiceBinding) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "metadata": - err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) + case "info": + err = unpopulate(val, "Info", &e.Info) delete(rawMsg, key) - case "serviceId": - err = unpopulate(val, "ServiceID", &d.ServiceID) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprComponentsCollection. -func (d DaprComponentsCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + 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 DaprComponentsCollection. -func (d *DaprComponentsCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + 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 { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprConfiguration. -func (d DaprConfiguration) 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, "version", d.Version) + populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprConfiguration. -func (d *DaprConfiguration) 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "version": - err = unpopulate(val, "Version", &d.Version) + case "error": + err = unpopulate(val, "Error", &e.Error) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprMetadata. -func (d DaprMetadata) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExtendedLocation. +func (e ExtendedLocation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) - populate(objectMap, "secretRef", d.SecretRef) - populate(objectMap, "value", d.Value) + populate(objectMap, "name", e.Name) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprMetadata. -func (d *DaprMetadata) UnmarshalJSON(data []byte) error { +// 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", d, err) + 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", &d.Name) - delete(rawMsg, key) - case "secretRef": - err = unpopulate(val, "SecretRef", &d.SecretRef) + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprSecret. -func (d DaprSecret) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Facebook. +func (f Facebook) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) - populate(objectMap, "value", d.Value) + populate(objectMap, "enabled", f.Enabled) + populate(objectMap, "graphApiVersion", f.GraphAPIVersion) + populate(objectMap, "login", f.Login) + populate(objectMap, "registration", f.Registration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSecret. -func (d *DaprSecret) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Facebook. +func (f *Facebook) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) + case "enabled": + err = unpopulate(val, "Enabled", &f.Enabled) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "graphApiVersion": + err = unpopulate(val, "GraphAPIVersion", &f.GraphAPIVersion) + delete(rawMsg, key) + case "login": + err = unpopulate(val, "Login", &f.Login) + delete(rawMsg, key) + case "registration": + err = unpopulate(val, "Registration", &f.Registration) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprSecretsCollection. -func (d DaprSecretsCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ForwardProxy. +func (f ForwardProxy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", d.Value) + populate(objectMap, "convention", f.Convention) + populate(objectMap, "customHostHeaderName", f.CustomHostHeaderName) + populate(objectMap, "customProtoHeaderName", f.CustomProtoHeaderName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSecretsCollection. -func (d *DaprSecretsCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ForwardProxy. +func (f *ForwardProxy) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &d.Value) + case "convention": + err = unpopulate(val, "Convention", &f.Convention) + delete(rawMsg, key) + case "customHostHeaderName": + err = unpopulate(val, "CustomHostHeaderName", &f.CustomHostHeaderName) + delete(rawMsg, key) + case "customProtoHeaderName": + err = unpopulate(val, "CustomProtoHeaderName", &f.CustomProtoHeaderName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprServiceBindMetadata. -func (d DaprServiceBindMetadata) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitHub. +func (g GitHub) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) - populate(objectMap, "value", d.Value) + populate(objectMap, "enabled", g.Enabled) + populate(objectMap, "login", g.Login) + populate(objectMap, "registration", g.Registration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprServiceBindMetadata. -func (d *DaprServiceBindMetadata) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitHub. +func (g *GitHub) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) + case "enabled": + err = unpopulate(val, "Enabled", &g.Enabled) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "login": + err = unpopulate(val, "Login", &g.Login) + delete(rawMsg, key) + case "registration": + err = unpopulate(val, "Registration", &g.Registration) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprSubscription. -func (d DaprSubscription) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GithubActionConfiguration. +func (g GithubActionConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + populate(objectMap, "azureCredentials", g.AzureCredentials) + populate(objectMap, "contextPath", g.ContextPath) + populate(objectMap, "githubPersonalAccessToken", g.GithubPersonalAccessToken) + populate(objectMap, "image", g.Image) + populate(objectMap, "os", g.OS) + populate(objectMap, "publishType", g.PublishType) + populate(objectMap, "registryInfo", g.RegistryInfo) + populate(objectMap, "runtimeStack", g.RuntimeStack) + populate(objectMap, "runtimeVersion", g.RuntimeVersion) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSubscription. -func (d *DaprSubscription) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GithubActionConfiguration. +func (g *GithubActionConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) + case "azureCredentials": + err = unpopulate(val, "AzureCredentials", &g.AzureCredentials) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) + case "contextPath": + err = unpopulate(val, "ContextPath", &g.ContextPath) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "githubPersonalAccessToken": + err = unpopulate(val, "GithubPersonalAccessToken", &g.GithubPersonalAccessToken) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + case "image": + err = unpopulate(val, "Image", &g.Image) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "os": + err = unpopulate(val, "OS", &g.OS) + delete(rawMsg, key) + case "publishType": + err = unpopulate(val, "PublishType", &g.PublishType) + delete(rawMsg, key) + case "registryInfo": + err = unpopulate(val, "RegistryInfo", &g.RegistryInfo) + delete(rawMsg, key) + case "runtimeStack": + err = unpopulate(val, "RuntimeStack", &g.RuntimeStack) + delete(rawMsg, key) + case "runtimeVersion": + err = unpopulate(val, "RuntimeVersion", &g.RuntimeVersion) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprSubscriptionBulkSubscribeOptions. -func (d DaprSubscriptionBulkSubscribeOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GlobalValidation. +func (g GlobalValidation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", d.Enabled) - populate(objectMap, "maxAwaitDurationMs", d.MaxAwaitDurationMs) - populate(objectMap, "maxMessagesCount", d.MaxMessagesCount) + populate(objectMap, "excludedPaths", g.ExcludedPaths) + populate(objectMap, "redirectToProvider", g.RedirectToProvider) + populate(objectMap, "unauthenticatedClientAction", g.UnauthenticatedClientAction) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSubscriptionBulkSubscribeOptions. -func (d *DaprSubscriptionBulkSubscribeOptions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalValidation. +func (g *GlobalValidation) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + case "excludedPaths": + err = unpopulate(val, "ExcludedPaths", &g.ExcludedPaths) delete(rawMsg, key) - case "maxAwaitDurationMs": - err = unpopulate(val, "MaxAwaitDurationMs", &d.MaxAwaitDurationMs) + case "redirectToProvider": + err = unpopulate(val, "RedirectToProvider", &g.RedirectToProvider) delete(rawMsg, key) - case "maxMessagesCount": - err = unpopulate(val, "MaxMessagesCount", &d.MaxMessagesCount) + case "unauthenticatedClientAction": + err = unpopulate(val, "UnauthenticatedClientAction", &g.UnauthenticatedClientAction) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprSubscriptionProperties. -func (d DaprSubscriptionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Google. +func (g Google) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bulkSubscribe", d.BulkSubscribe) - populate(objectMap, "deadLetterTopic", d.DeadLetterTopic) - populate(objectMap, "metadata", d.Metadata) - populate(objectMap, "pubsubName", d.PubsubName) - populate(objectMap, "routes", d.Routes) - populate(objectMap, "scopes", d.Scopes) - populate(objectMap, "topic", d.Topic) + populate(objectMap, "enabled", g.Enabled) + populate(objectMap, "login", g.Login) + populate(objectMap, "registration", g.Registration) + populate(objectMap, "validation", g.Validation) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSubscriptionProperties. -func (d *DaprSubscriptionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Google. +func (g *Google) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "bulkSubscribe": - err = unpopulate(val, "BulkSubscribe", &d.BulkSubscribe) - delete(rawMsg, key) - case "deadLetterTopic": - err = unpopulate(val, "DeadLetterTopic", &d.DeadLetterTopic) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) - case "pubsubName": - err = unpopulate(val, "PubsubName", &d.PubsubName) + case "enabled": + err = unpopulate(val, "Enabled", &g.Enabled) delete(rawMsg, key) - case "routes": - err = unpopulate(val, "Routes", &d.Routes) + case "login": + err = unpopulate(val, "Login", &g.Login) delete(rawMsg, key) - case "scopes": - err = unpopulate(val, "Scopes", &d.Scopes) + case "registration": + err = unpopulate(val, "Registration", &g.Registration) delete(rawMsg, key) - case "topic": - err = unpopulate(val, "Topic", &d.Topic) + case "validation": + err = unpopulate(val, "Validation", &g.Validation) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprSubscriptionRouteRule. -func (d DaprSubscriptionRouteRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HTTPScaleRule. +func (h HTTPScaleRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "match", d.Match) - populate(objectMap, "path", d.Path) + populate(objectMap, "auth", h.Auth) + populate(objectMap, "identity", h.Identity) + populate(objectMap, "metadata", h.Metadata) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSubscriptionRouteRule. -func (d *DaprSubscriptionRouteRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPScaleRule. +func (h *HTTPScaleRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { - case "match": - err = unpopulate(val, "Match", &d.Match) + case "auth": + err = unpopulate(val, "Auth", &h.Auth) delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &d.Path) + case "identity": + err = unpopulate(val, "Identity", &h.Identity) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &h.Metadata) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprSubscriptionRoutes. -func (d DaprSubscriptionRoutes) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HTTPSettings. +func (h HTTPSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "default", d.Default) - populate(objectMap, "rules", d.Rules) + populate(objectMap, "forwardProxy", h.ForwardProxy) + populate(objectMap, "requireHttps", h.RequireHTTPS) + populate(objectMap, "routes", h.Routes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSubscriptionRoutes. -func (d *DaprSubscriptionRoutes) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPSettings. +func (h *HTTPSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { - case "default": - err = unpopulate(val, "Default", &d.Default) + case "forwardProxy": + err = unpopulate(val, "ForwardProxy", &h.ForwardProxy) delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &d.Rules) + case "requireHttps": + err = unpopulate(val, "RequireHTTPS", &h.RequireHTTPS) + delete(rawMsg, key) + case "routes": + err = unpopulate(val, "Routes", &h.Routes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DaprSubscriptionsCollection. -func (d DaprSubscriptionsCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HTTPSettingsRoutes. +func (h HTTPSettingsRoutes) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "apiPrefix", h.APIPrefix) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSubscriptionsCollection. -func (d *DaprSubscriptionsCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPSettingsRoutes. +func (h *HTTPSettingsRoutes) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "apiPrefix": + err = unpopulate(val, "APIPrefix", &h.APIPrefix) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataDogConfiguration. -func (d DataDogConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IPSecurityRestrictionRule. +func (i IPSecurityRestrictionRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "key", d.Key) - populate(objectMap, "site", d.Site) + populate(objectMap, "action", i.Action) + populate(objectMap, "description", i.Description) + populate(objectMap, "ipAddressRange", i.IPAddressRange) + populate(objectMap, "name", i.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDogConfiguration. -func (d *DataDogConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IPSecurityRestrictionRule. +func (i *IPSecurityRestrictionRule) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &d.Key) + case "action": + err = unpopulate(val, "Action", &i.Action) delete(rawMsg, key) - case "site": - err = unpopulate(val, "Site", &d.Site) + case "description": + err = unpopulate(val, "Description", &i.Description) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DefaultAuthorizationPolicy. -func (d DefaultAuthorizationPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allowedApplications", d.AllowedApplications) - populate(objectMap, "allowedPrincipals", d.AllowedPrincipals) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultAuthorizationPolicy. -func (d *DefaultAuthorizationPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowedApplications": - err = unpopulate(val, "AllowedApplications", &d.AllowedApplications) + case "ipAddressRange": + err = unpopulate(val, "IPAddressRange", &i.IPAddressRange) delete(rawMsg, key) - case "allowedPrincipals": - err = unpopulate(val, "AllowedPrincipals", &d.AllowedPrincipals) + case "name": + err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefaultErrorResponse. -func (d DefaultErrorResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IdentityProviders. +func (i IdentityProviders) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", d.Error) + populate(objectMap, "apple", i.Apple) + populate(objectMap, "azureActiveDirectory", i.AzureActiveDirectory) + populate(objectMap, "azureStaticWebApps", i.AzureStaticWebApps) + populate(objectMap, "customOpenIdConnectProviders", i.CustomOpenIDConnectProviders) + populate(objectMap, "facebook", i.Facebook) + populate(objectMap, "gitHub", i.GitHub) + populate(objectMap, "google", i.Google) + populate(objectMap, "twitter", i.Twitter) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultErrorResponse. -func (d *DefaultErrorResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviders. +func (i *IdentityProviders) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &d.Error) + case "apple": + err = unpopulate(val, "Apple", &i.Apple) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DefaultErrorResponseError. -func (d DefaultErrorResponseError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", d.Code) - populate(objectMap, "details", d.Details) - populate(objectMap, "innererror", d.Innererror) - populate(objectMap, "message", d.Message) - populate(objectMap, "target", d.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultErrorResponseError. -func (d *DefaultErrorResponseError) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &d.Code) + case "azureActiveDirectory": + err = unpopulate(val, "AzureActiveDirectory", &i.AzureActiveDirectory) delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &d.Details) + case "azureStaticWebApps": + err = unpopulate(val, "AzureStaticWebApps", &i.AzureStaticWebApps) delete(rawMsg, key) - case "innererror": - err = unpopulate(val, "Innererror", &d.Innererror) + case "customOpenIdConnectProviders": + err = unpopulate(val, "CustomOpenIDConnectProviders", &i.CustomOpenIDConnectProviders) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &d.Message) + case "facebook": + err = unpopulate(val, "Facebook", &i.Facebook) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &d.Target) + case "gitHub": + err = unpopulate(val, "GitHub", &i.GitHub) + delete(rawMsg, key) + case "google": + err = unpopulate(val, "Google", &i.Google) + delete(rawMsg, key) + case "twitter": + err = unpopulate(val, "Twitter", &i.Twitter) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefaultErrorResponseErrorDetailsItem. -func (d DefaultErrorResponseErrorDetailsItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Ingress. +func (i Ingress) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", d.Code) - populate(objectMap, "message", d.Message) - populate(objectMap, "target", d.Target) + populate(objectMap, "additionalPortMappings", i.AdditionalPortMappings) + populate(objectMap, "allowInsecure", i.AllowInsecure) + populate(objectMap, "clientCertificateMode", i.ClientCertificateMode) + populate(objectMap, "corsPolicy", i.CorsPolicy) + populate(objectMap, "customDomains", i.CustomDomains) + populate(objectMap, "exposedPort", i.ExposedPort) + populate(objectMap, "external", i.External) + populate(objectMap, "fqdn", i.Fqdn) + populate(objectMap, "ipSecurityRestrictions", i.IPSecurityRestrictions) + populate(objectMap, "stickySessions", i.StickySessions) + populate(objectMap, "targetPort", i.TargetPort) + populate(objectMap, "traffic", i.Traffic) + populate(objectMap, "transport", i.Transport) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultErrorResponseErrorDetailsItem. -func (d *DefaultErrorResponseErrorDetailsItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Ingress. +func (i *Ingress) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &d.Code) + case "additionalPortMappings": + err = unpopulate(val, "AdditionalPortMappings", &i.AdditionalPortMappings) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &d.Message) + case "allowInsecure": + err = unpopulate(val, "AllowInsecure", &i.AllowInsecure) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &d.Target) + case "clientCertificateMode": + err = unpopulate(val, "ClientCertificateMode", &i.ClientCertificateMode) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DestinationsConfiguration. -func (d DestinationsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataDogConfiguration", d.DataDogConfiguration) - populate(objectMap, "otlpConfigurations", d.OtlpConfigurations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DestinationsConfiguration. -func (d *DestinationsConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDogConfiguration": - err = unpopulate(val, "DataDogConfiguration", &d.DataDogConfiguration) - delete(rawMsg, key) - case "otlpConfigurations": - err = unpopulate(val, "OtlpConfigurations", &d.OtlpConfigurations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticDataProviderMetadata. -func (d DiagnosticDataProviderMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "propertyBag", d.PropertyBag) - populate(objectMap, "providerName", d.ProviderName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticDataProviderMetadata. -func (d *DiagnosticDataProviderMetadata) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "propertyBag": - err = unpopulate(val, "PropertyBag", &d.PropertyBag) - delete(rawMsg, key) - case "providerName": - err = unpopulate(val, "ProviderName", &d.ProviderName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticDataProviderMetadataPropertyBagItem. -func (d DiagnosticDataProviderMetadataPropertyBagItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticDataProviderMetadataPropertyBagItem. -func (d *DiagnosticDataProviderMetadataPropertyBagItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticDataTableResponseColumn. -func (d DiagnosticDataTableResponseColumn) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "columnName", d.ColumnName) - populate(objectMap, "columnType", d.ColumnType) - populate(objectMap, "dataType", d.DataType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticDataTableResponseColumn. -func (d *DiagnosticDataTableResponseColumn) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "columnName": - err = unpopulate(val, "ColumnName", &d.ColumnName) - delete(rawMsg, key) - case "columnType": - err = unpopulate(val, "ColumnType", &d.ColumnType) - delete(rawMsg, key) - case "dataType": - err = unpopulate(val, "DataType", &d.DataType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticDataTableResponseObject. -func (d DiagnosticDataTableResponseObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "columns", d.Columns) - populate(objectMap, "rows", d.Rows) - populate(objectMap, "tableName", d.TableName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticDataTableResponseObject. -func (d *DiagnosticDataTableResponseObject) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "columns": - err = unpopulate(val, "Columns", &d.Columns) - delete(rawMsg, key) - case "rows": - err = unpopulate(val, "Rows", &d.Rows) - delete(rawMsg, key) - case "tableName": - err = unpopulate(val, "TableName", &d.TableName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticRendering. -func (d DiagnosticRendering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "description", d.Description) - populate(objectMap, "isVisible", d.IsVisible) - populate(objectMap, "title", d.Title) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticRendering. -func (d *DiagnosticRendering) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "isVisible": - err = unpopulate(val, "IsVisible", &d.IsVisible) - delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &d.Title) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticSupportTopic. -func (d DiagnosticSupportTopic) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "pesId", d.PesID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticSupportTopic. -func (d *DiagnosticSupportTopic) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "pesId": - err = unpopulate(val, "PesID", &d.PesID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Diagnostics. -func (d Diagnostics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Diagnostics. -func (d *Diagnostics) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticsCollection. -func (d DiagnosticsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsCollection. -func (d *DiagnosticsCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticsDataAPIResponse. -func (d DiagnosticsDataAPIResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "renderingProperties", d.RenderingProperties) - populate(objectMap, "table", d.Table) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsDataAPIResponse. -func (d *DiagnosticsDataAPIResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "renderingProperties": - err = unpopulate(val, "RenderingProperties", &d.RenderingProperties) - delete(rawMsg, key) - case "table": - err = unpopulate(val, "Table", &d.Table) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticsDefinition. -func (d DiagnosticsDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "analysisTypes", d.AnalysisTypes) - populate(objectMap, "author", d.Author) - populate(objectMap, "category", d.Category) - populate(objectMap, "description", d.Description) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "score", d.Score) - populate(objectMap, "supportTopicList", d.SupportTopicList) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsDefinition. -func (d *DiagnosticsDefinition) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "analysisTypes": - err = unpopulate(val, "AnalysisTypes", &d.AnalysisTypes) - delete(rawMsg, key) - case "author": - err = unpopulate(val, "Author", &d.Author) - delete(rawMsg, key) - case "category": - err = unpopulate(val, "Category", &d.Category) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "score": - err = unpopulate(val, "Score", &d.Score) - delete(rawMsg, key) - case "supportTopicList": - err = unpopulate(val, "SupportTopicList", &d.SupportTopicList) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticsProperties. -func (d DiagnosticsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "dataProviderMetadata", d.DataProviderMetadata) - populate(objectMap, "dataset", d.Dataset) - populate(objectMap, "metadata", d.Metadata) - populate(objectMap, "status", d.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsProperties. -func (d *DiagnosticsProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataProviderMetadata": - err = unpopulate(val, "DataProviderMetadata", &d.DataProviderMetadata) - delete(rawMsg, key) - case "dataset": - err = unpopulate(val, "Dataset", &d.Dataset) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DiagnosticsStatus. -func (d DiagnosticsStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "message", d.Message) - populate(objectMap, "statusId", d.StatusID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticsStatus. -func (d *DiagnosticsStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "message": - err = unpopulate(val, "Message", &d.Message) - delete(rawMsg, key) - case "statusId": - err = unpopulate(val, "StatusID", &d.StatusID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DotNetComponent. -func (d DotNetComponent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DotNetComponent. -func (d *DotNetComponent) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DotNetComponentConfigurationProperty. -func (d DotNetComponentConfigurationProperty) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "propertyName", d.PropertyName) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DotNetComponentConfigurationProperty. -func (d *DotNetComponentConfigurationProperty) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "propertyName": - err = unpopulate(val, "PropertyName", &d.PropertyName) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DotNetComponentProperties. -func (d DotNetComponentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "componentType", d.ComponentType) - populate(objectMap, "configurations", d.Configurations) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "serviceBinds", d.ServiceBinds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DotNetComponentProperties. -func (d *DotNetComponentProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "componentType": - err = unpopulate(val, "ComponentType", &d.ComponentType) - delete(rawMsg, key) - case "configurations": - err = unpopulate(val, "Configurations", &d.Configurations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "serviceBinds": - err = unpopulate(val, "ServiceBinds", &d.ServiceBinds) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DotNetComponentServiceBind. -func (d DotNetComponentServiceBind) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", d.Name) - populate(objectMap, "serviceId", d.ServiceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DotNetComponentServiceBind. -func (d *DotNetComponentServiceBind) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "serviceId": - err = unpopulate(val, "ServiceID", &d.ServiceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DotNetComponentsCollection. -func (d DotNetComponentsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DotNetComponentsCollection. -func (d *DotNetComponentsCollection) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DynamicPoolConfiguration. -func (d DynamicPoolConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "cooldownPeriodInSeconds", d.CooldownPeriodInSeconds) - populate(objectMap, "executionType", d.ExecutionType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DynamicPoolConfiguration. -func (d *DynamicPoolConfiguration) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "cooldownPeriodInSeconds": - err = unpopulate(val, "CooldownPeriodInSeconds", &d.CooldownPeriodInSeconds) - delete(rawMsg, key) - case "executionType": - err = unpopulate(val, "ExecutionType", &d.ExecutionType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EncryptionSettings. -func (e EncryptionSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "containerAppAuthEncryptionSecretName", e.ContainerAppAuthEncryptionSecretName) - populate(objectMap, "containerAppAuthSigningSecretName", e.ContainerAppAuthSigningSecretName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionSettings. -func (e *EncryptionSettings) 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 "containerAppAuthEncryptionSecretName": - err = unpopulate(val, "ContainerAppAuthEncryptionSecretName", &e.ContainerAppAuthEncryptionSecretName) - delete(rawMsg, key) - case "containerAppAuthSigningSecretName": - err = unpopulate(val, "ContainerAppAuthSigningSecretName", &e.ContainerAppAuthSigningSecretName) - 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 EnvironmentAuthToken. -func (e EnvironmentAuthToken) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "systemData", e.SystemData) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentAuthToken. -func (e *EnvironmentAuthToken) 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 "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &e.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &e.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &e.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - 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 EnvironmentAuthTokenProperties. -func (e EnvironmentAuthTokenProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "expires", e.Expires) - populate(objectMap, "token", e.Token) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentAuthTokenProperties. -func (e *EnvironmentAuthTokenProperties) 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 "expires": - err = unpopulateDateTimeRFC3339(val, "Expires", &e.Expires) - delete(rawMsg, key) - case "token": - err = unpopulate(val, "Token", &e.Token) - 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 EnvironmentVar. -func (e EnvironmentVar) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", e.Name) - populate(objectMap, "secretRef", e.SecretRef) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVar. -func (e *EnvironmentVar) 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 "secretRef": - err = unpopulate(val, "SecretRef", &e.SecretRef) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) - 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 EnvironmentVariable. -func (e EnvironmentVariable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", e.Name) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentVariable. -func (e *EnvironmentVariable) 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 "value": - err = unpopulate(val, "Value", &e.Value) - 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 ErrorAdditionalInfo. -func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateAny(objectMap, "info", e.Info) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. -func (e *ErrorAdditionalInfo) 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 "info": - err = unpopulate(val, "Info", &e.Info) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - 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 ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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 ErrorDetail. -func (e *ErrorDetail) 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 "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 { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ErrorEntity. -func (e ErrorEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "extendedCode", e.ExtendedCode) - populate(objectMap, "innerErrors", e.InnerErrors) - populate(objectMap, "message", e.Message) - populate(objectMap, "messageTemplate", e.MessageTemplate) - populate(objectMap, "parameters", e.Parameters) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorEntity. -func (e *ErrorEntity) 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 "details": - err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) - case "extendedCode": - err = unpopulate(val, "ExtendedCode", &e.ExtendedCode) - delete(rawMsg, key) - case "innerErrors": - err = unpopulate(val, "InnerErrors", &e.InnerErrors) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) - case "messageTemplate": - err = unpopulate(val, "MessageTemplate", &e.MessageTemplate) - delete(rawMsg, key) - case "parameters": - err = unpopulate(val, "Parameters", &e.Parameters) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) - 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 ErrorResponse. -func (e ErrorResponse) 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 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) - } - 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 ExecutionStatus. -func (e ExecutionStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "replicas", e.Replicas) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutionStatus. -func (e *ExecutionStatus) 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 "replicas": - err = unpopulate(val, "Replicas", &e.Replicas) - 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": - err = unpopulate(val, "Type", &e.Type) - 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 Facebook. -func (f Facebook) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", f.Enabled) - populate(objectMap, "graphApiVersion", f.GraphAPIVersion) - populate(objectMap, "login", f.Login) - populate(objectMap, "registration", f.Registration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Facebook. -func (f *Facebook) 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", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &f.Enabled) - delete(rawMsg, key) - case "graphApiVersion": - err = unpopulate(val, "GraphAPIVersion", &f.GraphAPIVersion) - delete(rawMsg, key) - case "login": - err = unpopulate(val, "Login", &f.Login) - delete(rawMsg, key) - case "registration": - err = unpopulate(val, "Registration", &f.Registration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ForwardProxy. -func (f ForwardProxy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "convention", f.Convention) - populate(objectMap, "customHostHeaderName", f.CustomHostHeaderName) - populate(objectMap, "customProtoHeaderName", f.CustomProtoHeaderName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ForwardProxy. -func (f *ForwardProxy) 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", f, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "convention": - err = unpopulate(val, "Convention", &f.Convention) - delete(rawMsg, key) - case "customHostHeaderName": - err = unpopulate(val, "CustomHostHeaderName", &f.CustomHostHeaderName) - delete(rawMsg, key) - case "customProtoHeaderName": - err = unpopulate(val, "CustomProtoHeaderName", &f.CustomProtoHeaderName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GitHub. -func (g GitHub) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", g.Enabled) - populate(objectMap, "login", g.Login) - populate(objectMap, "registration", g.Registration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GitHub. -func (g *GitHub) 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", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &g.Enabled) - delete(rawMsg, key) - case "login": - err = unpopulate(val, "Login", &g.Login) - delete(rawMsg, key) - case "registration": - err = unpopulate(val, "Registration", &g.Registration) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GithubActionConfiguration. -func (g GithubActionConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "azureCredentials", g.AzureCredentials) - populate(objectMap, "buildEnvironmentVariables", g.BuildEnvironmentVariables) - populate(objectMap, "contextPath", g.ContextPath) - populate(objectMap, "dockerfilePath", g.DockerfilePath) - populate(objectMap, "githubPersonalAccessToken", g.GithubPersonalAccessToken) - populate(objectMap, "image", g.Image) - populate(objectMap, "os", g.OS) - populate(objectMap, "publishType", g.PublishType) - populate(objectMap, "registryInfo", g.RegistryInfo) - populate(objectMap, "runtimeStack", g.RuntimeStack) - populate(objectMap, "runtimeVersion", g.RuntimeVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GithubActionConfiguration. -func (g *GithubActionConfiguration) 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", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "azureCredentials": - err = unpopulate(val, "AzureCredentials", &g.AzureCredentials) - delete(rawMsg, key) - case "buildEnvironmentVariables": - err = unpopulate(val, "BuildEnvironmentVariables", &g.BuildEnvironmentVariables) - delete(rawMsg, key) - case "contextPath": - err = unpopulate(val, "ContextPath", &g.ContextPath) - delete(rawMsg, key) - case "dockerfilePath": - err = unpopulate(val, "DockerfilePath", &g.DockerfilePath) - delete(rawMsg, key) - case "githubPersonalAccessToken": - err = unpopulate(val, "GithubPersonalAccessToken", &g.GithubPersonalAccessToken) - delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &g.Image) - delete(rawMsg, key) - case "os": - err = unpopulate(val, "OS", &g.OS) - delete(rawMsg, key) - case "publishType": - err = unpopulate(val, "PublishType", &g.PublishType) - delete(rawMsg, key) - case "registryInfo": - err = unpopulate(val, "RegistryInfo", &g.RegistryInfo) - delete(rawMsg, key) - case "runtimeStack": - err = unpopulate(val, "RuntimeStack", &g.RuntimeStack) - delete(rawMsg, key) - case "runtimeVersion": - err = unpopulate(val, "RuntimeVersion", &g.RuntimeVersion) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GlobalValidation. -func (g GlobalValidation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "excludedPaths", g.ExcludedPaths) - populate(objectMap, "redirectToProvider", g.RedirectToProvider) - populate(objectMap, "unauthenticatedClientAction", g.UnauthenticatedClientAction) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalValidation. -func (g *GlobalValidation) 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", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "excludedPaths": - err = unpopulate(val, "ExcludedPaths", &g.ExcludedPaths) - delete(rawMsg, key) - case "redirectToProvider": - err = unpopulate(val, "RedirectToProvider", &g.RedirectToProvider) - delete(rawMsg, key) - case "unauthenticatedClientAction": - err = unpopulate(val, "UnauthenticatedClientAction", &g.UnauthenticatedClientAction) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Google. -func (g Google) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", g.Enabled) - populate(objectMap, "login", g.Login) - populate(objectMap, "registration", g.Registration) - populate(objectMap, "validation", g.Validation) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Google. -func (g *Google) 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", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &g.Enabled) - delete(rawMsg, key) - case "login": - err = unpopulate(val, "Login", &g.Login) - delete(rawMsg, key) - case "registration": - err = unpopulate(val, "Registration", &g.Registration) - delete(rawMsg, key) - case "validation": - err = unpopulate(val, "Validation", &g.Validation) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type HTTPConnectionPool. -func (h HTTPConnectionPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "http1MaxPendingRequests", h.HTTP1MaxPendingRequests) - populate(objectMap, "http2MaxRequests", h.HTTP2MaxRequests) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPConnectionPool. -func (h *HTTPConnectionPool) 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 "http1MaxPendingRequests": - err = unpopulate(val, "HTTP1MaxPendingRequests", &h.HTTP1MaxPendingRequests) - delete(rawMsg, key) - case "http2MaxRequests": - err = unpopulate(val, "HTTP2MaxRequests", &h.HTTP2MaxRequests) - 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 HTTPGet. -func (h HTTPGet) 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 HTTPGet. -func (h *HTTPGet) 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) - populate(objectMap, "matches", h.Matches) - populate(objectMap, "maxRetries", h.MaxRetries) - populate(objectMap, "retryBackOff", h.RetryBackOff) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRetryPolicy. -func (h *HTTPRetryPolicy) 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 "matches": - err = unpopulate(val, "Matches", &h.Matches) - delete(rawMsg, key) - case "maxRetries": - err = unpopulate(val, "MaxRetries", &h.MaxRetries) - delete(rawMsg, key) - case "retryBackOff": - err = unpopulate(val, "RetryBackOff", &h.RetryBackOff) - 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 HTTPRetryPolicyMatches. -func (h HTTPRetryPolicyMatches) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "errors", h.Errors) - populate(objectMap, "httpStatusCodes", h.HTTPStatusCodes) - populate(objectMap, "headers", h.Headers) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRetryPolicyMatches. -func (h *HTTPRetryPolicyMatches) 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 "errors": - err = unpopulate(val, "Errors", &h.Errors) - delete(rawMsg, key) - case "httpStatusCodes": - err = unpopulate(val, "HTTPStatusCodes", &h.HTTPStatusCodes) - delete(rawMsg, key) - case "headers": - err = unpopulate(val, "Headers", &h.Headers) - 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 HTTPRetryPolicyRetryBackOff. -func (h HTTPRetryPolicyRetryBackOff) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "initialDelayInMilliseconds", h.InitialDelayInMilliseconds) - populate(objectMap, "maxIntervalInMilliseconds", h.MaxIntervalInMilliseconds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRetryPolicyRetryBackOff. -func (h *HTTPRetryPolicyRetryBackOff) 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 "initialDelayInMilliseconds": - err = unpopulate(val, "InitialDelayInMilliseconds", &h.InitialDelayInMilliseconds) - delete(rawMsg, key) - case "maxIntervalInMilliseconds": - err = unpopulate(val, "MaxIntervalInMilliseconds", &h.MaxIntervalInMilliseconds) - 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 HTTPScaleRule. -func (h HTTPScaleRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "auth", h.Auth) - populate(objectMap, "identity", h.Identity) - populate(objectMap, "metadata", h.Metadata) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPScaleRule. -func (h *HTTPScaleRule) 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 "auth": - err = unpopulate(val, "Auth", &h.Auth) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &h.Identity) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &h.Metadata) - 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 HTTPSettings. -func (h HTTPSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "forwardProxy", h.ForwardProxy) - populate(objectMap, "requireHttps", h.RequireHTTPS) - populate(objectMap, "routes", h.Routes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPSettings. -func (h *HTTPSettings) 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 "forwardProxy": - err = unpopulate(val, "ForwardProxy", &h.ForwardProxy) - delete(rawMsg, key) - case "requireHttps": - err = unpopulate(val, "RequireHTTPS", &h.RequireHTTPS) - delete(rawMsg, key) - case "routes": - err = unpopulate(val, "Routes", &h.Routes) - 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 HTTPSettingsRoutes. -func (h HTTPSettingsRoutes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "apiPrefix", h.APIPrefix) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPSettingsRoutes. -func (h *HTTPSettingsRoutes) 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 "apiPrefix": - err = unpopulate(val, "APIPrefix", &h.APIPrefix) - 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 Header. -func (h Header) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "key", h.Key) - populate(objectMap, "value", h.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Header. -func (h *Header) 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 "key": - err = unpopulate(val, "Key", &h.Key) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &h.Value) - 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 HeaderMatch. -func (h HeaderMatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "header", h.Header) - populate(objectMap, "match", h.Match) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HeaderMatch. -func (h *HeaderMatch) 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 "header": - err = unpopulate(val, "Header", &h.Header) - delete(rawMsg, key) - case "match": - err = unpopulate(val, "Match", &h.Match) - 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 HeaderMatchMatch. -func (h HeaderMatchMatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "exactMatch", h.ExactMatch) - populate(objectMap, "prefixMatch", h.PrefixMatch) - populate(objectMap, "regexMatch", h.RegexMatch) - populate(objectMap, "suffixMatch", h.SuffixMatch) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HeaderMatchMatch. -func (h *HeaderMatchMatch) 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 "exactMatch": - err = unpopulate(val, "ExactMatch", &h.ExactMatch) - delete(rawMsg, key) - case "prefixMatch": - err = unpopulate(val, "PrefixMatch", &h.PrefixMatch) - delete(rawMsg, key) - case "regexMatch": - err = unpopulate(val, "RegexMatch", &h.RegexMatch) - delete(rawMsg, key) - case "suffixMatch": - err = unpopulate(val, "SuffixMatch", &h.SuffixMatch) - 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 IPSecurityRestrictionRule. -func (i IPSecurityRestrictionRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "action", i.Action) - populate(objectMap, "description", i.Description) - populate(objectMap, "ipAddressRange", i.IPAddressRange) - populate(objectMap, "name", i.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPSecurityRestrictionRule. -func (i *IPSecurityRestrictionRule) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "action": - err = unpopulate(val, "Action", &i.Action) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &i.Description) - delete(rawMsg, key) - case "ipAddressRange": - err = unpopulate(val, "IPAddressRange", &i.IPAddressRange) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IdentityProviders. -func (i IdentityProviders) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "apple", i.Apple) - populate(objectMap, "azureActiveDirectory", i.AzureActiveDirectory) - populate(objectMap, "azureStaticWebApps", i.AzureStaticWebApps) - populate(objectMap, "customOpenIdConnectProviders", i.CustomOpenIDConnectProviders) - populate(objectMap, "facebook", i.Facebook) - populate(objectMap, "gitHub", i.GitHub) - populate(objectMap, "google", i.Google) - populate(objectMap, "twitter", i.Twitter) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviders. -func (i *IdentityProviders) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "apple": - err = unpopulate(val, "Apple", &i.Apple) - delete(rawMsg, key) - case "azureActiveDirectory": - err = unpopulate(val, "AzureActiveDirectory", &i.AzureActiveDirectory) - delete(rawMsg, key) - case "azureStaticWebApps": - err = unpopulate(val, "AzureStaticWebApps", &i.AzureStaticWebApps) - delete(rawMsg, key) - case "customOpenIdConnectProviders": - err = unpopulate(val, "CustomOpenIDConnectProviders", &i.CustomOpenIDConnectProviders) - delete(rawMsg, key) - case "facebook": - err = unpopulate(val, "Facebook", &i.Facebook) - delete(rawMsg, key) - case "gitHub": - err = unpopulate(val, "GitHub", &i.GitHub) - delete(rawMsg, key) - case "google": - err = unpopulate(val, "Google", &i.Google) - delete(rawMsg, key) - case "twitter": - err = unpopulate(val, "Twitter", &i.Twitter) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IdentitySettings. -func (i IdentitySettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identity", i.Identity) - populate(objectMap, "lifecycle", i.Lifecycle) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IdentitySettings. -func (i *IdentitySettings) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identity": - err = unpopulate(val, "Identity", &i.Identity) - delete(rawMsg, key) - case "lifecycle": - err = unpopulate(val, "Lifecycle", &i.Lifecycle) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Ingress. -func (i Ingress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalPortMappings", i.AdditionalPortMappings) - populate(objectMap, "allowInsecure", i.AllowInsecure) - populate(objectMap, "clientCertificateMode", i.ClientCertificateMode) - populate(objectMap, "corsPolicy", i.CorsPolicy) - populate(objectMap, "customDomains", i.CustomDomains) - populate(objectMap, "exposedPort", i.ExposedPort) - populate(objectMap, "external", i.External) - populate(objectMap, "fqdn", i.Fqdn) - populate(objectMap, "ipSecurityRestrictions", i.IPSecurityRestrictions) - populate(objectMap, "stickySessions", i.StickySessions) - populate(objectMap, "targetPort", i.TargetPort) - populate(objectMap, "targetPortHttpScheme", i.TargetPortHTTPScheme) - populate(objectMap, "traffic", i.Traffic) - populate(objectMap, "transport", i.Transport) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Ingress. -func (i *Ingress) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalPortMappings": - err = unpopulate(val, "AdditionalPortMappings", &i.AdditionalPortMappings) - delete(rawMsg, key) - case "allowInsecure": - err = unpopulate(val, "AllowInsecure", &i.AllowInsecure) - delete(rawMsg, key) - case "clientCertificateMode": - err = unpopulate(val, "ClientCertificateMode", &i.ClientCertificateMode) - delete(rawMsg, key) - case "corsPolicy": - err = unpopulate(val, "CorsPolicy", &i.CorsPolicy) - delete(rawMsg, key) - case "customDomains": - err = unpopulate(val, "CustomDomains", &i.CustomDomains) - delete(rawMsg, key) - case "exposedPort": - err = unpopulate(val, "ExposedPort", &i.ExposedPort) - delete(rawMsg, key) - case "external": - err = unpopulate(val, "External", &i.External) - delete(rawMsg, key) - case "fqdn": - err = unpopulate(val, "Fqdn", &i.Fqdn) - delete(rawMsg, key) - case "ipSecurityRestrictions": - err = unpopulate(val, "IPSecurityRestrictions", &i.IPSecurityRestrictions) - delete(rawMsg, key) - case "stickySessions": - err = unpopulate(val, "StickySessions", &i.StickySessions) - delete(rawMsg, key) - case "targetPort": - err = unpopulate(val, "TargetPort", &i.TargetPort) - delete(rawMsg, key) - case "targetPortHttpScheme": - err = unpopulate(val, "TargetPortHTTPScheme", &i.TargetPortHTTPScheme) - delete(rawMsg, key) - case "traffic": - err = unpopulate(val, "Traffic", &i.Traffic) - delete(rawMsg, key) - case "transport": - err = unpopulate(val, "Transport", &i.Transport) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IngressPortMapping. -func (i IngressPortMapping) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "exposedPort", i.ExposedPort) - populate(objectMap, "external", i.External) - populate(objectMap, "targetPort", i.TargetPort) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IngressPortMapping. -func (i *IngressPortMapping) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exposedPort": - err = unpopulate(val, "ExposedPort", &i.ExposedPort) - delete(rawMsg, key) - case "external": - err = unpopulate(val, "External", &i.External) - delete(rawMsg, key) - case "targetPort": - err = unpopulate(val, "TargetPort", &i.TargetPort) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IngressStickySessions. -func (i IngressStickySessions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "affinity", i.Affinity) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IngressStickySessions. -func (i *IngressStickySessions) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "affinity": - err = unpopulate(val, "Affinity", &i.Affinity) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type InitContainer. -func (i InitContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "args", i.Args) - 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) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InitContainer. -func (i *InitContainer) 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", i, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "args": - err = unpopulate(val, "Args", &i.Args) - delete(rawMsg, key) - case "command": - err = unpopulate(val, "Command", &i.Command) - delete(rawMsg, key) - case "env": - err = unpopulate(val, "Env", &i.Env) - delete(rawMsg, key) - 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) - case "resources": - err = unpopulate(val, "Resources", &i.Resources) - delete(rawMsg, key) - case "volumeMounts": - err = unpopulate(val, "VolumeMounts", &i.VolumeMounts) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type JavaComponent. -func (j JavaComponent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "systemData", j.SystemData) - populate(objectMap, "type", j.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JavaComponent. -func (j *JavaComponent) 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 "id": - err = unpopulate(val, "ID", &j.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &j.Name) - delete(rawMsg, key) - case "properties": - j.Properties, err = unmarshalJavaComponentPropertiesClassification(val) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &j.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) - 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 JavaComponentConfigurationProperty. -func (j JavaComponentConfigurationProperty) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "propertyName", j.PropertyName) - populate(objectMap, "value", j.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JavaComponentConfigurationProperty. -func (j *JavaComponentConfigurationProperty) 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 "propertyName": - err = unpopulate(val, "PropertyName", &j.PropertyName) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &j.Value) - 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 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) - objectMap["componentType"] = j.ComponentType - populate(objectMap, "configurations", j.Configurations) - populate(objectMap, "provisioningState", j.ProvisioningState) - populate(objectMap, "scale", j.Scale) - populate(objectMap, "serviceBinds", j.ServiceBinds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JavaComponentProperties. -func (j *JavaComponentProperties) 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 "componentType": - err = unpopulate(val, "ComponentType", &j.ComponentType) - delete(rawMsg, key) - case "configurations": - err = unpopulate(val, "Configurations", &j.Configurations) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &j.ProvisioningState) - delete(rawMsg, key) - case "scale": - err = unpopulate(val, "Scale", &j.Scale) - delete(rawMsg, key) - case "serviceBinds": - err = unpopulate(val, "ServiceBinds", &j.ServiceBinds) - 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 JavaComponentPropertiesScale. -func (j JavaComponentPropertiesScale) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxReplicas", j.MaxReplicas) - populate(objectMap, "minReplicas", j.MinReplicas) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JavaComponentPropertiesScale. -func (j *JavaComponentPropertiesScale) 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 "maxReplicas": - err = unpopulate(val, "MaxReplicas", &j.MaxReplicas) - delete(rawMsg, key) - case "minReplicas": - err = unpopulate(val, "MinReplicas", &j.MinReplicas) - 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 JavaComponentServiceBind. -func (j JavaComponentServiceBind) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", j.Name) - populate(objectMap, "serviceId", j.ServiceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JavaComponentServiceBind. -func (j *JavaComponentServiceBind) 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 "name": - err = unpopulate(val, "Name", &j.Name) - delete(rawMsg, key) - case "serviceId": - err = unpopulate(val, "ServiceID", &j.ServiceID) - 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 JavaComponentsCollection. -func (j JavaComponentsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", j.NextLink) - populate(objectMap, "value", j.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JavaComponentsCollection. -func (j *JavaComponentsCollection) 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 "nextLink": - err = unpopulate(val, "NextLink", &j.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &j.Value) - 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 Job. -func (j Job) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", j.ExtendedLocation) - populate(objectMap, "id", j.ID) - populate(objectMap, "identity", j.Identity) - populate(objectMap, "location", j.Location) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "systemData", j.SystemData) - populate(objectMap, "tags", j.Tags) - populate(objectMap, "type", j.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Job. -func (j *Job) 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 "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &j.ExtendedLocation) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &j.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &j.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &j.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &j.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &j.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &j.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &j.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) - 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 JobConfiguration. -func (j JobConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "eventTriggerConfig", j.EventTriggerConfig) - populate(objectMap, "identitySettings", j.IdentitySettings) - populate(objectMap, "manualTriggerConfig", j.ManualTriggerConfig) - populate(objectMap, "registries", j.Registries) - populate(objectMap, "replicaRetryLimit", j.ReplicaRetryLimit) - populate(objectMap, "replicaTimeout", j.ReplicaTimeout) - populate(objectMap, "scheduleTriggerConfig", j.ScheduleTriggerConfig) - populate(objectMap, "secrets", j.Secrets) - populate(objectMap, "triggerType", j.TriggerType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobConfiguration. -func (j *JobConfiguration) 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 "eventTriggerConfig": - err = unpopulate(val, "EventTriggerConfig", &j.EventTriggerConfig) - delete(rawMsg, key) - case "identitySettings": - err = unpopulate(val, "IdentitySettings", &j.IdentitySettings) - delete(rawMsg, key) - case "manualTriggerConfig": - err = unpopulate(val, "ManualTriggerConfig", &j.ManualTriggerConfig) - delete(rawMsg, key) - case "registries": - err = unpopulate(val, "Registries", &j.Registries) - delete(rawMsg, key) - case "replicaRetryLimit": - err = unpopulate(val, "ReplicaRetryLimit", &j.ReplicaRetryLimit) - delete(rawMsg, key) - case "replicaTimeout": - err = unpopulate(val, "ReplicaTimeout", &j.ReplicaTimeout) - delete(rawMsg, key) - case "scheduleTriggerConfig": - err = unpopulate(val, "ScheduleTriggerConfig", &j.ScheduleTriggerConfig) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &j.Secrets) - delete(rawMsg, key) - case "triggerType": - err = unpopulate(val, "TriggerType", &j.TriggerType) - 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 JobConfigurationEventTriggerConfig. -func (j JobConfigurationEventTriggerConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "parallelism", j.Parallelism) - populate(objectMap, "replicaCompletionCount", j.ReplicaCompletionCount) - populate(objectMap, "scale", j.Scale) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobConfigurationEventTriggerConfig. -func (j *JobConfigurationEventTriggerConfig) 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 "parallelism": - err = unpopulate(val, "Parallelism", &j.Parallelism) - delete(rawMsg, key) - case "replicaCompletionCount": - err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) - delete(rawMsg, key) - case "scale": - err = unpopulate(val, "Scale", &j.Scale) - 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 JobConfigurationManualTriggerConfig. -func (j JobConfigurationManualTriggerConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "parallelism", j.Parallelism) - populate(objectMap, "replicaCompletionCount", j.ReplicaCompletionCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobConfigurationManualTriggerConfig. -func (j *JobConfigurationManualTriggerConfig) 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 "parallelism": - err = unpopulate(val, "Parallelism", &j.Parallelism) - delete(rawMsg, key) - case "replicaCompletionCount": - err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) - 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 JobConfigurationScheduleTriggerConfig. -func (j JobConfigurationScheduleTriggerConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "cronExpression", j.CronExpression) - populate(objectMap, "parallelism", j.Parallelism) - populate(objectMap, "replicaCompletionCount", j.ReplicaCompletionCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobConfigurationScheduleTriggerConfig. -func (j *JobConfigurationScheduleTriggerConfig) 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 "cronExpression": - err = unpopulate(val, "CronExpression", &j.CronExpression) - delete(rawMsg, key) - case "parallelism": - err = unpopulate(val, "Parallelism", &j.Parallelism) - delete(rawMsg, key) - case "replicaCompletionCount": - err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) - 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 JobExecution. -func (j JobExecution) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "type", j.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecution. -func (j *JobExecution) 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 "id": - err = unpopulate(val, "ID", &j.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &j.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &j.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) - 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 JobExecutionBase. -func (j JobExecutionBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", j.ID) - populate(objectMap, "name", j.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionBase. -func (j *JobExecutionBase) 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 "id": - err = unpopulate(val, "ID", &j.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &j.Name) - 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 JobExecutionContainer. -func (j JobExecutionContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "args", j.Args) - populate(objectMap, "command", j.Command) - populate(objectMap, "env", j.Env) - populate(objectMap, "image", j.Image) - populate(objectMap, "name", j.Name) - populate(objectMap, "resources", j.Resources) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionContainer. -func (j *JobExecutionContainer) 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 "args": - err = unpopulate(val, "Args", &j.Args) - delete(rawMsg, key) - case "command": - err = unpopulate(val, "Command", &j.Command) - delete(rawMsg, key) - case "env": - err = unpopulate(val, "Env", &j.Env) - delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &j.Image) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &j.Name) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &j.Resources) - 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 JobExecutionNamesCollection. -func (j JobExecutionNamesCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", j.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionNamesCollection. -func (j *JobExecutionNamesCollection) 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 "value": - err = unpopulate(val, "Value", &j.Value) - 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 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) - populate(objectMap, "template", j.Template) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionProperties. -func (j *JobExecutionProperties) 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 "detailedStatus": - err = unpopulate(val, "DetailedStatus", &j.DetailedStatus) - delete(rawMsg, key) - case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &j.EndTime) - delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &j.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) - delete(rawMsg, key) - case "template": - err = unpopulate(val, "Template", &j.Template) - 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 JobExecutionTemplate. -func (j JobExecutionTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "containers", j.Containers) - populate(objectMap, "initContainers", j.InitContainers) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionTemplate. -func (j *JobExecutionTemplate) 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 "containers": - err = unpopulate(val, "Containers", &j.Containers) - delete(rawMsg, key) - case "initContainers": - err = unpopulate(val, "InitContainers", &j.InitContainers) - 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 JobPatchProperties. -func (j JobPatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "extendedLocation", j.ExtendedLocation) - populate(objectMap, "identity", j.Identity) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "tags", j.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobPatchProperties. -func (j *JobPatchProperties) 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 "extendedLocation": - err = unpopulate(val, "ExtendedLocation", &j.ExtendedLocation) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &j.Identity) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &j.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &j.Tags) - 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 JobPatchPropertiesProperties. -func (j JobPatchPropertiesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "configuration", j.Configuration) - populate(objectMap, "environmentId", j.EnvironmentID) - populate(objectMap, "eventStreamEndpoint", j.EventStreamEndpoint) - populate(objectMap, "outboundIpAddresses", j.OutboundIPAddresses) - populate(objectMap, "template", j.Template) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobPatchPropertiesProperties. -func (j *JobPatchPropertiesProperties) 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 "configuration": - err = unpopulate(val, "Configuration", &j.Configuration) - delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &j.EnvironmentID) - delete(rawMsg, key) - case "eventStreamEndpoint": - err = unpopulate(val, "EventStreamEndpoint", &j.EventStreamEndpoint) - delete(rawMsg, key) - case "outboundIpAddresses": - err = unpopulate(val, "OutboundIPAddresses", &j.OutboundIPAddresses) - delete(rawMsg, key) - case "template": - err = unpopulate(val, "Template", &j.Template) - 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 JobProperties. -func (j JobProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "configuration", j.Configuration) - populate(objectMap, "environmentId", j.EnvironmentID) - populate(objectMap, "eventStreamEndpoint", j.EventStreamEndpoint) - populate(objectMap, "outboundIpAddresses", j.OutboundIPAddresses) - populate(objectMap, "provisioningState", j.ProvisioningState) - populate(objectMap, "runningState", j.RunningState) - populate(objectMap, "template", j.Template) - populate(objectMap, "workloadProfileName", j.WorkloadProfileName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobProperties. -func (j *JobProperties) 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 "configuration": - err = unpopulate(val, "Configuration", &j.Configuration) - delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &j.EnvironmentID) - delete(rawMsg, key) - case "eventStreamEndpoint": - err = unpopulate(val, "EventStreamEndpoint", &j.EventStreamEndpoint) - delete(rawMsg, key) - case "outboundIpAddresses": - err = unpopulate(val, "OutboundIPAddresses", &j.OutboundIPAddresses) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &j.ProvisioningState) - delete(rawMsg, key) - case "runningState": - err = unpopulate(val, "RunningState", &j.RunningState) - delete(rawMsg, key) - case "template": - err = unpopulate(val, "Template", &j.Template) - delete(rawMsg, key) - case "workloadProfileName": - err = unpopulate(val, "WorkloadProfileName", &j.WorkloadProfileName) - 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 JobScale. -func (j JobScale) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxExecutions", j.MaxExecutions) - populate(objectMap, "minExecutions", j.MinExecutions) - populate(objectMap, "pollingInterval", j.PollingInterval) - populate(objectMap, "rules", j.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobScale. -func (j *JobScale) 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 "maxExecutions": - err = unpopulate(val, "MaxExecutions", &j.MaxExecutions) - delete(rawMsg, key) - case "minExecutions": - err = unpopulate(val, "MinExecutions", &j.MinExecutions) - delete(rawMsg, key) - case "pollingInterval": - err = unpopulate(val, "PollingInterval", &j.PollingInterval) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &j.Rules) - 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 JobScaleRule. -func (j JobScaleRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "auth", j.Auth) - populate(objectMap, "identity", j.Identity) - populateAny(objectMap, "metadata", j.Metadata) - populate(objectMap, "name", j.Name) - populate(objectMap, "type", j.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobScaleRule. -func (j *JobScaleRule) 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 "auth": - err = unpopulate(val, "Auth", &j.Auth) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &j.Identity) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &j.Metadata) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &j.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) - 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 JobSecretsCollection. -func (j JobSecretsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", j.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobSecretsCollection. -func (j *JobSecretsCollection) 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 "value": - err = unpopulate(val, "Value", &j.Value) - 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 JobTemplate. -func (j JobTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "containers", j.Containers) - populate(objectMap, "initContainers", j.InitContainers) - populate(objectMap, "volumes", j.Volumes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobTemplate. -func (j *JobTemplate) 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 "containers": - err = unpopulate(val, "Containers", &j.Containers) - delete(rawMsg, key) - case "initContainers": - err = unpopulate(val, "InitContainers", &j.InitContainers) - delete(rawMsg, key) - case "volumes": - err = unpopulate(val, "Volumes", &j.Volumes) - 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 JobsCollection. -func (j JobsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", j.NextLink) - populate(objectMap, "value", j.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobsCollection. -func (j *JobsCollection) 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 "nextLink": - err = unpopulate(val, "NextLink", &j.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &j.Value) - 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 JwtClaimChecks. -func (j JwtClaimChecks) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "allowedClientApplications", j.AllowedClientApplications) - populate(objectMap, "allowedGroups", j.AllowedGroups) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JwtClaimChecks. -func (j *JwtClaimChecks) 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 "allowedClientApplications": - err = unpopulate(val, "AllowedClientApplications", &j.AllowedClientApplications) - delete(rawMsg, key) - case "allowedGroups": - err = unpopulate(val, "AllowedGroups", &j.AllowedGroups) - 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 KedaConfiguration. -func (k KedaConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "version", k.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KedaConfiguration. -func (k *KedaConfiguration) 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", k, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "version": - err = unpopulate(val, "Version", &k.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", k, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ListUsagesResult. -func (l ListUsagesResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", l.NextLink) - populate(objectMap, "value", l.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ListUsagesResult. -func (l *ListUsagesResult) 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 "nextLink": - err = unpopulate(val, "NextLink", &l.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.Value) - 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 LogAnalyticsConfiguration. -func (l LogAnalyticsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "customerId", l.CustomerID) - populate(objectMap, "dynamicJsonColumns", l.DynamicJSONColumns) - populate(objectMap, "sharedKey", l.SharedKey) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsConfiguration. -func (l *LogAnalyticsConfiguration) 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 "customerId": - err = unpopulate(val, "CustomerID", &l.CustomerID) - delete(rawMsg, key) - case "dynamicJsonColumns": - err = unpopulate(val, "DynamicJSONColumns", &l.DynamicJSONColumns) - delete(rawMsg, key) - case "sharedKey": - err = unpopulate(val, "SharedKey", &l.SharedKey) - 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 LoggerSetting. -func (l LoggerSetting) 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 LoggerSetting. -func (l *LoggerSetting) 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 LogicApp. -func (l LogicApp) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "name", l.Name) - populateAny(objectMap, "properties", l.Properties) - populate(objectMap, "systemData", l.SystemData) - populate(objectMap, "type", l.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogicApp. -func (l *LogicApp) 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 "id": - err = unpopulate(val, "ID", &l.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &l.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) - 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) - populate(objectMap, "allowedExternalRedirectUrls", l.AllowedExternalRedirectUrls) - populate(objectMap, "cookieExpiration", l.CookieExpiration) - populate(objectMap, "nonce", l.Nonce) - populate(objectMap, "preserveUrlFragmentsForLogins", l.PreserveURLFragmentsForLogins) - populate(objectMap, "routes", l.Routes) - populate(objectMap, "tokenStore", l.TokenStore) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Login. -func (l *Login) 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 "allowedExternalRedirectUrls": - err = unpopulate(val, "AllowedExternalRedirectUrls", &l.AllowedExternalRedirectUrls) - delete(rawMsg, key) - case "cookieExpiration": - err = unpopulate(val, "CookieExpiration", &l.CookieExpiration) - delete(rawMsg, key) - case "nonce": - err = unpopulate(val, "Nonce", &l.Nonce) - delete(rawMsg, key) - case "preserveUrlFragmentsForLogins": - err = unpopulate(val, "PreserveURLFragmentsForLogins", &l.PreserveURLFragmentsForLogins) - delete(rawMsg, key) - case "routes": - err = unpopulate(val, "Routes", &l.Routes) - delete(rawMsg, key) - case "tokenStore": - err = unpopulate(val, "TokenStore", &l.TokenStore) - 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 LoginRoutes. -func (l LoginRoutes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "logoutEndpoint", l.LogoutEndpoint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoginRoutes. -func (l *LoginRoutes) 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 "logoutEndpoint": - err = unpopulate(val, "LogoutEndpoint", &l.LogoutEndpoint) - 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 LoginScopes. -func (l LoginScopes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "scopes", l.Scopes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LoginScopes. -func (l *LoginScopes) 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 "scopes": - err = unpopulate(val, "Scopes", &l.Scopes) - 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 LogsConfiguration. -func (l LogsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "destinations", l.Destinations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LogsConfiguration. -func (l *LogsConfiguration) 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 "destinations": - err = unpopulate(val, "Destinations", &l.Destinations) - 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 ManagedCertificate. -func (m ManagedCertificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificate. -func (m *ManagedCertificate) 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 "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &m.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) - 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 ManagedCertificateCollection. -func (m ManagedCertificateCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificateCollection. -func (m *ManagedCertificateCollection) 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 "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) - 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 ManagedCertificatePatch. -func (m ManagedCertificatePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "tags", m.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificatePatch. -func (m *ManagedCertificatePatch) 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 "tags": - err = unpopulate(val, "Tags", &m.Tags) - 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 ManagedCertificateProperties. -func (m ManagedCertificateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "domainControlValidation", m.DomainControlValidation) - populate(objectMap, "error", m.Error) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "subjectName", m.SubjectName) - populate(objectMap, "validationToken", m.ValidationToken) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificateProperties. -func (m *ManagedCertificateProperties) 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 "domainControlValidation": - err = unpopulate(val, "DomainControlValidation", &m.DomainControlValidation) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &m.Error) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) - delete(rawMsg, key) - case "subjectName": - err = unpopulate(val, "SubjectName", &m.SubjectName) - delete(rawMsg, key) - case "validationToken": - err = unpopulate(val, "ValidationToken", &m.ValidationToken) - 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 ManagedEnvironment. -func (m ManagedEnvironment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "kind", m.Kind) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironment. -func (m *ManagedEnvironment) 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 "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &m.Identity) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &m.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &m.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) - 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 ManagedEnvironmentProperties. -func (m ManagedEnvironmentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "appInsightsConfiguration", m.AppInsightsConfiguration) - populate(objectMap, "appLogsConfiguration", m.AppLogsConfiguration) - populate(objectMap, "customDomainConfiguration", m.CustomDomainConfiguration) - populate(objectMap, "daprAIConnectionString", m.DaprAIConnectionString) - populate(objectMap, "daprAIInstrumentationKey", m.DaprAIInstrumentationKey) - populate(objectMap, "daprConfiguration", m.DaprConfiguration) - populate(objectMap, "defaultDomain", m.DefaultDomain) - populate(objectMap, "deploymentErrors", m.DeploymentErrors) - populate(objectMap, "eventStreamEndpoint", m.EventStreamEndpoint) - populate(objectMap, "infrastructureResourceGroup", m.InfrastructureResourceGroup) - populate(objectMap, "kedaConfiguration", m.KedaConfiguration) - populate(objectMap, "openTelemetryConfiguration", m.OpenTelemetryConfiguration) - populate(objectMap, "peerAuthentication", m.PeerAuthentication) - populate(objectMap, "peerTrafficConfiguration", m.PeerTrafficConfiguration) - populate(objectMap, "privateEndpointConnections", m.PrivateEndpointConnections) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "publicNetworkAccess", m.PublicNetworkAccess) - populate(objectMap, "staticIp", m.StaticIP) - populate(objectMap, "vnetConfiguration", m.VnetConfiguration) - populate(objectMap, "workloadProfiles", m.WorkloadProfiles) - populate(objectMap, "zoneRedundant", m.ZoneRedundant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentProperties. -func (m *ManagedEnvironmentProperties) 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 "appInsightsConfiguration": - err = unpopulate(val, "AppInsightsConfiguration", &m.AppInsightsConfiguration) - delete(rawMsg, key) - case "appLogsConfiguration": - err = unpopulate(val, "AppLogsConfiguration", &m.AppLogsConfiguration) - delete(rawMsg, key) - case "customDomainConfiguration": - err = unpopulate(val, "CustomDomainConfiguration", &m.CustomDomainConfiguration) - delete(rawMsg, key) - case "daprAIConnectionString": - err = unpopulate(val, "DaprAIConnectionString", &m.DaprAIConnectionString) - delete(rawMsg, key) - case "daprAIInstrumentationKey": - err = unpopulate(val, "DaprAIInstrumentationKey", &m.DaprAIInstrumentationKey) - delete(rawMsg, key) - case "daprConfiguration": - err = unpopulate(val, "DaprConfiguration", &m.DaprConfiguration) - delete(rawMsg, key) - case "defaultDomain": - err = unpopulate(val, "DefaultDomain", &m.DefaultDomain) - delete(rawMsg, key) - case "deploymentErrors": - err = unpopulate(val, "DeploymentErrors", &m.DeploymentErrors) - delete(rawMsg, key) - case "eventStreamEndpoint": - err = unpopulate(val, "EventStreamEndpoint", &m.EventStreamEndpoint) - delete(rawMsg, key) - case "infrastructureResourceGroup": - err = unpopulate(val, "InfrastructureResourceGroup", &m.InfrastructureResourceGroup) - delete(rawMsg, key) - case "kedaConfiguration": - err = unpopulate(val, "KedaConfiguration", &m.KedaConfiguration) - delete(rawMsg, key) - case "openTelemetryConfiguration": - err = unpopulate(val, "OpenTelemetryConfiguration", &m.OpenTelemetryConfiguration) - delete(rawMsg, key) - case "peerAuthentication": - err = unpopulate(val, "PeerAuthentication", &m.PeerAuthentication) - delete(rawMsg, key) - case "peerTrafficConfiguration": - err = unpopulate(val, "PeerTrafficConfiguration", &m.PeerTrafficConfiguration) + case "corsPolicy": + err = unpopulate(val, "CorsPolicy", &i.CorsPolicy) delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &m.PrivateEndpointConnections) + case "customDomains": + err = unpopulate(val, "CustomDomains", &i.CustomDomains) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + case "exposedPort": + err = unpopulate(val, "ExposedPort", &i.ExposedPort) delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &m.PublicNetworkAccess) + case "external": + err = unpopulate(val, "External", &i.External) delete(rawMsg, key) - case "staticIp": - err = unpopulate(val, "StaticIP", &m.StaticIP) + case "fqdn": + err = unpopulate(val, "Fqdn", &i.Fqdn) delete(rawMsg, key) - case "vnetConfiguration": - err = unpopulate(val, "VnetConfiguration", &m.VnetConfiguration) + case "ipSecurityRestrictions": + err = unpopulate(val, "IPSecurityRestrictions", &i.IPSecurityRestrictions) delete(rawMsg, key) - case "workloadProfiles": - err = unpopulate(val, "WorkloadProfiles", &m.WorkloadProfiles) + case "stickySessions": + err = unpopulate(val, "StickySessions", &i.StickySessions) delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) + case "targetPort": + err = unpopulate(val, "TargetPort", &i.TargetPort) 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 ManagedEnvironmentPropertiesPeerAuthentication. -func (m ManagedEnvironmentPropertiesPeerAuthentication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "mtls", m.Mtls) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentPropertiesPeerAuthentication. -func (m *ManagedEnvironmentPropertiesPeerAuthentication) 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 "mtls": - err = unpopulate(val, "Mtls", &m.Mtls) + case "traffic": + err = unpopulate(val, "Traffic", &i.Traffic) 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 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) + case "transport": + err = unpopulate(val, "Transport", &i.Transport) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption. -func (m ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IngressPortMapping. +func (i IngressPortMapping) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "exposedPort", i.ExposedPort) + populate(objectMap, "external", i.External) + populate(objectMap, "targetPort", i.TargetPort) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption. -func (m *ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IngressPortMapping. +func (i *IngressPortMapping) 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) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &m.Enabled) + case "exposedPort": + err = unpopulate(val, "ExposedPort", &i.ExposedPort) + delete(rawMsg, key) + case "external": + err = unpopulate(val, "External", &i.External) + delete(rawMsg, key) + case "targetPort": + err = unpopulate(val, "TargetPort", &i.TargetPort) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentStorage. -func (m ManagedEnvironmentStorage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IngressStickySessions. +func (i IngressStickySessions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) + populate(objectMap, "affinity", i.Affinity) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentStorage. -func (m *ManagedEnvironmentStorage) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IngressStickySessions. +func (i *IngressStickySessions) 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) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "affinity": + err = unpopulate(val, "Affinity", &i.Affinity) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentStorageProperties. -func (m ManagedEnvironmentStorageProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type InitContainer. +func (i InitContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "azureFile", m.AzureFile) - populate(objectMap, "nfsAzureFile", m.NfsAzureFile) + populate(objectMap, "args", i.Args) + populate(objectMap, "command", i.Command) + populate(objectMap, "env", i.Env) + populate(objectMap, "image", i.Image) + populate(objectMap, "name", i.Name) + populate(objectMap, "resources", i.Resources) + populate(objectMap, "volumeMounts", i.VolumeMounts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentStorageProperties. -func (m *ManagedEnvironmentStorageProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type InitContainer. +func (i *InitContainer) 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) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "azureFile": - err = unpopulate(val, "AzureFile", &m.AzureFile) + case "args": + err = unpopulate(val, "Args", &i.Args) delete(rawMsg, key) - case "nfsAzureFile": - err = unpopulate(val, "NfsAzureFile", &m.NfsAzureFile) + case "command": + err = unpopulate(val, "Command", &i.Command) + delete(rawMsg, key) + case "env": + err = unpopulate(val, "Env", &i.Env) + delete(rawMsg, key) + case "image": + err = unpopulate(val, "Image", &i.Image) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &i.Resources) + delete(rawMsg, key) + case "volumeMounts": + err = unpopulate(val, "VolumeMounts", &i.VolumeMounts) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentStoragesCollection. -func (m ManagedEnvironmentStoragesCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Job. +func (j Job) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", m.Value) + populate(objectMap, "id", j.ID) + populate(objectMap, "identity", j.Identity) + populate(objectMap, "location", j.Location) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "systemData", j.SystemData) + populate(objectMap, "tags", j.Tags) + populate(objectMap, "type", j.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentStoragesCollection. -func (m *ManagedEnvironmentStoragesCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Job. +func (j *Job) 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) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &m.Value) + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &j.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &j.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &j.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &j.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentsCollection. -func (m ManagedEnvironmentsCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobConfiguration. +func (j JobConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + populate(objectMap, "eventTriggerConfig", j.EventTriggerConfig) + populate(objectMap, "manualTriggerConfig", j.ManualTriggerConfig) + populate(objectMap, "registries", j.Registries) + populate(objectMap, "replicaRetryLimit", j.ReplicaRetryLimit) + populate(objectMap, "replicaTimeout", j.ReplicaTimeout) + populate(objectMap, "scheduleTriggerConfig", j.ScheduleTriggerConfig) + populate(objectMap, "secrets", j.Secrets) + populate(objectMap, "triggerType", j.TriggerType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentsCollection. -func (m *ManagedEnvironmentsCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobConfiguration. +func (j *JobConfiguration) 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) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) + case "eventTriggerConfig": + err = unpopulate(val, "EventTriggerConfig", &j.EventTriggerConfig) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "manualTriggerConfig": + err = unpopulate(val, "ManualTriggerConfig", &j.ManualTriggerConfig) + delete(rawMsg, key) + case "registries": + err = unpopulate(val, "Registries", &j.Registries) + delete(rawMsg, key) + case "replicaRetryLimit": + err = unpopulate(val, "ReplicaRetryLimit", &j.ReplicaRetryLimit) + delete(rawMsg, key) + case "replicaTimeout": + err = unpopulate(val, "ReplicaTimeout", &j.ReplicaTimeout) + delete(rawMsg, key) + case "scheduleTriggerConfig": + err = unpopulate(val, "ScheduleTriggerConfig", &j.ScheduleTriggerConfig) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &j.Secrets) + delete(rawMsg, key) + case "triggerType": + err = unpopulate(val, "TriggerType", &j.TriggerType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. -func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobConfigurationEventTriggerConfig. +func (j JobConfigurationEventTriggerConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "principalId", m.PrincipalID) - populate(objectMap, "tenantId", m.TenantID) - populate(objectMap, "type", m.Type) - populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + populate(objectMap, "parallelism", j.Parallelism) + populate(objectMap, "replicaCompletionCount", j.ReplicaCompletionCount) + populate(objectMap, "scale", j.Scale) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. -func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobConfigurationEventTriggerConfig. +func (j *JobConfigurationEventTriggerConfig) 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) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &m.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &m.TenantID) + case "parallelism": + err = unpopulate(val, "Parallelism", &j.Parallelism) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "replicaCompletionCount": + err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + case "scale": + err = unpopulate(val, "Scale", &j.Scale) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MetricsConfiguration. -func (m MetricsConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobConfigurationManualTriggerConfig. +func (j JobConfigurationManualTriggerConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "destinations", m.Destinations) - populate(objectMap, "includeKeda", m.IncludeKeda) + populate(objectMap, "parallelism", j.Parallelism) + populate(objectMap, "replicaCompletionCount", j.ReplicaCompletionCount) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricsConfiguration. -func (m *MetricsConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobConfigurationManualTriggerConfig. +func (j *JobConfigurationManualTriggerConfig) 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) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "destinations": - err = unpopulate(val, "Destinations", &m.Destinations) + case "parallelism": + err = unpopulate(val, "Parallelism", &j.Parallelism) delete(rawMsg, key) - case "includeKeda": - err = unpopulate(val, "IncludeKeda", &m.IncludeKeda) + case "replicaCompletionCount": + err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Mtls. -func (m Mtls) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobConfigurationScheduleTriggerConfig. +func (j JobConfigurationScheduleTriggerConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", m.Enabled) + populate(objectMap, "cronExpression", j.CronExpression) + populate(objectMap, "parallelism", j.Parallelism) + populate(objectMap, "replicaCompletionCount", j.ReplicaCompletionCount) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Mtls. -func (m *Mtls) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobConfigurationScheduleTriggerConfig. +func (j *JobConfigurationScheduleTriggerConfig) 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) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &m.Enabled) + case "cronExpression": + err = unpopulate(val, "CronExpression", &j.CronExpression) + delete(rawMsg, key) + case "parallelism": + err = unpopulate(val, "Parallelism", &j.Parallelism) + delete(rawMsg, key) + case "replicaCompletionCount": + err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type NacosComponent. -func (n NacosComponent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobExecution. +func (j JobExecution) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["componentType"] = JavaComponentTypeNacos - populate(objectMap, "configurations", n.Configurations) - populate(objectMap, "ingress", n.Ingress) - populate(objectMap, "provisioningState", n.ProvisioningState) - populate(objectMap, "scale", n.Scale) - populate(objectMap, "serviceBinds", n.ServiceBinds) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "type", j.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type NacosComponent. -func (n *NacosComponent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecution. +func (j *JobExecution) 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) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - 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) + case "id": + err = unpopulate(val, "ID", &j.ID) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + case "name": + err = unpopulate(val, "Name", &j.Name) delete(rawMsg, key) - case "scale": - err = unpopulate(val, "Scale", &n.Scale) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) delete(rawMsg, key) - case "serviceBinds": - err = unpopulate(val, "ServiceBinds", &n.ServiceBinds) + case "type": + err = unpopulate(val, "Type", &j.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } 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 JobExecutionBase. +func (j JobExecutionBase) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "accessMode", n.AccessMode) - populate(objectMap, "server", n.Server) - populate(objectMap, "shareName", n.ShareName) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) 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 JobExecutionBase. +func (j *JobExecutionBase) 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) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "accessMode": - err = unpopulate(val, "AccessMode", &n.AccessMode) - delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &n.Server) + case "id": + err = unpopulate(val, "ID", &j.ID) delete(rawMsg, key) - case "shareName": - err = unpopulate(val, "ShareName", &n.ShareName) + case "name": + err = unpopulate(val, "Name", &j.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Nonce. -func (n Nonce) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobExecutionContainer. +func (j JobExecutionContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nonceExpirationInterval", n.NonceExpirationInterval) - populate(objectMap, "validateNonce", n.ValidateNonce) + populate(objectMap, "args", j.Args) + populate(objectMap, "command", j.Command) + populate(objectMap, "env", j.Env) + populate(objectMap, "image", j.Image) + populate(objectMap, "name", j.Name) + populate(objectMap, "resources", j.Resources) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Nonce. -func (n *Nonce) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionContainer. +func (j *JobExecutionContainer) 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) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "nonceExpirationInterval": - err = unpopulate(val, "NonceExpirationInterval", &n.NonceExpirationInterval) + case "args": + err = unpopulate(val, "Args", &j.Args) delete(rawMsg, key) - case "validateNonce": - err = unpopulate(val, "ValidateNonce", &n.ValidateNonce) + case "command": + err = unpopulate(val, "Command", &j.Command) + delete(rawMsg, key) + case "env": + err = unpopulate(val, "Env", &j.Env) + delete(rawMsg, key) + case "image": + err = unpopulate(val, "Image", &j.Image) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &j.Resources) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OpenIDConnectClientCredential. -func (o OpenIDConnectClientCredential) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobExecutionNamesCollection. +func (j JobExecutionNamesCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientSecretSettingName", o.ClientSecretSettingName) - objectMap["method"] = "ClientSecretPost" + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDConnectClientCredential. -func (o *OpenIDConnectClientCredential) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionNamesCollection. +func (j *JobExecutionNamesCollection) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "clientSecretSettingName": - err = unpopulate(val, "ClientSecretSettingName", &o.ClientSecretSettingName) - delete(rawMsg, key) - case "method": - err = unpopulate(val, "Method", &o.Method) + case "value": + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OpenIDConnectConfig. -func (o OpenIDConnectConfig) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobExecutionProperties. +func (j JobExecutionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authorizationEndpoint", o.AuthorizationEndpoint) - populate(objectMap, "certificationUri", o.CertificationURI) - populate(objectMap, "issuer", o.Issuer) - populate(objectMap, "tokenEndpoint", o.TokenEndpoint) - populate(objectMap, "wellKnownOpenIdConfiguration", o.WellKnownOpenIDConfiguration) + populateDateTimeRFC3339(objectMap, "endTime", j.EndTime) + populateDateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "status", j.Status) + populate(objectMap, "template", j.Template) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDConnectConfig. -func (o *OpenIDConnectConfig) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionProperties. +func (j *JobExecutionProperties) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "authorizationEndpoint": - err = unpopulate(val, "AuthorizationEndpoint", &o.AuthorizationEndpoint) - delete(rawMsg, key) - case "certificationUri": - err = unpopulate(val, "CertificationURI", &o.CertificationURI) + case "endTime": + err = unpopulateDateTimeRFC3339(val, "EndTime", &j.EndTime) delete(rawMsg, key) - case "issuer": - err = unpopulate(val, "Issuer", &o.Issuer) + case "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &j.StartTime) delete(rawMsg, key) - case "tokenEndpoint": - err = unpopulate(val, "TokenEndpoint", &o.TokenEndpoint) + case "status": + err = unpopulate(val, "Status", &j.Status) delete(rawMsg, key) - case "wellKnownOpenIdConfiguration": - err = unpopulate(val, "WellKnownOpenIDConfiguration", &o.WellKnownOpenIDConfiguration) + case "template": + err = unpopulate(val, "Template", &j.Template) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OpenIDConnectLogin. -func (o OpenIDConnectLogin) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobExecutionTemplate. +func (j JobExecutionTemplate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nameClaimType", o.NameClaimType) - populate(objectMap, "scopes", o.Scopes) + populate(objectMap, "containers", j.Containers) + populate(objectMap, "initContainers", j.InitContainers) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDConnectLogin. -func (o *OpenIDConnectLogin) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionTemplate. +func (j *JobExecutionTemplate) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "nameClaimType": - err = unpopulate(val, "NameClaimType", &o.NameClaimType) + case "containers": + err = unpopulate(val, "Containers", &j.Containers) delete(rawMsg, key) - case "scopes": - err = unpopulate(val, "Scopes", &o.Scopes) + case "initContainers": + err = unpopulate(val, "InitContainers", &j.InitContainers) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OpenIDConnectRegistration. -func (o OpenIDConnectRegistration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobPatchProperties. +func (j JobPatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientCredential", o.ClientCredential) - populate(objectMap, "clientId", o.ClientID) - populate(objectMap, "openIdConnectConfiguration", o.OpenIDConnectConfiguration) + populate(objectMap, "identity", j.Identity) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "tags", j.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDConnectRegistration. -func (o *OpenIDConnectRegistration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobPatchProperties. +func (j *JobPatchProperties) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "clientCredential": - err = unpopulate(val, "ClientCredential", &o.ClientCredential) + case "identity": + err = unpopulate(val, "Identity", &j.Identity) delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &o.ClientID) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) delete(rawMsg, key) - case "openIdConnectConfiguration": - err = unpopulate(val, "OpenIDConnectConfiguration", &o.OpenIDConnectConfiguration) + case "tags": + err = unpopulate(val, "Tags", &j.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OpenTelemetryConfiguration. -func (o OpenTelemetryConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobPatchPropertiesProperties. +func (j JobPatchPropertiesProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "destinationsConfiguration", o.DestinationsConfiguration) - populate(objectMap, "logsConfiguration", o.LogsConfiguration) - populate(objectMap, "metricsConfiguration", o.MetricsConfiguration) - populate(objectMap, "tracesConfiguration", o.TracesConfiguration) + populate(objectMap, "configuration", j.Configuration) + populate(objectMap, "environmentId", j.EnvironmentID) + populate(objectMap, "eventStreamEndpoint", j.EventStreamEndpoint) + populate(objectMap, "outboundIpAddresses", j.OutboundIPAddresses) + populate(objectMap, "template", j.Template) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OpenTelemetryConfiguration. -func (o *OpenTelemetryConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobPatchPropertiesProperties. +func (j *JobPatchPropertiesProperties) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "destinationsConfiguration": - err = unpopulate(val, "DestinationsConfiguration", &o.DestinationsConfiguration) + case "configuration": + err = unpopulate(val, "Configuration", &j.Configuration) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &j.EnvironmentID) delete(rawMsg, key) - case "logsConfiguration": - err = unpopulate(val, "LogsConfiguration", &o.LogsConfiguration) + case "eventStreamEndpoint": + err = unpopulate(val, "EventStreamEndpoint", &j.EventStreamEndpoint) delete(rawMsg, key) - case "metricsConfiguration": - err = unpopulate(val, "MetricsConfiguration", &o.MetricsConfiguration) + case "outboundIpAddresses": + err = unpopulate(val, "OutboundIPAddresses", &j.OutboundIPAddresses) delete(rawMsg, key) - case "tracesConfiguration": - err = unpopulate(val, "TracesConfiguration", &o.TracesConfiguration) + case "template": + err = unpopulate(val, "Template", &j.Template) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDetail. -func (o OperationDetail) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobProperties. +func (j JobProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "display", o.Display) - populate(objectMap, "isDataAction", o.IsDataAction) - populate(objectMap, "name", o.Name) - populate(objectMap, "origin", o.Origin) + populate(objectMap, "configuration", j.Configuration) + populate(objectMap, "environmentId", j.EnvironmentID) + populate(objectMap, "eventStreamEndpoint", j.EventStreamEndpoint) + populate(objectMap, "outboundIpAddresses", j.OutboundIPAddresses) + populate(objectMap, "provisioningState", j.ProvisioningState) + populate(objectMap, "template", j.Template) + populate(objectMap, "workloadProfileName", j.WorkloadProfileName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDetail. -func (o *OperationDetail) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobProperties. +func (j *JobProperties) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) + case "configuration": + err = unpopulate(val, "Configuration", &j.Configuration) delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &o.IsDataAction) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &j.EnvironmentID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "eventStreamEndpoint": + err = unpopulate(val, "EventStreamEndpoint", &j.EventStreamEndpoint) delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) + case "outboundIpAddresses": + err = unpopulate(val, "OutboundIPAddresses", &j.OutboundIPAddresses) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &j.ProvisioningState) + delete(rawMsg, key) + case "template": + err = unpopulate(val, "Template", &j.Template) + delete(rawMsg, key) + case "workloadProfileName": + err = unpopulate(val, "WorkloadProfileName", &j.WorkloadProfileName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. -func (o OperationDisplay) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobScale. +func (j JobScale) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", o.Description) - populate(objectMap, "operation", o.Operation) - populate(objectMap, "provider", o.Provider) - populate(objectMap, "resource", o.Resource) + populate(objectMap, "maxExecutions", j.MaxExecutions) + populate(objectMap, "minExecutions", j.MinExecutions) + populate(objectMap, "pollingInterval", j.PollingInterval) + populate(objectMap, "rules", j.Rules) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. -func (o *OperationDisplay) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobScale. +func (j *JobScale) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &o.Description) + case "maxExecutions": + err = unpopulate(val, "MaxExecutions", &j.MaxExecutions) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &o.Operation) + case "minExecutions": + err = unpopulate(val, "MinExecutions", &j.MinExecutions) delete(rawMsg, key) - case "provider": - err = unpopulate(val, "Provider", &o.Provider) + case "pollingInterval": + err = unpopulate(val, "PollingInterval", &j.PollingInterval) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "rules": + err = unpopulate(val, "Rules", &j.Rules) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OtlpConfiguration. -func (o OtlpConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobScaleRule. +func (j JobScaleRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "endpoint", o.Endpoint) - populate(objectMap, "headers", o.Headers) - populate(objectMap, "insecure", o.Insecure) - populate(objectMap, "name", o.Name) + populate(objectMap, "auth", j.Auth) + populate(objectMap, "identity", j.Identity) + populateAny(objectMap, "metadata", j.Metadata) + populate(objectMap, "name", j.Name) + populate(objectMap, "type", j.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OtlpConfiguration. -func (o *OtlpConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobScaleRule. +func (j *JobScaleRule) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "endpoint": - err = unpopulate(val, "Endpoint", &o.Endpoint) + case "auth": + err = unpopulate(val, "Auth", &j.Auth) delete(rawMsg, key) - case "headers": - err = unpopulate(val, "Headers", &o.Headers) + case "identity": + err = unpopulate(val, "Identity", &j.Identity) delete(rawMsg, key) - case "insecure": - err = unpopulate(val, "Insecure", &o.Insecure) + case "metadata": + err = unpopulate(val, "Metadata", &j.Metadata) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &o.Name) + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PatchCollection. -func (p PatchCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobSecretsCollection. +func (j JobSecretsCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchCollection. -func (p *PatchCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobSecretsCollection. +func (j *JobSecretsCollection) 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) + return fmt.Errorf("unmarshalling type %T: %v", j, 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) + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PatchDetails. -func (p PatchDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobTemplate. +func (j JobTemplate) 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) + populate(objectMap, "containers", j.Containers) + populate(objectMap, "initContainers", j.InitContainers) + populate(objectMap, "volumes", j.Volumes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchDetails. -func (p *PatchDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobTemplate. +func (j *JobTemplate) 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) + return fmt.Errorf("unmarshalling type %T: %v", j, 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) + case "containers": + err = unpopulate(val, "Containers", &j.Containers) delete(rawMsg, key) - case "targetContainerName": - err = unpopulate(val, "TargetContainerName", &p.TargetContainerName) + case "initContainers": + err = unpopulate(val, "InitContainers", &j.InitContainers) delete(rawMsg, key) - case "targetImage": - err = unpopulate(val, "TargetImage", &p.TargetImage) + case "volumes": + err = unpopulate(val, "Volumes", &j.Volumes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PatchDetailsNewLayer. -func (p PatchDetailsNewLayer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobsCollection. +func (j JobsCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "frameworkAndVersion", p.FrameworkAndVersion) - populate(objectMap, "name", p.Name) - populate(objectMap, "osAndVersion", p.OSAndVersion) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchDetailsNewLayer. -func (p *PatchDetailsNewLayer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JobsCollection. +func (j *JobsCollection) 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) + return fmt.Errorf("unmarshalling type %T: %v", j, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) delete(rawMsg, key) - case "osAndVersion": - err = unpopulate(val, "OSAndVersion", &p.OSAndVersion) + case "value": + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PatchDetailsOldLayer. -func (p PatchDetailsOldLayer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JwtClaimChecks. +func (j JwtClaimChecks) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "frameworkAndVersion", p.FrameworkAndVersion) - populate(objectMap, "name", p.Name) - populate(objectMap, "osAndVersion", p.OSAndVersion) + populate(objectMap, "allowedClientApplications", j.AllowedClientApplications) + populate(objectMap, "allowedGroups", j.AllowedGroups) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchDetailsOldLayer. -func (p *PatchDetailsOldLayer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type JwtClaimChecks. +func (j *JwtClaimChecks) 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) + return fmt.Errorf("unmarshalling type %T: %v", j, 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) + case "allowedClientApplications": + err = unpopulate(val, "AllowedClientApplications", &j.AllowedClientApplications) delete(rawMsg, key) - case "osAndVersion": - err = unpopulate(val, "OSAndVersion", &p.OSAndVersion) + case "allowedGroups": + err = unpopulate(val, "AllowedGroups", &j.AllowedGroups) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PatchProperties. -func (p PatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KedaConfiguration. +func (k KedaConfiguration) 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) + populate(objectMap, "version", k.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchProperties. -func (p *PatchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type KedaConfiguration. +func (k *KedaConfiguration) 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) + return fmt.Errorf("unmarshalling type %T: %v", k, 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) + case "version": + err = unpopulate(val, "Version", &k.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PatchSkipConfig. -func (p PatchSkipConfig) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ListUsagesResult. +func (l ListUsagesResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "skip", p.Skip) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PatchSkipConfig. -func (p *PatchSkipConfig) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ListUsagesResult. +func (l *ListUsagesResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "skip": - err = unpopulate(val, "Skip", &p.Skip) + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PreBuildStep. -func (p PreBuildStep) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsConfiguration. +func (l LogAnalyticsConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", p.Description) - populate(objectMap, "httpGet", p.HTTPGet) - populate(objectMap, "scripts", p.Scripts) + populate(objectMap, "customerId", l.CustomerID) + populate(objectMap, "sharedKey", l.SharedKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PreBuildStep. -func (p *PreBuildStep) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsConfiguration. +func (l *LogAnalyticsConfiguration) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, 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) + case "customerId": + err = unpopulate(val, "CustomerID", &l.CustomerID) delete(rawMsg, key) - case "scripts": - err = unpopulate(val, "Scripts", &p.Scripts) + case "sharedKey": + err = unpopulate(val, "SharedKey", &l.SharedKey) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. -func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoggerSetting. +func (l LoggerSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) + populate(objectMap, "level", l.Level) + populate(objectMap, "logger", l.Logger) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. -func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerSetting. +func (l *LoggerSetting) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. -func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Login. +func (l Login) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) + populate(objectMap, "allowedExternalRedirectUrls", l.AllowedExternalRedirectUrls) + populate(objectMap, "cookieExpiration", l.CookieExpiration) + populate(objectMap, "nonce", l.Nonce) + populate(objectMap, "preserveUrlFragmentsForLogins", l.PreserveURLFragmentsForLogins) + populate(objectMap, "routes", l.Routes) + populate(objectMap, "tokenStore", l.TokenStore) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. -func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Login. +func (l *Login) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "allowedExternalRedirectUrls": + err = unpopulate(val, "AllowedExternalRedirectUrls", &l.AllowedExternalRedirectUrls) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "cookieExpiration": + err = unpopulate(val, "CookieExpiration", &l.CookieExpiration) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) + case "nonce": + err = unpopulate(val, "Nonce", &l.Nonce) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + case "preserveUrlFragmentsForLogins": + err = unpopulate(val, "PreserveURLFragmentsForLogins", &l.PreserveURLFragmentsForLogins) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "routes": + err = unpopulate(val, "Routes", &l.Routes) + delete(rawMsg, key) + case "tokenStore": + err = unpopulate(val, "TokenStore", &l.TokenStore) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoginRoutes. +func (l LoginRoutes) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "logoutEndpoint", l.LogoutEndpoint) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. -func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoginRoutes. +func (l *LoginRoutes) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, 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) + case "logoutEndpoint": + err = unpopulate(val, "LogoutEndpoint", &l.LogoutEndpoint) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type LoginScopes. +func (l LoginScopes) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupIds", p.GroupIDs) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "scopes", l.Scopes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. -func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type LoginScopes. +func (l *LoginScopes) 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) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "groupIds": - err = unpopulate(val, "GroupIDs", &p.GroupIDs) - delete(rawMsg, key) - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) - delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "scopes": + err = unpopulate(val, "Scopes", &l.Scopes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. -func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedCertificate. +func (m ManagedCertificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. -func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificate. +func (m *ManagedCertificate) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &p.ID) + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &p.Properties) + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &p.Type) + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedCertificateCollection. +func (m ManagedCertificateCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. -func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificateCollection. +func (m *ManagedCertificateCollection) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &p.Value) + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedCertificatePatch. +func (m ManagedCertificatePatch) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + populate(objectMap, "tags", m.Tags) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. -func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificatePatch. +func (m *ManagedCertificatePatch) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) - delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) - delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. -func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedCertificateProperties. +func (m ManagedCertificateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionsRequired", p.ActionsRequired) - populate(objectMap, "description", p.Description) - populate(objectMap, "status", p.Status) + populate(objectMap, "domainControlValidation", m.DomainControlValidation) + populate(objectMap, "error", m.Error) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "subjectName", m.SubjectName) + populate(objectMap, "validationToken", m.ValidationToken) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. -func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificateProperties. +func (m *ManagedCertificateProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + case "domainControlValidation": + err = unpopulate(val, "DomainControlValidation", &m.DomainControlValidation) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) + case "error": + err = unpopulate(val, "Error", &m.Error) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "subjectName": + err = unpopulate(val, "SubjectName", &m.SubjectName) + delete(rawMsg, key) + case "validationToken": + err = unpopulate(val, "ValidationToken", &m.ValidationToken) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironment. +func (m ManagedEnvironment) 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) + populate(objectMap, "id", m.ID) + populate(objectMap, "kind", m.Kind) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. -func (p *ProxyResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironment. +func (m *ManagedEnvironment) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &p.ID) + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &p.Name) + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &p.Type) + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type QueueScaleRule. -func (q QueueScaleRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentProperties. +func (m ManagedEnvironmentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "accountName", q.AccountName) - populate(objectMap, "auth", q.Auth) - populate(objectMap, "identity", q.Identity) - populate(objectMap, "queueLength", q.QueueLength) - populate(objectMap, "queueName", q.QueueName) + populate(objectMap, "appLogsConfiguration", m.AppLogsConfiguration) + populate(objectMap, "customDomainConfiguration", m.CustomDomainConfiguration) + populate(objectMap, "daprAIConnectionString", m.DaprAIConnectionString) + populate(objectMap, "daprAIInstrumentationKey", m.DaprAIInstrumentationKey) + populate(objectMap, "daprConfiguration", m.DaprConfiguration) + populate(objectMap, "defaultDomain", m.DefaultDomain) + populate(objectMap, "deploymentErrors", m.DeploymentErrors) + populate(objectMap, "eventStreamEndpoint", m.EventStreamEndpoint) + populate(objectMap, "infrastructureResourceGroup", m.InfrastructureResourceGroup) + populate(objectMap, "kedaConfiguration", m.KedaConfiguration) + 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) + populate(objectMap, "workloadProfiles", m.WorkloadProfiles) + populate(objectMap, "zoneRedundant", m.ZoneRedundant) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type QueueScaleRule. -func (q *QueueScaleRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentProperties. +func (m *ManagedEnvironmentProperties) 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", q, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "accountName": - err = unpopulate(val, "AccountName", &q.AccountName) + case "appLogsConfiguration": + err = unpopulate(val, "AppLogsConfiguration", &m.AppLogsConfiguration) delete(rawMsg, key) - case "auth": - err = unpopulate(val, "Auth", &q.Auth) + case "customDomainConfiguration": + err = unpopulate(val, "CustomDomainConfiguration", &m.CustomDomainConfiguration) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &q.Identity) + case "daprAIConnectionString": + err = unpopulate(val, "DaprAIConnectionString", &m.DaprAIConnectionString) + delete(rawMsg, key) + case "daprAIInstrumentationKey": + err = unpopulate(val, "DaprAIInstrumentationKey", &m.DaprAIInstrumentationKey) + delete(rawMsg, key) + case "daprConfiguration": + err = unpopulate(val, "DaprConfiguration", &m.DaprConfiguration) + delete(rawMsg, key) + case "defaultDomain": + err = unpopulate(val, "DefaultDomain", &m.DefaultDomain) + delete(rawMsg, key) + case "deploymentErrors": + err = unpopulate(val, "DeploymentErrors", &m.DeploymentErrors) + delete(rawMsg, key) + case "eventStreamEndpoint": + err = unpopulate(val, "EventStreamEndpoint", &m.EventStreamEndpoint) + delete(rawMsg, key) + case "infrastructureResourceGroup": + err = unpopulate(val, "InfrastructureResourceGroup", &m.InfrastructureResourceGroup) + delete(rawMsg, key) + case "kedaConfiguration": + err = unpopulate(val, "KedaConfiguration", &m.KedaConfiguration) + delete(rawMsg, key) + case "peerAuthentication": + err = unpopulate(val, "PeerAuthentication", &m.PeerAuthentication) delete(rawMsg, key) - case "queueLength": - err = unpopulate(val, "QueueLength", &q.QueueLength) + case "peerTrafficConfiguration": + err = unpopulate(val, "PeerTrafficConfiguration", &m.PeerTrafficConfiguration) delete(rawMsg, key) - case "queueName": - err = unpopulate(val, "QueueName", &q.QueueName) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RegistryCredentials. -func (r RegistryCredentials) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identity", r.Identity) - populate(objectMap, "passwordSecretRef", r.PasswordSecretRef) - populate(objectMap, "server", r.Server) - populate(objectMap, "username", r.Username) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryCredentials. -func (r *RegistryCredentials) 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 "identity": - err = unpopulate(val, "Identity", &r.Identity) + case "staticIp": + err = unpopulate(val, "StaticIP", &m.StaticIP) delete(rawMsg, key) - case "passwordSecretRef": - err = unpopulate(val, "PasswordSecretRef", &r.PasswordSecretRef) + case "vnetConfiguration": + err = unpopulate(val, "VnetConfiguration", &m.VnetConfiguration) delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &r.Server) + case "workloadProfiles": + err = unpopulate(val, "WorkloadProfiles", &m.WorkloadProfiles) delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &r.Username) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RegistryInfo. -func (r RegistryInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentPropertiesPeerAuthentication. +func (m ManagedEnvironmentPropertiesPeerAuthentication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "registryPassword", r.RegistryPassword) - populate(objectMap, "registryUrl", r.RegistryURL) - populate(objectMap, "registryUserName", r.RegistryUserName) + populate(objectMap, "mtls", m.Mtls) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryInfo. -func (r *RegistryInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentPropertiesPeerAuthentication. +func (m *ManagedEnvironmentPropertiesPeerAuthentication) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "registryPassword": - err = unpopulate(val, "RegistryPassword", &r.RegistryPassword) - delete(rawMsg, key) - case "registryUrl": - err = unpopulate(val, "RegistryURL", &r.RegistryURL) - delete(rawMsg, key) - case "registryUserName": - err = unpopulate(val, "RegistryUserName", &r.RegistryUserName) + case "mtls": + err = unpopulate(val, "Mtls", &m.Mtls) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Replica. -func (r Replica) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentPropertiesPeerTrafficConfiguration. +func (m ManagedEnvironmentPropertiesPeerTrafficConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "type", r.Type) + populate(objectMap, "encryption", m.Encryption) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Replica. -func (r *Replica) UnmarshalJSON(data []byte) error { +// 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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 "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "encryption": + err = unpopulate(val, "Encryption", &m.Encryption) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicaCollection. -func (r ReplicaCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption. +func (m ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", r.Value) + populate(objectMap, "enabled", m.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaCollection. -func (r *ReplicaCollection) UnmarshalJSON(data []byte) error { +// 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &r.Value) + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicaContainer. -func (r ReplicaContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentStorage. +func (m ManagedEnvironmentStorage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "containerId", r.ContainerID) - populate(objectMap, "debugEndpoint", r.DebugEndpoint) - populate(objectMap, "execEndpoint", r.ExecEndpoint) - populate(objectMap, "logStreamEndpoint", r.LogStreamEndpoint) - populate(objectMap, "name", r.Name) - populate(objectMap, "ready", r.Ready) - populate(objectMap, "restartCount", r.RestartCount) - populate(objectMap, "runningState", r.RunningState) - populate(objectMap, "runningStateDetails", r.RunningStateDetails) - populate(objectMap, "started", r.Started) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaContainer. -func (r *ReplicaContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentStorage. +func (m *ManagedEnvironmentStorage) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "containerId": - err = unpopulate(val, "ContainerID", &r.ContainerID) - delete(rawMsg, key) - case "debugEndpoint": - err = unpopulate(val, "DebugEndpoint", &r.DebugEndpoint) - delete(rawMsg, key) - case "execEndpoint": - err = unpopulate(val, "ExecEndpoint", &r.ExecEndpoint) - delete(rawMsg, key) - case "logStreamEndpoint": - err = unpopulate(val, "LogStreamEndpoint", &r.LogStreamEndpoint) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "ready": - err = unpopulate(val, "Ready", &r.Ready) - delete(rawMsg, key) - case "restartCount": - err = unpopulate(val, "RestartCount", &r.RestartCount) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) - case "runningState": - err = unpopulate(val, "RunningState", &r.RunningState) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) - case "runningStateDetails": - err = unpopulate(val, "RunningStateDetails", &r.RunningStateDetails) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) delete(rawMsg, key) - case "started": - err = unpopulate(val, "Started", &r.Started) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicaExecutionStatus. -func (r ReplicaExecutionStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentStorageProperties. +func (m ManagedEnvironmentStorageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "containers", r.Containers) - populate(objectMap, "name", r.Name) + populate(objectMap, "azureFile", m.AzureFile) + populate(objectMap, "nfsAzureFile", m.NfsAzureFile) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaExecutionStatus. -func (r *ReplicaExecutionStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentStorageProperties. +func (m *ManagedEnvironmentStorageProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "containers": - err = unpopulate(val, "Containers", &r.Containers) + case "azureFile": + err = unpopulate(val, "AzureFile", &m.AzureFile) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "nfsAzureFile": + err = unpopulate(val, "NfsAzureFile", &m.NfsAzureFile) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicaProperties. -func (r ReplicaProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentStoragesCollection. +func (m ManagedEnvironmentStoragesCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "containers", r.Containers) - populateDateTimeRFC3339(objectMap, "createdTime", r.CreatedTime) - populate(objectMap, "initContainers", r.InitContainers) - populate(objectMap, "runningState", r.RunningState) - populate(objectMap, "runningStateDetails", r.RunningStateDetails) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaProperties. -func (r *ReplicaProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentStoragesCollection. +func (m *ManagedEnvironmentStoragesCollection) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "containers": - err = unpopulate(val, "Containers", &r.Containers) - delete(rawMsg, key) - case "createdTime": - err = unpopulateDateTimeRFC3339(val, "CreatedTime", &r.CreatedTime) - delete(rawMsg, key) - case "initContainers": - err = unpopulate(val, "InitContainers", &r.InitContainers) - delete(rawMsg, key) - case "runningState": - err = unpopulate(val, "RunningState", &r.RunningState) - delete(rawMsg, key) - case "runningStateDetails": - err = unpopulate(val, "RunningStateDetails", &r.RunningStateDetails) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentsCollection. +func (m ManagedEnvironmentsCollection) 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) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentsCollection. +func (m *ManagedEnvironmentsCollection) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Revision. -func (r Revision) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "type", r.Type) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Revision. -func (r *Revision) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, 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 "properties": - err = unpopulate(val, "Properties", &r.Properties) + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &r.Type) + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RevisionCollection. -func (r RevisionCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Mtls. +func (m Mtls) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) + populate(objectMap, "enabled", m.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RevisionCollection. -func (r *RevisionCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Mtls. +func (m *Mtls) 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) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RevisionProperties. -func (r RevisionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NfsAzureFileProperties. +func (n NfsAzureFileProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "active", r.Active) - populateDateTimeRFC3339(objectMap, "createdTime", r.CreatedTime) - populate(objectMap, "fqdn", r.Fqdn) - populate(objectMap, "healthState", r.HealthState) - populateDateTimeRFC3339(objectMap, "lastActiveTime", r.LastActiveTime) - populate(objectMap, "provisioningError", r.ProvisioningError) - populate(objectMap, "provisioningState", r.ProvisioningState) - populate(objectMap, "replicas", r.Replicas) - populate(objectMap, "runningState", r.RunningState) - populate(objectMap, "template", r.Template) - populate(objectMap, "trafficWeight", r.TrafficWeight) + 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 RevisionProperties. -func (r *RevisionProperties) UnmarshalJSON(data []byte) error { +// 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", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "active": - err = unpopulate(val, "Active", &r.Active) - delete(rawMsg, key) - case "createdTime": - err = unpopulateDateTimeRFC3339(val, "CreatedTime", &r.CreatedTime) - delete(rawMsg, key) - case "fqdn": - err = unpopulate(val, "Fqdn", &r.Fqdn) - delete(rawMsg, key) - case "healthState": - err = unpopulate(val, "HealthState", &r.HealthState) - delete(rawMsg, key) - case "lastActiveTime": - err = unpopulateDateTimeRFC3339(val, "LastActiveTime", &r.LastActiveTime) - delete(rawMsg, key) - case "provisioningError": - err = unpopulate(val, "ProvisioningError", &r.ProvisioningError) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) - delete(rawMsg, key) - case "replicas": - err = unpopulate(val, "Replicas", &r.Replicas) - delete(rawMsg, key) - case "runningState": - err = unpopulate(val, "RunningState", &r.RunningState) + case "accessMode": + err = unpopulate(val, "AccessMode", &n.AccessMode) delete(rawMsg, key) - case "template": - err = unpopulate(val, "Template", &r.Template) + case "server": + err = unpopulate(val, "Server", &n.Server) delete(rawMsg, key) - case "trafficWeight": - err = unpopulate(val, "TrafficWeight", &r.TrafficWeight) + case "shareName": + err = unpopulate(val, "ShareName", &n.ShareName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Runtime. -func (r Runtime) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Nonce. +func (n Nonce) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dotnet", r.Dotnet) - populate(objectMap, "java", r.Java) + populate(objectMap, "nonceExpirationInterval", n.NonceExpirationInterval) + populate(objectMap, "validateNonce", n.ValidateNonce) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Runtime. -func (r *Runtime) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Nonce. +func (n *Nonce) 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) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "dotnet": - err = unpopulate(val, "Dotnet", &r.Dotnet) + case "nonceExpirationInterval": + err = unpopulate(val, "NonceExpirationInterval", &n.NonceExpirationInterval) delete(rawMsg, key) - case "java": - err = unpopulate(val, "Java", &r.Java) + case "validateNonce": + err = unpopulate(val, "ValidateNonce", &n.ValidateNonce) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RuntimeDotnet. -func (r RuntimeDotnet) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OpenIDConnectClientCredential. +func (o OpenIDConnectClientCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autoConfigureDataProtection", r.AutoConfigureDataProtection) + populate(objectMap, "clientSecretSettingName", o.ClientSecretSettingName) + objectMap["method"] = "ClientSecretPost" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RuntimeDotnet. -func (r *RuntimeDotnet) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDConnectClientCredential. +func (o *OpenIDConnectClientCredential) 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) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "autoConfigureDataProtection": - err = unpopulate(val, "AutoConfigureDataProtection", &r.AutoConfigureDataProtection) + case "clientSecretSettingName": + err = unpopulate(val, "ClientSecretSettingName", &o.ClientSecretSettingName) + delete(rawMsg, key) + case "method": + err = unpopulate(val, "Method", &o.Method) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RuntimeJava. -func (r RuntimeJava) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OpenIDConnectConfig. +func (o OpenIDConnectConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enableMetrics", r.EnableMetrics) - populate(objectMap, "javaAgent", r.JavaAgent) + populate(objectMap, "authorizationEndpoint", o.AuthorizationEndpoint) + populate(objectMap, "certificationUri", o.CertificationURI) + populate(objectMap, "issuer", o.Issuer) + populate(objectMap, "tokenEndpoint", o.TokenEndpoint) + populate(objectMap, "wellKnownOpenIdConfiguration", o.WellKnownOpenIDConfiguration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RuntimeJava. -func (r *RuntimeJava) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDConnectConfig. +func (o *OpenIDConnectConfig) 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) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "enableMetrics": - err = unpopulate(val, "EnableMetrics", &r.EnableMetrics) + case "authorizationEndpoint": + err = unpopulate(val, "AuthorizationEndpoint", &o.AuthorizationEndpoint) delete(rawMsg, key) - case "javaAgent": - err = unpopulate(val, "JavaAgent", &r.JavaAgent) + case "certificationUri": + err = unpopulate(val, "CertificationURI", &o.CertificationURI) + delete(rawMsg, key) + case "issuer": + err = unpopulate(val, "Issuer", &o.Issuer) + delete(rawMsg, key) + case "tokenEndpoint": + err = unpopulate(val, "TokenEndpoint", &o.TokenEndpoint) + delete(rawMsg, key) + case "wellKnownOpenIdConfiguration": + err = unpopulate(val, "WellKnownOpenIDConfiguration", &o.WellKnownOpenIDConfiguration) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RuntimeJavaAgent. -func (r RuntimeJavaAgent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OpenIDConnectLogin. +func (o OpenIDConnectLogin) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", r.Enabled) - populate(objectMap, "logging", r.Logging) + populate(objectMap, "nameClaimType", o.NameClaimType) + populate(objectMap, "scopes", o.Scopes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RuntimeJavaAgent. -func (r *RuntimeJavaAgent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDConnectLogin. +func (o *OpenIDConnectLogin) 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) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) + case "nameClaimType": + err = unpopulate(val, "NameClaimType", &o.NameClaimType) delete(rawMsg, key) - case "logging": - err = unpopulate(val, "Logging", &r.Logging) + case "scopes": + err = unpopulate(val, "Scopes", &o.Scopes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RuntimeJavaAgentLogging. -func (r RuntimeJavaAgentLogging) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OpenIDConnectRegistration. +func (o OpenIDConnectRegistration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "loggerSettings", r.LoggerSettings) + populate(objectMap, "clientCredential", o.ClientCredential) + populate(objectMap, "clientId", o.ClientID) + populate(objectMap, "openIdConnectConfiguration", o.OpenIDConnectConfiguration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RuntimeJavaAgentLogging. -func (r *RuntimeJavaAgentLogging) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDConnectRegistration. +func (o *OpenIDConnectRegistration) 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) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error - switch key { - case "loggerSettings": - err = unpopulate(val, "LoggerSettings", &r.LoggerSettings) + switch key { + case "clientCredential": + err = unpopulate(val, "ClientCredential", &o.ClientCredential) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &o.ClientID) + delete(rawMsg, key) + case "openIdConnectConfiguration": + err = unpopulate(val, "OpenIDConnectConfiguration", &o.OpenIDConnectConfiguration) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Scale. -func (s Scale) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationDetail. +func (o OperationDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cooldownPeriod", s.CooldownPeriod) - populate(objectMap, "maxReplicas", s.MaxReplicas) - populate(objectMap, "minReplicas", s.MinReplicas) - populate(objectMap, "pollingInterval", s.PollingInterval) - populate(objectMap, "rules", s.Rules) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Scale. -func (s *Scale) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDetail. +func (o *OperationDetail) 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) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "cooldownPeriod": - err = unpopulate(val, "CooldownPeriod", &s.CooldownPeriod) - delete(rawMsg, key) - case "maxReplicas": - err = unpopulate(val, "MaxReplicas", &s.MaxReplicas) + case "display": + err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) - case "minReplicas": - err = unpopulate(val, "MinReplicas", &s.MinReplicas) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) delete(rawMsg, key) - case "pollingInterval": - err = unpopulate(val, "PollingInterval", &s.PollingInterval) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &s.Rules) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ScaleConfiguration. -func (s ScaleConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maxConcurrentSessions", s.MaxConcurrentSessions) - populate(objectMap, "readySessionInstances", s.ReadySessionInstances) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleConfiguration. -func (s *ScaleConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) 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) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "maxConcurrentSessions": - err = unpopulate(val, "MaxConcurrentSessions", &s.MaxConcurrentSessions) + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) delete(rawMsg, key) - case "readySessionInstances": - err = unpopulate(val, "ReadySessionInstances", &s.ReadySessionInstances) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ScaleRule. -func (s ScaleRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "azureQueue", s.AzureQueue) - populate(objectMap, "custom", s.Custom) - populate(objectMap, "http", s.HTTP) - populate(objectMap, "name", s.Name) - populate(objectMap, "tcp", s.TCP) + 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 ScaleRule. -func (s *ScaleRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) 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) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "azureQueue": - err = unpopulate(val, "AzureQueue", &s.AzureQueue) - delete(rawMsg, key) - case "custom": - err = unpopulate(val, "Custom", &s.Custom) - delete(rawMsg, key) - case "http": - err = unpopulate(val, "HTTP", &s.HTTP) + case "id": + err = unpopulate(val, "ID", &p.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &s.Name) + err = unpopulate(val, "Name", &p.Name) delete(rawMsg, key) - case "tcp": - err = unpopulate(val, "TCP", &s.TCP) + 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ScaleRuleAuth. -func (s ScaleRuleAuth) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type QueueScaleRule. +func (q QueueScaleRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "secretRef", s.SecretRef) - populate(objectMap, "triggerParameter", s.TriggerParameter) + populate(objectMap, "accountName", q.AccountName) + populate(objectMap, "auth", q.Auth) + populate(objectMap, "identity", q.Identity) + populate(objectMap, "queueLength", q.QueueLength) + populate(objectMap, "queueName", q.QueueName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleRuleAuth. -func (s *ScaleRuleAuth) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type QueueScaleRule. +func (q *QueueScaleRule) 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) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } for key, val := range rawMsg { var err error switch key { - case "secretRef": - err = unpopulate(val, "SecretRef", &s.SecretRef) + case "accountName": + err = unpopulate(val, "AccountName", &q.AccountName) delete(rawMsg, key) - case "triggerParameter": - err = unpopulate(val, "TriggerParameter", &s.TriggerParameter) + case "auth": + err = unpopulate(val, "Auth", &q.Auth) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &q.Identity) + delete(rawMsg, key) + case "queueLength": + err = unpopulate(val, "QueueLength", &q.QueueLength) + delete(rawMsg, key) + case "queueName": + err = unpopulate(val, "QueueName", &q.QueueName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", q, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ScgRoute. -func (s ScgRoute) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryCredentials. +func (r RegistryCredentials) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "filters", s.Filters) - populate(objectMap, "id", s.ID) - populate(objectMap, "order", s.Order) - populate(objectMap, "predicates", s.Predicates) - populate(objectMap, "uri", s.URI) + populate(objectMap, "identity", r.Identity) + populate(objectMap, "passwordSecretRef", r.PasswordSecretRef) + populate(objectMap, "server", r.Server) + populate(objectMap, "username", r.Username) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScgRoute. -func (s *ScgRoute) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryCredentials. +func (r *RegistryCredentials) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "filters": - err = unpopulate(val, "Filters", &s.Filters) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) + case "identity": + err = unpopulate(val, "Identity", &r.Identity) delete(rawMsg, key) - case "order": - err = unpopulate(val, "Order", &s.Order) + case "passwordSecretRef": + err = unpopulate(val, "PasswordSecretRef", &r.PasswordSecretRef) delete(rawMsg, key) - case "predicates": - err = unpopulate(val, "Predicates", &s.Predicates) + case "server": + err = unpopulate(val, "Server", &r.Server) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &s.URI) + case "username": + err = unpopulate(val, "Username", &r.Username) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Secret. -func (s Secret) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RegistryInfo. +func (r RegistryInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "keyVaultUrl", s.KeyVaultURL) - populate(objectMap, "name", s.Name) - populate(objectMap, "value", s.Value) + populate(objectMap, "registryPassword", r.RegistryPassword) + populate(objectMap, "registryUrl", r.RegistryURL) + populate(objectMap, "registryUserName", r.RegistryUserName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Secret. -func (s *Secret) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryInfo. +func (r *RegistryInfo) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) - case "keyVaultUrl": - err = unpopulate(val, "KeyVaultURL", &s.KeyVaultURL) + case "registryPassword": + err = unpopulate(val, "RegistryPassword", &r.RegistryPassword) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "registryUrl": + err = unpopulate(val, "RegistryURL", &r.RegistryURL) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "registryUserName": + err = unpopulate(val, "RegistryUserName", &r.RegistryUserName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SecretVolumeItem. -func (s SecretVolumeItem) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Replica. +func (r Replica) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "path", s.Path) - populate(objectMap, "secretRef", s.SecretRef) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SecretVolumeItem. -func (s *SecretVolumeItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Replica. +func (r *Replica) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "path": - err = unpopulate(val, "Path", &s.Path) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "secretRef": - err = unpopulate(val, "SecretRef", &s.SecretRef) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SecretsCollection. -func (s SecretsCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicaCollection. +func (r ReplicaCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", s.Value) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SecretsCollection. -func (s *SecretsCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaCollection. +func (r *ReplicaCollection) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { case "value": - err = unpopulate(val, "Value", &s.Value) + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Service. -func (s Service) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicaContainer. +func (r ReplicaContainer) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "type", s.Type) + populate(objectMap, "containerId", r.ContainerID) + populate(objectMap, "execEndpoint", r.ExecEndpoint) + populate(objectMap, "logStreamEndpoint", r.LogStreamEndpoint) + populate(objectMap, "name", r.Name) + populate(objectMap, "ready", r.Ready) + populate(objectMap, "restartCount", r.RestartCount) + populate(objectMap, "runningState", r.RunningState) + populate(objectMap, "runningStateDetails", r.RunningStateDetails) + populate(objectMap, "started", r.Started) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Service. -func (s *Service) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaContainer. +func (r *ReplicaContainer) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "type": - err = unpopulate(val, "Type", &s.Type) + case "containerId": + err = unpopulate(val, "ContainerID", &r.ContainerID) + delete(rawMsg, key) + case "execEndpoint": + err = unpopulate(val, "ExecEndpoint", &r.ExecEndpoint) + delete(rawMsg, key) + case "logStreamEndpoint": + err = unpopulate(val, "LogStreamEndpoint", &r.LogStreamEndpoint) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "ready": + err = unpopulate(val, "Ready", &r.Ready) + delete(rawMsg, key) + case "restartCount": + err = unpopulate(val, "RestartCount", &r.RestartCount) + delete(rawMsg, key) + case "runningState": + err = unpopulate(val, "RunningState", &r.RunningState) + delete(rawMsg, key) + case "runningStateDetails": + err = unpopulate(val, "RunningStateDetails", &r.RunningStateDetails) + delete(rawMsg, key) + case "started": + err = unpopulate(val, "Started", &r.Started) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ServiceBind. -func (s ServiceBind) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ReplicaProperties. +func (r ReplicaProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientType", s.ClientType) - populate(objectMap, "customizedKeys", s.CustomizedKeys) - populate(objectMap, "name", s.Name) - populate(objectMap, "serviceId", s.ServiceID) + populate(objectMap, "containers", r.Containers) + populateDateTimeRFC3339(objectMap, "createdTime", r.CreatedTime) + populate(objectMap, "initContainers", r.InitContainers) + populate(objectMap, "runningState", r.RunningState) + populate(objectMap, "runningStateDetails", r.RunningStateDetails) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBind. -func (s *ServiceBind) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaProperties. +func (r *ReplicaProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "clientType": - err = unpopulate(val, "ClientType", &s.ClientType) + case "containers": + err = unpopulate(val, "Containers", &r.Containers) delete(rawMsg, key) - case "customizedKeys": - err = unpopulate(val, "CustomizedKeys", &s.CustomizedKeys) + case "createdTime": + err = unpopulateDateTimeRFC3339(val, "CreatedTime", &r.CreatedTime) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "initContainers": + err = unpopulate(val, "InitContainers", &r.InitContainers) delete(rawMsg, key) - case "serviceId": - err = unpopulate(val, "ServiceID", &s.ServiceID) + case "runningState": + err = unpopulate(val, "RunningState", &r.RunningState) + delete(rawMsg, key) + case "runningStateDetails": + err = unpopulate(val, "RunningStateDetails", &r.RunningStateDetails) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionContainer. -func (s SessionContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "args", s.Args) - populate(objectMap, "command", s.Command) - populate(objectMap, "env", s.Env) - populate(objectMap, "image", s.Image) - populate(objectMap, "name", s.Name) - populate(objectMap, "resources", s.Resources) + 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 SessionContainer. -func (s *SessionContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "args": - err = unpopulate(val, "Args", &s.Args) - delete(rawMsg, key) - case "command": - err = unpopulate(val, "Command", &s.Command) - delete(rawMsg, key) - case "env": - err = unpopulate(val, "Env", &s.Env) - delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &s.Image) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &s.Name) + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &s.Resources) + 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionContainerResources. -func (s SessionContainerResources) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Revision. +func (r Revision) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cpu", s.CPU) - populate(objectMap, "memory", s.Memory) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionContainerResources. -func (s *SessionContainerResources) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Revision. +func (r *Revision) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "cpu": - err = unpopulate(val, "CPU", &s.CPU) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "memory": - err = unpopulate(val, "Memory", &s.Memory) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionIngress. -func (s SessionIngress) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RevisionCollection. +func (r RevisionCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "targetPort", s.TargetPort) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionIngress. -func (s *SessionIngress) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RevisionCollection. +func (r *RevisionCollection) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "targetPort": - err = unpopulate(val, "TargetPort", &s.TargetPort) + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionNetworkConfiguration. -func (s SessionNetworkConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RevisionProperties. +func (r RevisionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "status", s.Status) + populate(objectMap, "active", r.Active) + populateDateTimeRFC3339(objectMap, "createdTime", r.CreatedTime) + populate(objectMap, "fqdn", r.Fqdn) + populate(objectMap, "healthState", r.HealthState) + populateDateTimeRFC3339(objectMap, "lastActiveTime", r.LastActiveTime) + populate(objectMap, "provisioningError", r.ProvisioningError) + populate(objectMap, "provisioningState", r.ProvisioningState) + populate(objectMap, "replicas", r.Replicas) + populate(objectMap, "runningState", r.RunningState) + populate(objectMap, "template", r.Template) + populate(objectMap, "trafficWeight", r.TrafficWeight) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionNetworkConfiguration. -func (s *SessionNetworkConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RevisionProperties. +func (r *RevisionProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "status": - err = unpopulate(val, "Status", &s.Status) + case "active": + err = unpopulate(val, "Active", &r.Active) + delete(rawMsg, key) + case "createdTime": + err = unpopulateDateTimeRFC3339(val, "CreatedTime", &r.CreatedTime) + delete(rawMsg, key) + case "fqdn": + err = unpopulate(val, "Fqdn", &r.Fqdn) + delete(rawMsg, key) + case "healthState": + err = unpopulate(val, "HealthState", &r.HealthState) + delete(rawMsg, key) + case "lastActiveTime": + err = unpopulateDateTimeRFC3339(val, "LastActiveTime", &r.LastActiveTime) + delete(rawMsg, key) + case "provisioningError": + err = unpopulate(val, "ProvisioningError", &r.ProvisioningError) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &r.ProvisioningState) + delete(rawMsg, key) + case "replicas": + err = unpopulate(val, "Replicas", &r.Replicas) + delete(rawMsg, key) + case "runningState": + err = unpopulate(val, "RunningState", &r.RunningState) + delete(rawMsg, key) + case "template": + err = unpopulate(val, "Template", &r.Template) + delete(rawMsg, key) + case "trafficWeight": + err = unpopulate(val, "TrafficWeight", &r.TrafficWeight) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionPool. -func (s SessionPool) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Runtime. +func (r Runtime) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) + populate(objectMap, "java", r.Java) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionPool. -func (s *SessionPool) UnmarshalJSON(data []byte) error { +// 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", s, err) + 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", &s.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "java": + err = unpopulate(val, "Java", &r.Java) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionPoolCollection. -func (s SessionPoolCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RuntimeJava. +func (r RuntimeJava) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "enableMetrics", r.EnableMetrics) + populate(objectMap, "javaAgent", r.JavaAgent) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionPoolCollection. -func (s *SessionPoolCollection) UnmarshalJSON(data []byte) error { +// 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "enableMetrics": + err = unpopulate(val, "EnableMetrics", &r.EnableMetrics) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "javaAgent": + err = unpopulate(val, "JavaAgent", &r.JavaAgent) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionPoolProperties. -func (s SessionPoolProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RuntimeJavaAgent. +func (r RuntimeJavaAgent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "containerType", s.ContainerType) - populate(objectMap, "customContainerTemplate", s.CustomContainerTemplate) - populate(objectMap, "dynamicPoolConfiguration", s.DynamicPoolConfiguration) - populate(objectMap, "environmentId", s.EnvironmentID) - populate(objectMap, "nodeCount", s.NodeCount) - populate(objectMap, "poolManagementEndpoint", s.PoolManagementEndpoint) - populate(objectMap, "poolManagementType", s.PoolManagementType) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "scaleConfiguration", s.ScaleConfiguration) - populate(objectMap, "secrets", s.Secrets) - populate(objectMap, "sessionNetworkConfiguration", s.SessionNetworkConfiguration) + populate(objectMap, "enabled", r.Enabled) + populate(objectMap, "logging", r.Logging) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionPoolProperties. -func (s *SessionPoolProperties) UnmarshalJSON(data []byte) error { +// 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", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "containerType": - err = unpopulate(val, "ContainerType", &s.ContainerType) - delete(rawMsg, key) - case "customContainerTemplate": - err = unpopulate(val, "CustomContainerTemplate", &s.CustomContainerTemplate) - delete(rawMsg, key) - case "dynamicPoolConfiguration": - err = unpopulate(val, "DynamicPoolConfiguration", &s.DynamicPoolConfiguration) - delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &s.EnvironmentID) - delete(rawMsg, key) - case "nodeCount": - err = unpopulate(val, "NodeCount", &s.NodeCount) - delete(rawMsg, key) - case "poolManagementEndpoint": - err = unpopulate(val, "PoolManagementEndpoint", &s.PoolManagementEndpoint) - delete(rawMsg, key) - case "poolManagementType": - err = unpopulate(val, "PoolManagementType", &s.PoolManagementType) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "scaleConfiguration": - err = unpopulate(val, "ScaleConfiguration", &s.ScaleConfiguration) - delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &s.Secrets) + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) delete(rawMsg, key) - case "sessionNetworkConfiguration": - err = unpopulate(val, "SessionNetworkConfiguration", &s.SessionNetworkConfiguration) + case "logging": + err = unpopulate(val, "Logging", &r.Logging) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionPoolSecret. -func (s SessionPoolSecret) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type RuntimeJavaAgentLogging. +func (r RuntimeJavaAgentLogging) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", s.Name) - populate(objectMap, "value", s.Value) + populate(objectMap, "loggerSettings", r.LoggerSettings) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionPoolSecret. -func (s *SessionPoolSecret) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type RuntimeJavaAgentLogging. +func (r *RuntimeJavaAgentLogging) 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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "loggerSettings": + err = unpopulate(val, "LoggerSettings", &r.LoggerSettings) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionPoolUpdatableProperties. -func (s SessionPoolUpdatableProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Scale. +func (s Scale) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", s.Properties) + populate(objectMap, "cooldownPeriod", s.CooldownPeriod) + populate(objectMap, "maxReplicas", s.MaxReplicas) + populate(objectMap, "minReplicas", s.MinReplicas) + populate(objectMap, "pollingInterval", s.PollingInterval) + populate(objectMap, "rules", s.Rules) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionPoolUpdatableProperties. -func (s *SessionPoolUpdatableProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Scale. +func (s *Scale) 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) @@ -10819,8 +6776,20 @@ func (s *SessionPoolUpdatableProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "cooldownPeriod": + err = unpopulate(val, "CooldownPeriod", &s.CooldownPeriod) + delete(rawMsg, key) + case "maxReplicas": + err = unpopulate(val, "MaxReplicas", &s.MaxReplicas) + delete(rawMsg, key) + case "minReplicas": + err = unpopulate(val, "MinReplicas", &s.MinReplicas) + delete(rawMsg, key) + case "pollingInterval": + err = unpopulate(val, "PollingInterval", &s.PollingInterval) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &s.Rules) delete(rawMsg, key) } if err != nil { @@ -10830,19 +6799,19 @@ func (s *SessionPoolUpdatableProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionPoolUpdatablePropertiesProperties. -func (s SessionPoolUpdatablePropertiesProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScaleRule. +func (s ScaleRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "customContainerTemplate", s.CustomContainerTemplate) - populate(objectMap, "dynamicPoolConfiguration", s.DynamicPoolConfiguration) - populate(objectMap, "scaleConfiguration", s.ScaleConfiguration) - populate(objectMap, "secrets", s.Secrets) - populate(objectMap, "sessionNetworkConfiguration", s.SessionNetworkConfiguration) + populate(objectMap, "azureQueue", s.AzureQueue) + populate(objectMap, "custom", s.Custom) + populate(objectMap, "http", s.HTTP) + populate(objectMap, "name", s.Name) + populate(objectMap, "tcp", s.TCP) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionPoolUpdatablePropertiesProperties. -func (s *SessionPoolUpdatablePropertiesProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleRule. +func (s *ScaleRule) 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) @@ -10850,20 +6819,20 @@ func (s *SessionPoolUpdatablePropertiesProperties) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "customContainerTemplate": - err = unpopulate(val, "CustomContainerTemplate", &s.CustomContainerTemplate) + case "azureQueue": + err = unpopulate(val, "AzureQueue", &s.AzureQueue) delete(rawMsg, key) - case "dynamicPoolConfiguration": - err = unpopulate(val, "DynamicPoolConfiguration", &s.DynamicPoolConfiguration) + case "custom": + err = unpopulate(val, "Custom", &s.Custom) delete(rawMsg, key) - case "scaleConfiguration": - err = unpopulate(val, "ScaleConfiguration", &s.ScaleConfiguration) + case "http": + err = unpopulate(val, "HTTP", &s.HTTP) delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &s.Secrets) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "sessionNetworkConfiguration": - err = unpopulate(val, "SessionNetworkConfiguration", &s.SessionNetworkConfiguration) + case "tcp": + err = unpopulate(val, "TCP", &s.TCP) delete(rawMsg, key) } if err != nil { @@ -10873,18 +6842,16 @@ func (s *SessionPoolUpdatablePropertiesProperties) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type SessionRegistryCredentials. -func (s SessionRegistryCredentials) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ScaleRuleAuth. +func (s ScaleRuleAuth) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "passwordSecretRef", s.PasswordSecretRef) - populate(objectMap, "server", s.Server) - populate(objectMap, "username", s.Username) + populate(objectMap, "secretRef", s.SecretRef) + populate(objectMap, "triggerParameter", s.TriggerParameter) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionRegistryCredentials. -func (s *SessionRegistryCredentials) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleRuleAuth. +func (s *ScaleRuleAuth) 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) @@ -10892,17 +6859,11 @@ func (s *SessionRegistryCredentials) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &s.Identity) - delete(rawMsg, key) - case "passwordSecretRef": - err = unpopulate(val, "PasswordSecretRef", &s.PasswordSecretRef) - delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &s.Server) + case "secretRef": + err = unpopulate(val, "SecretRef", &s.SecretRef) delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &s.Username) + case "triggerParameter": + err = unpopulate(val, "TriggerParameter", &s.TriggerParameter) delete(rawMsg, key) } if err != nil { @@ -10912,20 +6873,18 @@ func (s *SessionRegistryCredentials) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SmbStorage. -func (s SmbStorage) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Secret. +func (s Secret) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "accessMode", s.AccessMode) - populate(objectMap, "domain", s.Domain) - populate(objectMap, "host", s.Host) - populate(objectMap, "password", s.Password) - populate(objectMap, "shareName", s.ShareName) - populate(objectMap, "username", s.Username) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "keyVaultUrl", s.KeyVaultURL) + populate(objectMap, "name", s.Name) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SmbStorage. -func (s *SmbStorage) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Secret. +func (s *Secret) 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) @@ -10933,23 +6892,17 @@ func (s *SmbStorage) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "accessMode": - err = unpopulate(val, "AccessMode", &s.AccessMode) - delete(rawMsg, key) - case "domain": - err = unpopulate(val, "Domain", &s.Domain) - delete(rawMsg, key) - case "host": - err = unpopulate(val, "Host", &s.Host) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &s.Password) + case "keyVaultUrl": + err = unpopulate(val, "KeyVaultURL", &s.KeyVaultURL) delete(rawMsg, key) - case "shareName": - err = unpopulate(val, "ShareName", &s.ShareName) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &s.Username) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -10959,19 +6912,16 @@ func (s *SmbStorage) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SourceControl. -func (s SourceControl) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecretVolumeItem. +func (s SecretVolumeItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) + populate(objectMap, "path", s.Path) + populate(objectMap, "secretRef", s.SecretRef) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SourceControl. -func (s *SourceControl) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretVolumeItem. +func (s *SecretVolumeItem) 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) @@ -10979,20 +6929,11 @@ func (s *SourceControl) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &s.SystemData) + case "path": + err = unpopulate(val, "Path", &s.Path) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "secretRef": + err = unpopulate(val, "SecretRef", &s.SecretRef) delete(rawMsg, key) } if err != nil { @@ -11002,16 +6943,15 @@ func (s *SourceControl) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SourceControlCollection. -func (s SourceControlCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SecretsCollection. +func (s SecretsCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SourceControlCollection. -func (s *SourceControlCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretsCollection. +func (s *SecretsCollection) 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) @@ -11019,9 +6959,6 @@ func (s *SourceControlCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) - delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) @@ -11033,18 +6970,15 @@ func (s *SourceControlCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SourceControlProperties. -func (s SourceControlProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Service. +func (s Service) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "branch", s.Branch) - populate(objectMap, "githubActionConfiguration", s.GithubActionConfiguration) - populate(objectMap, "operationState", s.OperationState) - populate(objectMap, "repoUrl", s.RepoURL) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SourceControlProperties. -func (s *SourceControlProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Service. +func (s *Service) 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) @@ -11052,17 +6986,8 @@ func (s *SourceControlProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "branch": - err = unpopulate(val, "Branch", &s.Branch) - delete(rawMsg, key) - case "githubActionConfiguration": - err = unpopulate(val, "GithubActionConfiguration", &s.GithubActionConfiguration) - delete(rawMsg, key) - case "operationState": - err = unpopulate(val, "OperationState", &s.OperationState) - delete(rawMsg, key) - case "repoUrl": - err = unpopulate(val, "RepoURL", &s.RepoURL) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -11072,20 +6997,16 @@ func (s *SourceControlProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SpringBootAdminComponent. -func (s SpringBootAdminComponent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ServiceBind. +func (s ServiceBind) 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, "scale", s.Scale) - populate(objectMap, "serviceBinds", s.ServiceBinds) + populate(objectMap, "name", s.Name) + populate(objectMap, "serviceId", s.ServiceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SpringBootAdminComponent. -func (s *SpringBootAdminComponent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBind. +func (s *ServiceBind) 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) @@ -11093,23 +7014,11 @@ func (s *SpringBootAdminComponent) UnmarshalJSON(data []byte) error { 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 "scale": - err = unpopulate(val, "Scale", &s.Scale) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "serviceBinds": - err = unpopulate(val, "ServiceBinds", &s.ServiceBinds) + case "serviceId": + err = unpopulate(val, "ServiceID", &s.ServiceID) delete(rawMsg, key) } if err != nil { @@ -11119,19 +7028,19 @@ func (s *SpringBootAdminComponent) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SpringCloudConfigComponent. -func (s SpringCloudConfigComponent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SourceControl. +func (s SourceControl) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["componentType"] = JavaComponentTypeSpringCloudConfig - populate(objectMap, "configurations", s.Configurations) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "scale", s.Scale) - populate(objectMap, "serviceBinds", s.ServiceBinds) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SpringCloudConfigComponent. -func (s *SpringCloudConfigComponent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SourceControl. +func (s *SourceControl) 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) @@ -11139,20 +7048,20 @@ func (s *SpringCloudConfigComponent) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "componentType": - err = unpopulate(val, "ComponentType", &s.ComponentType) + case "id": + err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) - case "configurations": - err = unpopulate(val, "Configurations", &s.Configurations) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) - case "scale": - err = unpopulate(val, "Scale", &s.Scale) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) delete(rawMsg, key) - case "serviceBinds": - err = unpopulate(val, "ServiceBinds", &s.ServiceBinds) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -11162,20 +7071,16 @@ func (s *SpringCloudConfigComponent) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SpringCloudEurekaComponent. -func (s SpringCloudEurekaComponent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SourceControlCollection. +func (s SourceControlCollection) 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, "scale", s.Scale) - populate(objectMap, "serviceBinds", s.ServiceBinds) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SpringCloudEurekaComponent. -func (s *SpringCloudEurekaComponent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SourceControlCollection. +func (s *SourceControlCollection) 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) @@ -11183,23 +7088,11 @@ func (s *SpringCloudEurekaComponent) UnmarshalJSON(data []byte) error { 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 "scale": - err = unpopulate(val, "Scale", &s.Scale) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "serviceBinds": - err = unpopulate(val, "ServiceBinds", &s.ServiceBinds) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -11209,21 +7102,18 @@ func (s *SpringCloudEurekaComponent) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SpringCloudGatewayComponent. -func (s SpringCloudGatewayComponent) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type SourceControlProperties. +func (s SourceControlProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["componentType"] = JavaComponentTypeSpringCloudGateway - populate(objectMap, "configurations", s.Configurations) - populate(objectMap, "ingress", s.Ingress) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "scale", s.Scale) - populate(objectMap, "serviceBinds", s.ServiceBinds) - populate(objectMap, "springCloudGatewayRoutes", s.SpringCloudGatewayRoutes) + populate(objectMap, "branch", s.Branch) + populate(objectMap, "githubActionConfiguration", s.GithubActionConfiguration) + populate(objectMap, "operationState", s.OperationState) + populate(objectMap, "repoUrl", s.RepoURL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SpringCloudGatewayComponent. -func (s *SpringCloudGatewayComponent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SourceControlProperties. +func (s *SourceControlProperties) 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) @@ -11231,26 +7121,17 @@ func (s *SpringCloudGatewayComponent) UnmarshalJSON(data []byte) error { 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) + case "branch": + err = unpopulate(val, "Branch", &s.Branch) delete(rawMsg, key) - case "scale": - err = unpopulate(val, "Scale", &s.Scale) + case "githubActionConfiguration": + err = unpopulate(val, "GithubActionConfiguration", &s.GithubActionConfiguration) delete(rawMsg, key) - case "serviceBinds": - err = unpopulate(val, "ServiceBinds", &s.ServiceBinds) + case "operationState": + err = unpopulate(val, "OperationState", &s.OperationState) delete(rawMsg, key) - case "springCloudGatewayRoutes": - err = unpopulate(val, "SpringCloudGatewayRoutes", &s.SpringCloudGatewayRoutes) + case "repoUrl": + err = unpopulate(val, "RepoURL", &s.RepoURL) delete(rawMsg, key) } if err != nil { @@ -11307,60 +7188,6 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TCPConnectionPool. -func (t TCPConnectionPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxConnections", t.MaxConnections) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TCPConnectionPool. -func (t *TCPConnectionPool) 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", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "maxConnections": - err = unpopulate(val, "MaxConnections", &t.MaxConnections) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TCPRetryPolicy. -func (t TCPRetryPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxConnectAttempts", t.MaxConnectAttempts) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TCPRetryPolicy. -func (t *TCPRetryPolicy) 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", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "maxConnectAttempts": - err = unpopulate(val, "MaxConnectAttempts", &t.MaxConnectAttempts) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type TCPScaleRule. func (t TCPScaleRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -11447,37 +7274,6 @@ func (t *Template) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TimeoutPolicy. -func (t TimeoutPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "connectionTimeoutInSeconds", t.ConnectionTimeoutInSeconds) - populate(objectMap, "responseTimeoutInSeconds", t.ResponseTimeoutInSeconds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TimeoutPolicy. -func (t *TimeoutPolicy) 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", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "connectionTimeoutInSeconds": - err = unpopulate(val, "ConnectionTimeoutInSeconds", &t.ConnectionTimeoutInSeconds) - delete(rawMsg, key) - case "responseTimeoutInSeconds": - err = unpopulate(val, "ResponseTimeoutInSeconds", &t.ResponseTimeoutInSeconds) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type TokenStore. func (t TokenStore) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -11513,37 +7309,6 @@ func (t *TokenStore) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TracesConfiguration. -func (t TracesConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "destinations", t.Destinations) - populate(objectMap, "includeDapr", t.IncludeDapr) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TracesConfiguration. -func (t *TracesConfiguration) 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", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinations": - err = unpopulate(val, "Destinations", &t.Destinations) - delete(rawMsg, key) - case "includeDapr": - err = unpopulate(val, "IncludeDapr", &t.IncludeDapr) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -11914,189 +7679,9 @@ func (v *VolumeMount) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type WorkflowArtifacts. -func (w WorkflowArtifacts) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateAny(objectMap, "appSettings", w.AppSettings) - populateAny(objectMap, "files", w.Files) - populate(objectMap, "filesToDelete", w.FilesToDelete) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowArtifacts. -func (w *WorkflowArtifacts) 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", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "appSettings": - err = unpopulate(val, "AppSettings", &w.AppSettings) - delete(rawMsg, key) - case "files": - err = unpopulate(val, "Files", &w.Files) - delete(rawMsg, key) - case "filesToDelete": - err = unpopulate(val, "FilesToDelete", &w.FilesToDelete) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WorkflowEnvelope. -func (w WorkflowEnvelope) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", w.ID) - populate(objectMap, "kind", w.Kind) - populate(objectMap, "location", w.Location) - populate(objectMap, "name", w.Name) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowEnvelope. -func (w *WorkflowEnvelope) 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", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &w.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &w.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &w.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &w.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &w.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &w.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WorkflowEnvelopeCollection. -func (w WorkflowEnvelopeCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowEnvelopeCollection. -func (w *WorkflowEnvelopeCollection) 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", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &w.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &w.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WorkflowEnvelopeProperties. -func (w WorkflowEnvelopeProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateAny(objectMap, "files", w.Files) - populate(objectMap, "flowState", w.FlowState) - populate(objectMap, "health", w.Health) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowEnvelopeProperties. -func (w *WorkflowEnvelopeProperties) 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", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "files": - err = unpopulate(val, "Files", &w.Files) - delete(rawMsg, key) - case "flowState": - err = unpopulate(val, "FlowState", &w.FlowState) - delete(rawMsg, key) - case "health": - err = unpopulate(val, "Health", &w.Health) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type WorkflowHealth. -func (w WorkflowHealth) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", w.Error) - populate(objectMap, "state", w.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WorkflowHealth. -func (w *WorkflowHealth) 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", w, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &w.Error) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &w.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", w, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type WorkloadProfile. func (w WorkloadProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enableFips", w.EnableFips) populate(objectMap, "maximumCount", w.MaximumCount) populate(objectMap, "minimumCount", w.MinimumCount) populate(objectMap, "name", w.Name) @@ -12113,9 +7698,6 @@ func (w *WorkloadProfile) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "enableFips": - err = unpopulate(val, "EnableFips", &w.EnableFips) - delete(rawMsg, key) case "maximumCount": err = unpopulate(val, "MaximumCount", &w.MaximumCount) delete(rawMsg, key) diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go index 555790d5339d..e6e090508dac 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // NamespacesClient contains the methods for the Namespaces group. @@ -29,7 +28,7 @@ type NamespacesClient struct { } // NewNamespacesClient creates a new instance of NamespacesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewNamespacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NamespacesClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - environmentName - Name of the Managed Environment. // - checkNameAvailabilityRequest - The check name availability request. @@ -95,7 +94,7 @@ func (client *NamespacesClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 6b9bf7398870..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 4ce6487a983e..4b896746d5c3 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/operations_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/operations_client.go @@ -10,12 +10,11 @@ package armappcontainers import ( "context" - "net/http" - "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" ) // OperationsClient contains the methods for the Operations group. @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available RP operations. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -73,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 24b9a1a27e7f..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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 9afc10537e59..0ef6af643534 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/options.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/options.go @@ -8,31 +8,6 @@ package armappcontainers -// AppResiliencyClientCreateOrUpdateOptions contains the optional parameters for the AppResiliencyClient.CreateOrUpdate method. -type AppResiliencyClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AppResiliencyClientDeleteOptions contains the optional parameters for the AppResiliencyClient.Delete method. -type AppResiliencyClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AppResiliencyClientGetOptions contains the optional parameters for the AppResiliencyClient.Get method. -type AppResiliencyClientGetOptions struct { - // placeholder for future optional parameters -} - -// AppResiliencyClientListOptions contains the optional parameters for the AppResiliencyClient.NewListPager method. -type AppResiliencyClientListOptions struct { - // placeholder for future optional parameters -} - -// AppResiliencyClientUpdateOptions contains the optional parameters for the AppResiliencyClient.Update method. -type AppResiliencyClientUpdateOptions struct { - // placeholder for future optional parameters -} - // AvailableWorkloadProfilesClientGetOptions contains the optional parameters for the AvailableWorkloadProfilesClient.NewGetPager // method. type AvailableWorkloadProfilesClientGetOptions struct { @@ -44,69 +19,6 @@ type BillingMetersClientGetOptions struct { // placeholder for future optional parameters } -// BuildAuthTokenClientListOptions contains the optional parameters for the BuildAuthTokenClient.List method. -type BuildAuthTokenClientListOptions struct { - // placeholder for future optional parameters -} - -// BuildersClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildersClient.BeginCreateOrUpdate method. -type BuildersClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BuildersClientBeginDeleteOptions contains the optional parameters for the BuildersClient.BeginDelete method. -type BuildersClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BuildersClientBeginUpdateOptions contains the optional parameters for the BuildersClient.BeginUpdate method. -type BuildersClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BuildersClientGetOptions contains the optional parameters for the BuildersClient.Get method. -type BuildersClientGetOptions struct { - // placeholder for future optional parameters -} - -// BuildersClientListByResourceGroupOptions contains the optional parameters for the BuildersClient.NewListByResourceGroupPager -// method. -type BuildersClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// BuildersClientListBySubscriptionOptions contains the optional parameters for the BuildersClient.NewListBySubscriptionPager -// method. -type BuildersClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// BuildsByBuilderResourceClientListOptions contains the optional parameters for the BuildsByBuilderResourceClient.NewListPager -// method. -type BuildsByBuilderResourceClientListOptions struct { - // placeholder for future optional parameters -} - -// BuildsClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildsClient.BeginCreateOrUpdate method. -type BuildsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BuildsClientBeginDeleteOptions contains the optional parameters for the BuildsClient.BeginDelete method. -type BuildsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BuildsClientGetOptions contains the optional parameters for the BuildsClient.Get method. -type BuildsClientGetOptions struct { - // placeholder for future optional parameters -} - // CertificatesClientCreateOrUpdateOptions contains the optional parameters for the CertificatesClient.CreateOrUpdate method. type CertificatesClientCreateOrUpdateOptions struct { // Certificate to be created or updated @@ -295,24 +207,6 @@ 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 { @@ -409,39 +303,6 @@ 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 { @@ -485,69 +346,18 @@ type ContainerAppsRevisionsClientRestartRevisionOptions struct { // placeholder for future optional parameters } -// ContainerAppsSessionPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.BeginCreateOrUpdate -// method. -type ContainerAppsSessionPoolsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ContainerAppsSessionPoolsClientBeginDeleteOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.BeginDelete -// method. -type ContainerAppsSessionPoolsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ContainerAppsSessionPoolsClientBeginUpdateOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.BeginUpdate -// method. -type ContainerAppsSessionPoolsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ContainerAppsSessionPoolsClientGetOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.Get -// method. -type ContainerAppsSessionPoolsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ContainerAppsSessionPoolsClientListByResourceGroupOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.NewListByResourceGroupPager -// method. -type ContainerAppsSessionPoolsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ContainerAppsSessionPoolsClientListBySubscriptionOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.NewListBySubscriptionPager -// method. -type ContainerAppsSessionPoolsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerAppsSourceControlsClient.BeginCreateOrUpdate // method. type ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string - - // Github personal access token used for SourceControl. - XMSGithubAuxiliary *string } // ContainerAppsSourceControlsClientBeginDeleteOptions contains the optional parameters for the ContainerAppsSourceControlsClient.BeginDelete // method. type ContainerAppsSourceControlsClientBeginDeleteOptions struct { - // Delete workflow. - DeleteWorkflow *bool - - // Ignore Workflow Deletion Failure. - IgnoreWorkflowDeletionFailure *bool - // Resumes the LRO from the provided token. ResumeToken string - - // Github personal access token used for SourceControl. - XMSGithubAuxiliary *string } // ContainerAppsSourceControlsClientGetOptions contains the optional parameters for the ContainerAppsSourceControlsClient.Get @@ -562,30 +372,6 @@ type ContainerAppsSourceControlsClientListByContainerAppOptions struct { // placeholder for future optional parameters } -// DaprComponentResiliencyPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DaprComponentResiliencyPoliciesClient.CreateOrUpdate -// method. -type DaprComponentResiliencyPoliciesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DaprComponentResiliencyPoliciesClientDeleteOptions contains the optional parameters for the DaprComponentResiliencyPoliciesClient.Delete -// method. -type DaprComponentResiliencyPoliciesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DaprComponentResiliencyPoliciesClientGetOptions contains the optional parameters for the DaprComponentResiliencyPoliciesClient.Get -// method. -type DaprComponentResiliencyPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DaprComponentResiliencyPoliciesClientListOptions contains the optional parameters for the DaprComponentResiliencyPoliciesClient.NewListPager -// method. -type DaprComponentResiliencyPoliciesClientListOptions struct { - // placeholder for future optional parameters -} - // DaprComponentsClientCreateOrUpdateOptions contains the optional parameters for the DaprComponentsClient.CreateOrUpdate // method. type DaprComponentsClientCreateOrUpdateOptions struct { @@ -612,91 +398,6 @@ type DaprComponentsClientListSecretsOptions struct { // placeholder for future optional parameters } -// DaprSubscriptionsClientCreateOrUpdateOptions contains the optional parameters for the DaprSubscriptionsClient.CreateOrUpdate -// method. -type DaprSubscriptionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DaprSubscriptionsClientDeleteOptions contains the optional parameters for the DaprSubscriptionsClient.Delete method. -type DaprSubscriptionsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DaprSubscriptionsClientGetOptions contains the optional parameters for the DaprSubscriptionsClient.Get method. -type DaprSubscriptionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DaprSubscriptionsClientListOptions contains the optional parameters for the DaprSubscriptionsClient.NewListPager method. -type DaprSubscriptionsClientListOptions struct { - // placeholder for future optional parameters -} - -// DotNetComponentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DotNetComponentsClient.BeginCreateOrUpdate -// method. -type DotNetComponentsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DotNetComponentsClientBeginDeleteOptions contains the optional parameters for the DotNetComponentsClient.BeginDelete method. -type DotNetComponentsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DotNetComponentsClientBeginUpdateOptions contains the optional parameters for the DotNetComponentsClient.BeginUpdate method. -type DotNetComponentsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DotNetComponentsClientGetOptions contains the optional parameters for the DotNetComponentsClient.Get method. -type DotNetComponentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DotNetComponentsClientListOptions contains the optional parameters for the DotNetComponentsClient.NewListPager method. -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 { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JavaComponentsClientBeginDeleteOptions contains the optional parameters for the JavaComponentsClient.BeginDelete method. -type JavaComponentsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JavaComponentsClientBeginUpdateOptions contains the optional parameters for the JavaComponentsClient.BeginUpdate method. -type JavaComponentsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JavaComponentsClientGetOptions contains the optional parameters for the JavaComponentsClient.Get method. -type JavaComponentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// JavaComponentsClientListOptions contains the optional parameters for the JavaComponentsClient.NewListPager method. -type JavaComponentsClientListOptions struct { - // placeholder for future optional parameters -} - // JobsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobsClient.BeginCreateOrUpdate method. type JobsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. @@ -709,12 +410,6 @@ type JobsClientBeginDeleteOptions struct { ResumeToken string } -// JobsClientBeginResumeOptions contains the optional parameters for the JobsClient.BeginResume method. -type JobsClientBeginResumeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // JobsClientBeginStartOptions contains the optional parameters for the JobsClient.BeginStart method. type JobsClientBeginStartOptions struct { // Resumes the LRO from the provided token. @@ -737,12 +432,6 @@ type JobsClientBeginStopMultipleExecutionsOptions struct { ResumeToken string } -// JobsClientBeginSuspendOptions contains the optional parameters for the JobsClient.BeginSuspend method. -type JobsClientBeginSuspendOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // JobsClientBeginUpdateOptions contains the optional parameters for the JobsClient.BeginUpdate method. type JobsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. @@ -790,49 +479,6 @@ type JobsExecutionsClientListOptions struct { Filter *string } -// LogicAppsClientCreateOrUpdateOptions contains the optional parameters for the LogicAppsClient.CreateOrUpdate method. -type LogicAppsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// LogicAppsClientDeleteOptions contains the optional parameters for the LogicAppsClient.Delete method. -type LogicAppsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// LogicAppsClientDeployWorkflowArtifactsOptions contains the optional parameters for the LogicAppsClient.DeployWorkflowArtifacts -// method. -type LogicAppsClientDeployWorkflowArtifactsOptions struct { - // Application settings and files of the workflow. - WorkflowArtifacts *WorkflowArtifacts -} - -// LogicAppsClientGetOptions contains the optional parameters for the LogicAppsClient.Get method. -type LogicAppsClientGetOptions struct { - // placeholder for future optional parameters -} - -// LogicAppsClientGetWorkflowOptions contains the optional parameters for the LogicAppsClient.GetWorkflow method. -type LogicAppsClientGetWorkflowOptions struct { - // placeholder for future optional parameters -} - -// LogicAppsClientInvokeOptions contains the optional parameters for the LogicAppsClient.Invoke method. -type LogicAppsClientInvokeOptions struct { - // placeholder for future optional parameters -} - -// LogicAppsClientListWorkflowsConnectionsOptions contains the optional parameters for the LogicAppsClient.ListWorkflowsConnections -// method. -type LogicAppsClientListWorkflowsConnectionsOptions struct { - // placeholder for future optional parameters -} - -// LogicAppsClientListWorkflowsOptions contains the optional parameters for the LogicAppsClient.NewListWorkflowsPager method. -type LogicAppsClientListWorkflowsOptions struct { - // placeholder for future optional parameters -} - // ManagedCertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedCertificatesClient.BeginCreateOrUpdate // method. type ManagedCertificatesClientBeginCreateOrUpdateOptions struct { @@ -875,38 +521,6 @@ type ManagedEnvironmentDiagnosticsClientListDetectorsOptions struct { // placeholder for future optional parameters } -// ManagedEnvironmentPrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedEnvironmentPrivateEndpointConnectionsClient.BeginCreateOrUpdate -// method. -type ManagedEnvironmentPrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedEnvironmentPrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the ManagedEnvironmentPrivateEndpointConnectionsClient.BeginDelete -// method. -type ManagedEnvironmentPrivateEndpointConnectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ManagedEnvironmentPrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ManagedEnvironmentPrivateEndpointConnectionsClient.Get -// method. -type ManagedEnvironmentPrivateEndpointConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ManagedEnvironmentPrivateEndpointConnectionsClientListOptions contains the optional parameters for the ManagedEnvironmentPrivateEndpointConnectionsClient.NewListPager -// method. -type ManagedEnvironmentPrivateEndpointConnectionsClientListOptions struct { - // placeholder for future optional parameters -} - -// ManagedEnvironmentPrivateLinkResourcesClientListOptions contains the optional parameters for the ManagedEnvironmentPrivateLinkResourcesClient.NewListPager -// method. -type ManagedEnvironmentPrivateLinkResourcesClientListOptions struct { - // placeholder for future optional parameters -} - // ManagedEnvironmentUsagesClientListOptions contains the optional parameters for the ManagedEnvironmentUsagesClient.NewListPager // method. type ManagedEnvironmentUsagesClientListOptions struct { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/polymorphic_helpers.go b/sdk/resourcemanager/appcontainers/armappcontainers/polymorphic_helpers.go deleted file mode 100644 index b87e1909d3ec..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/polymorphic_helpers.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. 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{} - case string(JavaComponentTypeSpringCloudGateway): - b = &SpringCloudGatewayComponent{} - 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 2c8ca17c0040..c15629c19059 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/responses.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/responses.go @@ -8,35 +8,6 @@ package armappcontainers -// AppResiliencyClientCreateOrUpdateResponse contains the response from method AppResiliencyClient.CreateOrUpdate. -type AppResiliencyClientCreateOrUpdateResponse struct { - // Configuration to setup App Resiliency - AppResiliency -} - -// AppResiliencyClientDeleteResponse contains the response from method AppResiliencyClient.Delete. -type AppResiliencyClientDeleteResponse struct { - // placeholder for future response values -} - -// AppResiliencyClientGetResponse contains the response from method AppResiliencyClient.Get. -type AppResiliencyClientGetResponse struct { - // Configuration to setup App Resiliency - AppResiliency -} - -// AppResiliencyClientListResponse contains the response from method AppResiliencyClient.NewListPager. -type AppResiliencyClientListResponse struct { - // Collection of AppResiliency policies - AppResiliencyCollection -} - -// AppResiliencyClientUpdateResponse contains the response from method AppResiliencyClient.Update. -type AppResiliencyClientUpdateResponse struct { - // Configuration to setup App Resiliency - AppResiliency -} - // AvailableWorkloadProfilesClientGetResponse contains the response from method AvailableWorkloadProfilesClient.NewGetPager. type AvailableWorkloadProfilesClientGetResponse struct { // Collection of available workload profiles in the location. @@ -49,70 +20,6 @@ type BillingMetersClientGetResponse struct { BillingMeterCollection } -// BuildAuthTokenClientListResponse contains the response from method BuildAuthTokenClient.List. -type BuildAuthTokenClientListResponse struct { - // Build Auth Token. - BuildToken -} - -// BuildersClientCreateOrUpdateResponse contains the response from method BuildersClient.BeginCreateOrUpdate. -type BuildersClientCreateOrUpdateResponse struct { - // Information about the SourceToCloud builder resource. - BuilderResource -} - -// BuildersClientDeleteResponse contains the response from method BuildersClient.BeginDelete. -type BuildersClientDeleteResponse struct { - // placeholder for future response values -} - -// BuildersClientGetResponse contains the response from method BuildersClient.Get. -type BuildersClientGetResponse struct { - // Information about the SourceToCloud builder resource. - BuilderResource -} - -// BuildersClientListByResourceGroupResponse contains the response from method BuildersClient.NewListByResourceGroupPager. -type BuildersClientListByResourceGroupResponse struct { - // The response of a BuilderResource list operation. - BuilderCollection -} - -// BuildersClientListBySubscriptionResponse contains the response from method BuildersClient.NewListBySubscriptionPager. -type BuildersClientListBySubscriptionResponse struct { - // The response of a BuilderResource list operation. - BuilderCollection -} - -// BuildersClientUpdateResponse contains the response from method BuildersClient.BeginUpdate. -type BuildersClientUpdateResponse struct { - // Information about the SourceToCloud builder resource. - BuilderResource -} - -// BuildsByBuilderResourceClientListResponse contains the response from method BuildsByBuilderResourceClient.NewListPager. -type BuildsByBuilderResourceClientListResponse struct { - // The response of a BuildResource list operation. - BuildCollection -} - -// BuildsClientCreateOrUpdateResponse contains the response from method BuildsClient.BeginCreateOrUpdate. -type BuildsClientCreateOrUpdateResponse struct { - // Information pertaining to an individual build. - BuildResource -} - -// BuildsClientDeleteResponse contains the response from method BuildsClient.BeginDelete. -type BuildsClientDeleteResponse struct { - // placeholder for future response values -} - -// BuildsClientGetResponse contains the response from method BuildsClient.Get. -type BuildsClientGetResponse struct { - // Information pertaining to an individual build. - BuildResource -} - // CertificatesClientCreateOrUpdateResponse contains the response from method CertificatesClient.CreateOrUpdate. type CertificatesClientCreateOrUpdateResponse struct { // Certificate used for Custom Domain bindings of Container Apps in a Managed Environment @@ -299,23 +206,6 @@ 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. @@ -411,34 +301,6 @@ 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. @@ -478,41 +340,6 @@ type ContainerAppsRevisionsClientRestartRevisionResponse struct { // placeholder for future response values } -// ContainerAppsSessionPoolsClientCreateOrUpdateResponse contains the response from method ContainerAppsSessionPoolsClient.BeginCreateOrUpdate. -type ContainerAppsSessionPoolsClientCreateOrUpdateResponse struct { - // Container App session pool. - SessionPool -} - -// ContainerAppsSessionPoolsClientDeleteResponse contains the response from method ContainerAppsSessionPoolsClient.BeginDelete. -type ContainerAppsSessionPoolsClientDeleteResponse struct { - // placeholder for future response values -} - -// ContainerAppsSessionPoolsClientGetResponse contains the response from method ContainerAppsSessionPoolsClient.Get. -type ContainerAppsSessionPoolsClientGetResponse struct { - // Container App session pool. - SessionPool -} - -// ContainerAppsSessionPoolsClientListByResourceGroupResponse contains the response from method ContainerAppsSessionPoolsClient.NewListByResourceGroupPager. -type ContainerAppsSessionPoolsClientListByResourceGroupResponse struct { - // Session pool collection Azure resource. - SessionPoolCollection -} - -// ContainerAppsSessionPoolsClientListBySubscriptionResponse contains the response from method ContainerAppsSessionPoolsClient.NewListBySubscriptionPager. -type ContainerAppsSessionPoolsClientListBySubscriptionResponse struct { - // Session pool collection Azure resource. - SessionPoolCollection -} - -// ContainerAppsSessionPoolsClientUpdateResponse contains the response from method ContainerAppsSessionPoolsClient.BeginUpdate. -type ContainerAppsSessionPoolsClientUpdateResponse struct { - // Container App session pool. - SessionPool -} - // ContainerAppsSourceControlsClientCreateOrUpdateResponse contains the response from method ContainerAppsSourceControlsClient.BeginCreateOrUpdate. type ContainerAppsSourceControlsClientCreateOrUpdateResponse struct { // Container App SourceControl. @@ -536,29 +363,6 @@ type ContainerAppsSourceControlsClientListByContainerAppResponse struct { SourceControlCollection } -// DaprComponentResiliencyPoliciesClientCreateOrUpdateResponse contains the response from method DaprComponentResiliencyPoliciesClient.CreateOrUpdate. -type DaprComponentResiliencyPoliciesClientCreateOrUpdateResponse struct { - // Dapr Component Resiliency Policy. - DaprComponentResiliencyPolicy -} - -// DaprComponentResiliencyPoliciesClientDeleteResponse contains the response from method DaprComponentResiliencyPoliciesClient.Delete. -type DaprComponentResiliencyPoliciesClientDeleteResponse struct { - // placeholder for future response values -} - -// DaprComponentResiliencyPoliciesClientGetResponse contains the response from method DaprComponentResiliencyPoliciesClient.Get. -type DaprComponentResiliencyPoliciesClientGetResponse struct { - // Dapr Component Resiliency Policy. - DaprComponentResiliencyPolicy -} - -// DaprComponentResiliencyPoliciesClientListResponse contains the response from method DaprComponentResiliencyPoliciesClient.NewListPager. -type DaprComponentResiliencyPoliciesClientListResponse struct { - // Dapr Component Resiliency Policies ARM resource. - DaprComponentResiliencyPoliciesCollection -} - // DaprComponentsClientCreateOrUpdateResponse contains the response from method DaprComponentsClient.CreateOrUpdate. type DaprComponentsClientCreateOrUpdateResponse struct { // Dapr Component. @@ -588,92 +392,6 @@ type DaprComponentsClientListSecretsResponse struct { DaprSecretsCollection } -// DaprSubscriptionsClientCreateOrUpdateResponse contains the response from method DaprSubscriptionsClient.CreateOrUpdate. -type DaprSubscriptionsClientCreateOrUpdateResponse struct { - // Dapr PubSub Event Subscription. - DaprSubscription -} - -// DaprSubscriptionsClientDeleteResponse contains the response from method DaprSubscriptionsClient.Delete. -type DaprSubscriptionsClientDeleteResponse struct { - // placeholder for future response values -} - -// DaprSubscriptionsClientGetResponse contains the response from method DaprSubscriptionsClient.Get. -type DaprSubscriptionsClientGetResponse struct { - // Dapr PubSub Event Subscription. - DaprSubscription -} - -// DaprSubscriptionsClientListResponse contains the response from method DaprSubscriptionsClient.NewListPager. -type DaprSubscriptionsClientListResponse struct { - // Dapr Subscriptions ARM resource. - DaprSubscriptionsCollection -} - -// DotNetComponentsClientCreateOrUpdateResponse contains the response from method DotNetComponentsClient.BeginCreateOrUpdate. -type DotNetComponentsClientCreateOrUpdateResponse struct { - // .NET Component. - DotNetComponent -} - -// DotNetComponentsClientDeleteResponse contains the response from method DotNetComponentsClient.BeginDelete. -type DotNetComponentsClientDeleteResponse struct { - // placeholder for future response values -} - -// DotNetComponentsClientGetResponse contains the response from method DotNetComponentsClient.Get. -type DotNetComponentsClientGetResponse struct { - // .NET Component. - DotNetComponent -} - -// DotNetComponentsClientListResponse contains the response from method DotNetComponentsClient.NewListPager. -type DotNetComponentsClientListResponse struct { - // .NET Components ARM resource. - DotNetComponentsCollection -} - -// DotNetComponentsClientUpdateResponse contains the response from method DotNetComponentsClient.BeginUpdate. -type DotNetComponentsClientUpdateResponse struct { - // .NET Component. - 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. - JavaComponent -} - -// JavaComponentsClientDeleteResponse contains the response from method JavaComponentsClient.BeginDelete. -type JavaComponentsClientDeleteResponse struct { - // placeholder for future response values -} - -// JavaComponentsClientGetResponse contains the response from method JavaComponentsClient.Get. -type JavaComponentsClientGetResponse struct { - // Java Component. - JavaComponent -} - -// JavaComponentsClientListResponse contains the response from method JavaComponentsClient.NewListPager. -type JavaComponentsClientListResponse struct { - // Java Components ARM resource. - JavaComponentsCollection -} - -// JavaComponentsClientUpdateResponse contains the response from method JavaComponentsClient.BeginUpdate. -type JavaComponentsClientUpdateResponse struct { - // Java Component. - JavaComponent -} - // JobsClientCreateOrUpdateResponse contains the response from method JobsClient.BeginCreateOrUpdate. type JobsClientCreateOrUpdateResponse struct { // Container App Job @@ -727,12 +445,6 @@ type JobsClientProxyGetResponse struct { Job } -// JobsClientResumeResponse contains the response from method JobsClient.BeginResume. -type JobsClientResumeResponse struct { - // Container App Job - Job -} - // JobsClientStartResponse contains the response from method JobsClient.BeginStart. type JobsClientStartResponse struct { // Container App's Job execution name. @@ -750,12 +462,6 @@ type JobsClientStopMultipleExecutionsResponse struct { ContainerAppJobExecutions } -// JobsClientSuspendResponse contains the response from method JobsClient.BeginSuspend. -type JobsClientSuspendResponse struct { - // Container App Job - Job -} - // JobsClientUpdateResponse contains the response from method JobsClient.BeginUpdate. type JobsClientUpdateResponse struct { // Container App Job @@ -768,52 +474,6 @@ type JobsExecutionsClientListResponse struct { ContainerAppJobExecutions } -// LogicAppsClientCreateOrUpdateResponse contains the response from method LogicAppsClient.CreateOrUpdate. -type LogicAppsClientCreateOrUpdateResponse struct { - // A logic app extension resource - LogicApp -} - -// LogicAppsClientDeleteResponse contains the response from method LogicAppsClient.Delete. -type LogicAppsClientDeleteResponse struct { - // placeholder for future response values -} - -// LogicAppsClientDeployWorkflowArtifactsResponse contains the response from method LogicAppsClient.DeployWorkflowArtifacts. -type LogicAppsClientDeployWorkflowArtifactsResponse struct { - // placeholder for future response values -} - -// LogicAppsClientGetResponse contains the response from method LogicAppsClient.Get. -type LogicAppsClientGetResponse struct { - // A logic app extension resource - LogicApp -} - -// LogicAppsClientGetWorkflowResponse contains the response from method LogicAppsClient.GetWorkflow. -type LogicAppsClientGetWorkflowResponse struct { - // Workflow properties definition. - WorkflowEnvelope -} - -// LogicAppsClientInvokeResponse contains the response from method LogicAppsClient.Invoke. -type LogicAppsClientInvokeResponse struct { - // Anything - Interface any -} - -// LogicAppsClientListWorkflowsConnectionsResponse contains the response from method LogicAppsClient.ListWorkflowsConnections. -type LogicAppsClientListWorkflowsConnectionsResponse struct { - // Workflow properties definition. - WorkflowEnvelope -} - -// LogicAppsClientListWorkflowsResponse contains the response from method LogicAppsClient.NewListWorkflowsPager. -type LogicAppsClientListWorkflowsResponse struct { - // Collection of workflow information elements. - WorkflowEnvelopeCollection -} - // ManagedCertificatesClientCreateOrUpdateResponse contains the response from method ManagedCertificatesClient.BeginCreateOrUpdate. type ManagedCertificatesClientCreateOrUpdateResponse struct { // Managed certificates used for Custom Domain bindings of Container Apps in a Managed Environment @@ -855,35 +515,6 @@ type ManagedEnvironmentDiagnosticsClientListDetectorsResponse struct { DiagnosticsCollection } -// ManagedEnvironmentPrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method ManagedEnvironmentPrivateEndpointConnectionsClient.BeginCreateOrUpdate. -type ManagedEnvironmentPrivateEndpointConnectionsClientCreateOrUpdateResponse struct { - // The Private Endpoint Connection resource. - PrivateEndpointConnection -} - -// ManagedEnvironmentPrivateEndpointConnectionsClientDeleteResponse contains the response from method ManagedEnvironmentPrivateEndpointConnectionsClient.BeginDelete. -type ManagedEnvironmentPrivateEndpointConnectionsClientDeleteResponse struct { - // placeholder for future response values -} - -// ManagedEnvironmentPrivateEndpointConnectionsClientGetResponse contains the response from method ManagedEnvironmentPrivateEndpointConnectionsClient.Get. -type ManagedEnvironmentPrivateEndpointConnectionsClientGetResponse struct { - // The Private Endpoint Connection resource. - PrivateEndpointConnection -} - -// ManagedEnvironmentPrivateEndpointConnectionsClientListResponse contains the response from method ManagedEnvironmentPrivateEndpointConnectionsClient.NewListPager. -type ManagedEnvironmentPrivateEndpointConnectionsClientListResponse struct { - // List of private endpoint connection associated with the specified resource - PrivateEndpointConnectionListResult -} - -// ManagedEnvironmentPrivateLinkResourcesClientListResponse contains the response from method ManagedEnvironmentPrivateLinkResourcesClient.NewListPager. -type ManagedEnvironmentPrivateLinkResourcesClientListResponse struct { - // A list of private link resources - PrivateLinkResourceListResult -} - // ManagedEnvironmentUsagesClientListResponse contains the response from method ManagedEnvironmentUsagesClient.NewListPager. type ManagedEnvironmentUsagesClientListResponse struct { ListUsagesResult diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/time_rfc3339.go b/sdk/resourcemanager/appcontainers/armappcontainers/time_rfc3339.go index 38c2fcaebc44..947aa91dde53 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/time_rfc3339.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/time_rfc3339.go @@ -11,12 +11,11 @@ package armappcontainers import ( "encoding/json" "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" "regexp" "strings" "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" ) // Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/usages_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/usages_client.go index 4788ab98995a..ea3a64995b5a 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/usages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/usages_client.go @@ -11,14 +11,13 @@ package armappcontainers import ( "context" "errors" - "net/http" - "net/url" - "strings" - "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" ) // UsagesClient contains the methods for the Usages group. @@ -29,7 +28,7 @@ type UsagesClient struct { } // NewUsagesClient creates a new instance of UsagesClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - subscriptionID - The ID of the target subscription. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) { @@ -47,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 2024-08-02-preview +// Generated from API version 2025-01-01 // - 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] { @@ -89,7 +88,7 @@ func (client *UsagesClient) listCreateRequest(ctx context.Context, location stri return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-08-02-preview") + reqQP.Set("api-version", "2025-01-01") 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 d3961eb14584..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/366aaa13cdd218b9adac716680e49473673410c8/specification/app/resource-manager/Microsoft.App/preview/2024-08-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"), - // }}, - // } - } -}