From 4531d845e8ef6de8a791770054cf879298e642fe Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 7 Mar 2025 10:06:30 +0000 Subject: [PATCH] CodeGen from PR 33078 in Azure/azure-rest-api-specs Merge be8da609347d4919cba79ebabecc5272ab5208ef into 41c75918ddbde55ccf0a2a656d820f174b7007d0 --- .../armappcontainers/CHANGELOG.md | 75 + .../appcontainers/armappcontainers/README.md | 2 +- .../armappcontainers/appresiliency_client.go | 384 - .../appresiliency_client_example_test.go | 382 - .../armappcontainers/autorest.md | 7 +- .../availableworkloadprofiles_client.go | 18 +- ...bleworkloadprofiles_client_example_test.go | 190 - .../armappcontainers/billingmeters_client.go | 18 +- .../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 | 40 +- .../certificates_client_example_test.go | 280 - .../armappcontainers/client_factory.go | 125 +- .../connectedenvironments_client.go | 58 +- ...nnectedenvironments_client_example_test.go | 357 - ...onnectedenvironmentscertificates_client.go | 42 +- ...onmentscertificates_client_example_test.go | 223 - ...nectedenvironmentsdaprcomponents_client.go | 44 +- ...mentsdaprcomponents_client_example_test.go | 308 - .../connectedenvironmentsstorages_client.go | 38 +- ...nvironmentsstorages_client_example_test.go | 144 - .../armappcontainers/constants.go | 488 +- .../armappcontainers/containerapps_client.go | 86 +- .../containerapps_client_example_test.go | 2782 ------ .../containerappsapi_client.go | 24 +- .../containerappsapi_client_example_test.go | 92 - .../containerappsauthconfigs_client.go | 36 +- ...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 | 40 +- ...inerappsdiagnostics_client_example_test.go | 472 - .../containerappspatches_client.go | 433 - ...ontainerappspatches_client_example_test.go | 281 - .../containerappsrevisionreplicas_client.go | 24 +- ...ppsrevisionreplicas_client_example_test.go | 111 - .../containerappsrevisions_client.go | 40 +- ...tainerappsrevisions_client_example_test.go | 192 - .../containerappssessionpools_client.go | 54 +- ...nerappssessionpools_client_example_test.go | 462 - .../containerappssourcecontrols_client.go | 53 +- ...rappssourcecontrols_client_example_test.go | 227 - .../daprcomponentresiliencypolicies_client.go | 334 - ...tresiliencypolicies_client_example_test.go | 392 - .../armappcontainers/daprcomponents_client.go | 42 +- .../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 | 59 +- .../fake/billingmeters_server.go | 59 +- .../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 | 77 +- .../fake/connectedenvironments_server.go | 83 +- ...onnectedenvironmentscertificates_server.go | 83 +- ...nectedenvironmentsdaprcomponents_server.go | 81 +- .../connectedenvironmentsstorages_server.go | 79 +- .../fake/containerapps_server.go | 101 +- .../fake/containerappsapi_server.go | 63 +- .../fake/containerappsauthconfigs_server.go | 71 +- .../fake/containerappsbuilds_server.go | 163 - ...ontainerappsbuildsbycontainerapp_server.go | 113 - .../fake/containerappsdiagnostics_server.go | 75 +- .../fake/containerappspatches_server.go | 341 - .../containerappsrevisionreplicas_server.go | 63 +- .../fake/containerappsrevisions_server.go | 75 +- .../fake/containerappssessionpools_server.go | 85 +- .../containerappssourcecontrols_server.go | 109 +- .../daprcomponentresiliencypolicies_server.go | 263 - .../fake/daprcomponents_server.go | 75 +- .../fake/daprsubscriptions_server.go | 247 - .../fake/dotnetcomponents_server.go | 333 - .../fake/functionsextension_server.go | 109 - .../armappcontainers/fake/internal.go | 30 +- .../fake/javacomponents_server.go | 81 +- .../armappcontainers/fake/jobs_server.go | 221 +- .../fake/jobsexecutions_server.go | 59 +- .../armappcontainers/fake/logicapps_server.go | 438 - .../fake/managedcertificates_server.go | 77 +- .../managedenvironmentdiagnostics_server.go | 63 +- ...onmentprivateendpointconnections_server.go | 273 - ...denvironmentprivatelinkresources_server.go | 113 - .../fake/managedenvironments_server.go | 89 +- .../managedenvironmentsdiagnostics_server.go | 59 +- .../managedenvironmentsstorages_server.go | 73 +- .../fake/managedenvironmentusages_server.go | 59 +- .../fake/namespaces_server.go | 59 +- .../fake/operations_server.go | 55 +- .../armappcontainers/fake/server_factory.go | 276 +- .../armappcontainers/fake/time_rfc3339.go | 9 +- .../armappcontainers/fake/usages_server.go | 59 +- .../functionsextension_client.go | 120 - .../functionsextension_client_example_test.go | 39 - .../appcontainers/armappcontainers/go.mod | 12 +- .../appcontainers/armappcontainers/go.sum | 23 - .../armappcontainers/interfaces.go | 6 +- .../armappcontainers/javacomponents_client.go | 48 +- .../javacomponents_client_example_test.go | 593 -- .../armappcontainers/jobs_client.go | 252 +- .../jobs_client_example_test.go | 1482 --- .../armappcontainers/jobsexecutions_client.go | 16 +- .../jobsexecutions_client_example_test.go | 98 - .../armappcontainers/logicapps_client.go | 600 -- .../logicapps_client_example_test.go | 384 - .../managedcertificates_client.go | 42 +- ...managedcertificates_client_example_test.go | 200 - .../managedenvironmentdiagnostics_client.go | 24 +- ...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 | 66 +- ...managedenvironments_client_example_test.go | 834 -- .../managedenvironmentsdiagnostics_client.go | 18 +- ...ronmentsdiagnostics_client_example_test.go | 104 - .../managedenvironmentsstorages_client.go | 36 +- ...nvironmentsstorages_client_example_test.go | 228 - .../managedenvironmentusages_client.go | 18 +- ...edenvironmentusages_client_example_test.go | 55 - .../appcontainers/armappcontainers/models.go | 1441 +-- .../armappcontainers/models_serde.go | 8763 +++++------------ .../armappcontainers/namespaces_client.go | 18 +- .../namespaces_client_example_test.go | 75 - .../armappcontainers/operations_client.go | 12 +- .../operations_client_example_test.go | 56 - .../appcontainers/armappcontainers/options.go | 371 +- .../armappcontainers/polymorphic_helpers.go | 7 - .../armappcontainers/responses.go | 308 - .../armappcontainers/time_rfc3339.go | 9 +- .../armappcontainers/usages_client.go | 18 +- .../usages_client_example_test.go | 64 - 146 files changed, 4772 insertions(+), 32904 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_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/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/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/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/usages_client_example_test.go diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md b/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md index de3024fb26a8..9e59d818c847 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md +++ b/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md @@ -1,5 +1,80 @@ # Release History +## 3.1.0 (2025-03-07) +### Features Added + +- New value `StorageTypeNfsAzureFile` added to enum type `StorageType` +- New enum type `ContainerAppRunningStatus` with values `ContainerAppRunningStatusProgressing`, `ContainerAppRunningStatusReady`, `ContainerAppRunningStatusRunning`, `ContainerAppRunningStatusStopped`, `ContainerAppRunningStatusSuspended` +- New enum type `ContainerType` with values `ContainerTypeCustomContainer`, `ContainerTypePythonLTS` +- New enum type `IdentitySettingsLifeCycle` with values `IdentitySettingsLifeCycleMain`, `IdentitySettingsLifeCycleNone` +- New enum type `JavaComponentProvisioningState` with values `JavaComponentProvisioningStateCanceled`, `JavaComponentProvisioningStateDeleting`, `JavaComponentProvisioningStateFailed`, `JavaComponentProvisioningStateInProgress`, `JavaComponentProvisioningStateSucceeded` +- New enum type `JavaComponentType` with values `JavaComponentTypeSpringBootAdmin`, `JavaComponentTypeSpringCloudConfig`, `JavaComponentTypeSpringCloudEureka` +- New enum type `LifecycleType` with values `LifecycleTypeOnContainerExit`, `LifecycleTypeTimed` +- New enum type `PoolManagementType` with values `PoolManagementTypeDynamic`, `PoolManagementTypeManual` +- New enum type `SessionNetworkStatus` with values `SessionNetworkStatusEgressDisabled`, `SessionNetworkStatusEgressEnabled` +- New enum type `SessionPoolProvisioningState` with values `SessionPoolProvisioningStateCanceled`, `SessionPoolProvisioningStateDeleting`, `SessionPoolProvisioningStateFailed`, `SessionPoolProvisioningStateInProgress`, `SessionPoolProvisioningStateSucceeded` +- New function `*ClientFactory.NewContainerAppsSessionPoolsClient() *ContainerAppsSessionPoolsClient` +- New function `*ClientFactory.NewJavaComponentsClient() *JavaComponentsClient` +- New function `NewContainerAppsSessionPoolsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ContainerAppsSessionPoolsClient, error)` +- New function `*ContainerAppsSessionPoolsClient.BeginCreateOrUpdate(context.Context, string, string, SessionPool, *ContainerAppsSessionPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ContainerAppsSessionPoolsClientCreateOrUpdateResponse], error)` +- New function `*ContainerAppsSessionPoolsClient.BeginDelete(context.Context, string, string, *ContainerAppsSessionPoolsClientBeginDeleteOptions) (*runtime.Poller[ContainerAppsSessionPoolsClientDeleteResponse], error)` +- New function `*ContainerAppsSessionPoolsClient.Get(context.Context, string, string, *ContainerAppsSessionPoolsClientGetOptions) (ContainerAppsSessionPoolsClientGetResponse, error)` +- New function `*ContainerAppsSessionPoolsClient.NewListByResourceGroupPager(string, *ContainerAppsSessionPoolsClientListByResourceGroupOptions) *runtime.Pager[ContainerAppsSessionPoolsClientListByResourceGroupResponse]` +- New function `*ContainerAppsSessionPoolsClient.NewListBySubscriptionPager(*ContainerAppsSessionPoolsClientListBySubscriptionOptions) *runtime.Pager[ContainerAppsSessionPoolsClientListBySubscriptionResponse]` +- New function `*ContainerAppsSessionPoolsClient.BeginUpdate(context.Context, string, string, SessionPoolUpdatableProperties, *ContainerAppsSessionPoolsClientBeginUpdateOptions) (*runtime.Poller[ContainerAppsSessionPoolsClientUpdateResponse], error)` +- New function `*JavaComponentProperties.GetJavaComponentProperties() *JavaComponentProperties` +- New function `NewJavaComponentsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*JavaComponentsClient, error)` +- New function `*JavaComponentsClient.BeginCreateOrUpdate(context.Context, string, string, string, JavaComponent, *JavaComponentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[JavaComponentsClientCreateOrUpdateResponse], error)` +- New function `*JavaComponentsClient.BeginDelete(context.Context, string, string, string, *JavaComponentsClientBeginDeleteOptions) (*runtime.Poller[JavaComponentsClientDeleteResponse], error)` +- New function `*JavaComponentsClient.Get(context.Context, string, string, string, *JavaComponentsClientGetOptions) (JavaComponentsClientGetResponse, error)` +- New function `*JavaComponentsClient.NewListPager(string, string, *JavaComponentsClientListOptions) *runtime.Pager[JavaComponentsClientListResponse]` +- New function `*JavaComponentsClient.BeginUpdate(context.Context, string, string, string, JavaComponent, *JavaComponentsClientBeginUpdateOptions) (*runtime.Poller[JavaComponentsClientUpdateResponse], error)` +- New function `*SpringBootAdminComponent.GetJavaComponentProperties() *JavaComponentProperties` +- New function `*SpringCloudConfigComponent.GetJavaComponentProperties() *JavaComponentProperties` +- New function `*SpringCloudEurekaComponent.GetJavaComponentProperties() *JavaComponentProperties` +- New struct `CertificateKeyVaultProperties` +- New struct `CustomContainerTemplate` +- New struct `DynamicPoolConfiguration` +- New struct `JavaComponent` +- New struct `JavaComponentConfigurationProperty` +- New struct `JavaComponentIngress` +- New struct `JavaComponentPropertiesScale` +- New struct `JavaComponentServiceBind` +- New struct `JavaComponentsCollection` +- New struct `LifecycleConfiguration` +- New struct `ManagedIdentitySetting` +- New struct `NfsAzureFileProperties` +- New struct `Runtime` +- New struct `RuntimeJava` +- New struct `ScaleConfiguration` +- New struct `SessionContainer` +- New struct `SessionContainerResources` +- New struct `SessionIngress` +- New struct `SessionNetworkConfiguration` +- New struct `SessionPool` +- New struct `SessionPoolCollection` +- New struct `SessionPoolProperties` +- New struct `SessionPoolSecret` +- New struct `SessionPoolUpdatableProperties` +- New struct `SessionPoolUpdatablePropertiesProperties` +- New struct `SessionRegistryCredentials` +- New struct `SpringBootAdminComponent` +- New struct `SpringCloudConfigComponent` +- New struct `SpringCloudEurekaComponent` +- New field `CertificateKeyVaultProperties` in struct `CertificateProperties` +- New field `Runtime` in struct `Configuration` +- New field `RunningStatus` in struct `ContainerAppProperties` +- New field `CertificateKeyVaultProperties` in struct `CustomDomainConfiguration` +- New field `Identity` in struct `CustomScaleRule` +- New field `Identity` in struct `HTTPScaleRule` +- New field `Identity` in struct `JobScaleRule` +- New field `Identity` in struct `ManagedEnvironment` +- 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..d48aedc8bd1c 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +42,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. @@ -74,7 +70,7 @@ func (client *AvailableWorkloadProfilesClient) NewGetPager(location string, opti } // getCreateRequest creates the Get request. -func (client *AvailableWorkloadProfilesClient) getCreateRequest(ctx context.Context, location string, options *AvailableWorkloadProfilesClientGetOptions) (*policy.Request, error) { +func (client *AvailableWorkloadProfilesClient) getCreateRequest(ctx context.Context, location string, _ *AvailableWorkloadProfilesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/availableManagedEnvironmentsWorkloadProfileTypes" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -89,7 +85,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..38ac0a18093d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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) { @@ -73,7 +69,7 @@ func (client *BillingMetersClient) Get(ctx context.Context, location string, opt } // getCreateRequest creates the Get request. -func (client *BillingMetersClient) getCreateRequest(ctx context.Context, location string, options *BillingMetersClientGetOptions) (*policy.Request, error) { +func (client *BillingMetersClient) getCreateRequest(ctx context.Context, location string, _ *BillingMetersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/billingMeters" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -88,7 +84,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..f3cd97dcd0aa 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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 +95,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 +119,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. @@ -150,7 +146,7 @@ func (client *CertificatesClient) Delete(ctx context.Context, resourceGroupName } // deleteCreateRequest creates the Delete request. -func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, certificateName string, options *CertificatesClientDeleteOptions) (*policy.Request, error) { +func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, certificateName string, _ *CertificatesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -173,7 +169,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 +178,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. @@ -210,7 +206,7 @@ func (client *CertificatesClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *CertificatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, certificateName string, options *CertificatesClientGetOptions) (*policy.Request, error) { +func (client *CertificatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, certificateName string, _ *CertificatesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -233,7 +229,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 +246,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. @@ -278,7 +274,7 @@ func (client *CertificatesClient) NewListPager(resourceGroupName string, environ } // listCreateRequest creates the List request. -func (client *CertificatesClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *CertificatesClientListOptions) (*policy.Request, error) { +func (client *CertificatesClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, _ *CertificatesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -297,7 +293,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 +311,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. @@ -344,7 +340,7 @@ func (client *CertificatesClient) Update(ctx context.Context, resourceGroupName } // updateCreateRequest creates the Update request. -func (client *CertificatesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, certificateName string, certificateEnvelope CertificatePatch, options *CertificatesClientUpdateOptions) (*policy.Request, error) { +func (client *CertificatesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, certificateName string, certificateEnvelope CertificatePatch, _ *CertificatesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -367,7 +363,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..349c74727565 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/client_factory.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/client_factory.go @@ -1,6 +1,3 @@ -//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. @@ -22,7 +19,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 +33,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 +49,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 +105,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 +121,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{ @@ -220,14 +153,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,30 +161,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{ @@ -284,14 +185,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 +201,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..e2c52cab4213 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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. @@ -76,7 +72,7 @@ func (client *ConnectedEnvironmentsClient) CheckNameAvailability(ctx context.Con } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. -func (client *ConnectedEnvironmentsClient) checkNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, checkNameAvailabilityRequest CheckNameAvailabilityRequest, options *ConnectedEnvironmentsClientCheckNameAvailabilityOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsClient) checkNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, checkNameAvailabilityRequest CheckNameAvailabilityRequest, _ *ConnectedEnvironmentsClientCheckNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/checkNameAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -95,7 +91,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 +112,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 +139,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" @@ -166,7 +162,7 @@ func (client *ConnectedEnvironmentsClient) createOrUpdate(ctx context.Context, r } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConnectedEnvironmentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, environmentEnvelope ConnectedEnvironment, options *ConnectedEnvironmentsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, environmentEnvelope ConnectedEnvironment, _ *ConnectedEnvironmentsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -185,7 +181,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 +193,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 +219,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" @@ -246,7 +242,7 @@ func (client *ConnectedEnvironmentsClient) deleteOperation(ctx context.Context, } // deleteCreateRequest creates the Delete request. -func (client *ConnectedEnvironmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, _ *ConnectedEnvironmentsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -265,7 +261,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 +270,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 @@ -302,7 +298,7 @@ func (client *ConnectedEnvironmentsClient) Get(ctx context.Context, resourceGrou } // getCreateRequest creates the Get request. -func (client *ConnectedEnvironmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsClientGetOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, _ *ConnectedEnvironmentsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -321,7 +317,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 +334,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. @@ -366,7 +362,7 @@ func (client *ConnectedEnvironmentsClient) NewListByResourceGroupPager(resourceG } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ConnectedEnvironmentsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ConnectedEnvironmentsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ConnectedEnvironmentsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -381,7 +377,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 +394,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] { @@ -425,7 +421,7 @@ func (client *ConnectedEnvironmentsClient) NewListBySubscriptionPager(options *C } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ConnectedEnvironmentsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ConnectedEnvironmentsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *ConnectedEnvironmentsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.App/connectedEnvironments" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -436,7 +432,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 +450,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 @@ -482,7 +478,7 @@ func (client *ConnectedEnvironmentsClient) Update(ctx context.Context, resourceG } // updateCreateRequest creates the Update request. -func (client *ConnectedEnvironmentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsClientUpdateOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, _ *ConnectedEnvironmentsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -501,7 +497,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..7257adfc6652 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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. @@ -67,7 +63,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) CreateOrUpdate(ctx contex if err != nil { return ConnectedEnvironmentsCertificatesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) return ConnectedEnvironmentsCertificatesClientCreateOrUpdateResponse{}, err } @@ -99,7 +95,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 +119,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. @@ -151,7 +147,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) Delete(ctx context.Contex } // deleteCreateRequest creates the Delete request. -func (client *ConnectedEnvironmentsCertificatesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, certificateName string, options *ConnectedEnvironmentsCertificatesClientDeleteOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsCertificatesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, certificateName string, _ *ConnectedEnvironmentsCertificatesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -174,7 +170,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 +179,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. @@ -212,7 +208,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) Get(ctx context.Context, } // getCreateRequest creates the Get request. -func (client *ConnectedEnvironmentsCertificatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, certificateName string, options *ConnectedEnvironmentsCertificatesClientGetOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsCertificatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, certificateName string, _ *ConnectedEnvironmentsCertificatesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -235,7 +231,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 +248,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 @@ -281,7 +277,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) NewListPager(resourceGrou } // listCreateRequest creates the List request. -func (client *ConnectedEnvironmentsCertificatesClient) listCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsCertificatesClientListOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsCertificatesClient) listCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, _ *ConnectedEnvironmentsCertificatesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -300,7 +296,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 +314,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. @@ -348,7 +344,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) Update(ctx context.Contex } // updateCreateRequest creates the Update request. -func (client *ConnectedEnvironmentsCertificatesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, certificateName string, certificateEnvelope CertificatePatch, options *ConnectedEnvironmentsCertificatesClientUpdateOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsCertificatesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, certificateName string, certificateEnvelope CertificatePatch, _ *ConnectedEnvironmentsCertificatesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -371,7 +367,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..2fe2360d995d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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. @@ -77,7 +73,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) CreateOrUpdate(ctx cont } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConnectedEnvironmentsDaprComponentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, daprComponentEnvelope DaprComponent, options *ConnectedEnvironmentsDaprComponentsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsDaprComponentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, daprComponentEnvelope DaprComponent, _ *ConnectedEnvironmentsDaprComponentsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -100,7 +96,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 +117,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. @@ -149,7 +145,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) Delete(ctx context.Cont } // deleteCreateRequest creates the Delete request. -func (client *ConnectedEnvironmentsDaprComponentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, options *ConnectedEnvironmentsDaprComponentsClientDeleteOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsDaprComponentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, _ *ConnectedEnvironmentsDaprComponentsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -172,7 +168,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 +177,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. @@ -210,7 +206,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) Get(ctx context.Context } // getCreateRequest creates the Get request. -func (client *ConnectedEnvironmentsDaprComponentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, options *ConnectedEnvironmentsDaprComponentsClientGetOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsDaprComponentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, _ *ConnectedEnvironmentsDaprComponentsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -233,7 +229,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 +246,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 @@ -279,7 +275,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) NewListPager(resourceGr } // listCreateRequest creates the List request. -func (client *ConnectedEnvironmentsDaprComponentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsDaprComponentsClientListOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsDaprComponentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, _ *ConnectedEnvironmentsDaprComponentsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -298,7 +294,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 +312,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. @@ -336,7 +332,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) ListSecrets(ctx context if err != nil { return ConnectedEnvironmentsDaprComponentsClientListSecretsResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) return ConnectedEnvironmentsDaprComponentsClientListSecretsResponse{}, err } @@ -345,7 +341,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) ListSecrets(ctx context } // listSecretsCreateRequest creates the ListSecrets request. -func (client *ConnectedEnvironmentsDaprComponentsClient) listSecretsCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, options *ConnectedEnvironmentsDaprComponentsClientListSecretsOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsDaprComponentsClient) listSecretsCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, _ *ConnectedEnvironmentsDaprComponentsClientListSecretsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}/listSecrets" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -368,7 +364,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..ff7cce535b1c 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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. @@ -68,7 +64,7 @@ func (client *ConnectedEnvironmentsStoragesClient) CreateOrUpdate(ctx context.Co if err != nil { return ConnectedEnvironmentsStoragesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { err = runtime.NewResponseError(httpResp) return ConnectedEnvironmentsStoragesClientCreateOrUpdateResponse{}, err } @@ -77,7 +73,7 @@ func (client *ConnectedEnvironmentsStoragesClient) CreateOrUpdate(ctx context.Co } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConnectedEnvironmentsStoragesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, storageName string, storageEnvelope ConnectedEnvironmentStorage, options *ConnectedEnvironmentsStoragesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsStoragesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, storageName string, storageEnvelope ConnectedEnvironmentStorage, _ *ConnectedEnvironmentsStoragesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -100,7 +96,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 +117,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. @@ -149,7 +145,7 @@ func (client *ConnectedEnvironmentsStoragesClient) Delete(ctx context.Context, r } // deleteCreateRequest creates the Delete request. -func (client *ConnectedEnvironmentsStoragesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, storageName string, options *ConnectedEnvironmentsStoragesClientDeleteOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsStoragesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, storageName string, _ *ConnectedEnvironmentsStoragesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -172,7 +168,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 +177,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. @@ -210,7 +206,7 @@ func (client *ConnectedEnvironmentsStoragesClient) Get(ctx context.Context, reso } // getCreateRequest creates the Get request. -func (client *ConnectedEnvironmentsStoragesClient) getCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, storageName string, options *ConnectedEnvironmentsStoragesClientGetOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsStoragesClient) getCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, storageName string, _ *ConnectedEnvironmentsStoragesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -233,7 +229,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 +247,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 @@ -279,7 +275,7 @@ func (client *ConnectedEnvironmentsStoragesClient) List(ctx context.Context, res } // listCreateRequest creates the List request. -func (client *ConnectedEnvironmentsStoragesClient) listCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsStoragesClientListOptions) (*policy.Request, error) { +func (client *ConnectedEnvironmentsStoragesClient) listCreateRequest(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, _ *ConnectedEnvironmentsStoragesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -298,7 +294,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..67210bdc2b70 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/constants.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/constants.go @@ -1,6 +1,3 @@ -//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. @@ -10,7 +7,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 +124,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 +146,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,6 +248,33 @@ func PossibleContainerAppReplicaRunningStateValues() []ContainerAppReplicaRunnin } } +// ContainerAppRunningStatus - Running status of the Container App. +type ContainerAppRunningStatus string + +const ( + // ContainerAppRunningStatusProgressing - Container App is transitioning between Stopped and Running states. + ContainerAppRunningStatusProgressing ContainerAppRunningStatus = "Progressing" + // ContainerAppRunningStatusReady - Container App Job is in Ready state. + ContainerAppRunningStatusReady ContainerAppRunningStatus = "Ready" + // ContainerAppRunningStatusRunning - Container App is in Running state. + ContainerAppRunningStatusRunning ContainerAppRunningStatus = "Running" + // ContainerAppRunningStatusStopped - Container App is in Stopped state. + ContainerAppRunningStatusStopped ContainerAppRunningStatus = "Stopped" + // ContainerAppRunningStatusSuspended - Container App Job is in Suspended state. + ContainerAppRunningStatusSuspended ContainerAppRunningStatus = "Suspended" +) + +// PossibleContainerAppRunningStatusValues returns the possible values for the ContainerAppRunningStatus const type. +func PossibleContainerAppRunningStatusValues() []ContainerAppRunningStatus { + return []ContainerAppRunningStatus{ + ContainerAppRunningStatusProgressing, + ContainerAppRunningStatusReady, + ContainerAppRunningStatusRunning, + ContainerAppRunningStatusStopped, + ContainerAppRunningStatusSuspended, + } +} + // ContainerType - The container type of the sessions. type ContainerType string @@ -407,60 +345,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 +377,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,13 +409,11 @@ func PossibleForwardProxyConventionValues() []ForwardProxyConvention { } } -// IdentitySettingsLifeCycle - Use to select the lifecycle stages of a Container App during which the Managed Identity should +// IdentitySettingsLifeCycle - Use to select the lifecycle stages of a Session Pool during which the Managed Identity should // be available. type IdentitySettingsLifeCycle string const ( - IdentitySettingsLifeCycleAll IdentitySettingsLifeCycle = "All" - IdentitySettingsLifeCycleInit IdentitySettingsLifeCycle = "Init" IdentitySettingsLifeCycleMain IdentitySettingsLifeCycle = "Main" IdentitySettingsLifeCycleNone IdentitySettingsLifeCycle = "None" ) @@ -553,30 +421,11 @@ const ( // 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 +446,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 @@ -659,21 +492,17 @@ func PossibleJavaComponentProvisioningStateValues() []JavaComponentProvisioningS type JavaComponentType string const ( - JavaComponentTypeNacos JavaComponentType = "Nacos" - JavaComponentTypeSpringBootAdmin JavaComponentType = "SpringBootAdmin" - JavaComponentTypeSpringCloudConfig JavaComponentType = "SpringCloudConfig" - JavaComponentTypeSpringCloudEureka JavaComponentType = "SpringCloudEureka" - JavaComponentTypeSpringCloudGateway JavaComponentType = "SpringCloudGateway" + JavaComponentTypeSpringBootAdmin JavaComponentType = "SpringBootAdmin" + JavaComponentTypeSpringCloudConfig JavaComponentType = "SpringCloudConfig" + JavaComponentTypeSpringCloudEureka JavaComponentType = "SpringCloudEureka" ) // PossibleJavaComponentTypeValues returns the possible values for the JavaComponentType const type. func PossibleJavaComponentTypeValues() []JavaComponentType { return []JavaComponentType{ - JavaComponentTypeNacos, JavaComponentTypeSpringBootAdmin, JavaComponentTypeSpringCloudConfig, JavaComponentTypeSpringCloudEureka, - JavaComponentTypeSpringCloudGateway, } } @@ -725,61 +554,19 @@ func PossibleJobProvisioningStateValues() []JobProvisioningState { } } -// JobRunningState - Current running state of the job -type JobRunningState string +// LifecycleType - The lifecycle type of the session pool. +type LifecycleType string const ( - JobRunningStateProgressing JobRunningState = "Progressing" - JobRunningStateReady JobRunningState = "Ready" - JobRunningStateSuspended JobRunningState = "Suspended" + LifecycleTypeOnContainerExit LifecycleType = "OnContainerExit" + LifecycleTypeTimed LifecycleType = "Timed" ) -// 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 - -const ( - LevelDebug Level = "debug" - LevelError Level = "error" - LevelInfo Level = "info" - LevelOff Level = "off" - LevelTrace Level = "trace" - LevelWarn Level = "warn" -) - -// PossibleLevelValues returns the possible values for the Level const type. -func PossibleLevelValues() []Level { - return []Level{ - LevelDebug, - LevelError, - LevelInfo, - LevelOff, - LevelTrace, - LevelWarn, +// PossibleLifecycleTypeValues returns the possible values for the LifecycleType const type. +func PossibleLifecycleTypeValues() []LifecycleType { + return []LifecycleType{ + LifecycleTypeOnContainerExit, + LifecycleTypeTimed, } } @@ -803,21 +590,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,76 +628,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 @@ -942,68 +644,6 @@ func PossiblePoolManagementTypeValues() []PoolManagementType { } } -// 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 @@ -1150,7 +790,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 +799,6 @@ func PossibleStorageTypeValues() []StorageType { StorageTypeEmptyDir, StorageTypeNfsAzureFile, StorageTypeSecret, - StorageTypeSmb, } } @@ -1219,47 +857,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..c7d5656ae5b6 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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 +70,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" @@ -97,7 +93,7 @@ func (client *ContainerAppsClient) createOrUpdate(ctx context.Context, resourceG } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ContainerAppsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, containerAppEnvelope ContainerApp, options *ContainerAppsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ContainerAppsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, containerAppEnvelope ContainerApp, _ *ContainerAppsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -116,7 +112,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 +124,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 +150,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" @@ -177,7 +173,7 @@ func (client *ContainerAppsClient) deleteOperation(ctx context.Context, resource } // deleteCreateRequest creates the Delete request. -func (client *ContainerAppsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ContainerAppsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, _ *ContainerAppsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -196,7 +192,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 +201,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. @@ -232,7 +228,7 @@ func (client *ContainerAppsClient) Get(ctx context.Context, resourceGroupName st } // getCreateRequest creates the Get request. -func (client *ContainerAppsClient) getCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientGetOptions) (*policy.Request, error) { +func (client *ContainerAppsClient) getCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, _ *ContainerAppsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -251,7 +247,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 +265,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 @@ -297,7 +293,7 @@ func (client *ContainerAppsClient) GetAuthToken(ctx context.Context, resourceGro } // getAuthTokenCreateRequest creates the GetAuthToken request. -func (client *ContainerAppsClient) getAuthTokenCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientGetAuthTokenOptions) (*policy.Request, error) { +func (client *ContainerAppsClient) getAuthTokenCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, _ *ContainerAppsClientGetAuthTokenOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/getAuthtoken" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -316,7 +312,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 +329,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. @@ -361,7 +357,7 @@ func (client *ContainerAppsClient) NewListByResourceGroupPager(resourceGroupName } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ContainerAppsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ContainerAppsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ContainerAppsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ContainerAppsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -376,7 +372,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 +389,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] { @@ -420,7 +416,7 @@ func (client *ContainerAppsClient) NewListBySubscriptionPager(options *Container } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ContainerAppsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ContainerAppsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *ContainerAppsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *ContainerAppsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.App/containerApps" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -431,7 +427,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 +445,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 +492,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 +513,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 @@ -545,7 +541,7 @@ func (client *ContainerAppsClient) ListSecrets(ctx context.Context, resourceGrou } // listSecretsCreateRequest creates the ListSecrets request. -func (client *ContainerAppsClient) listSecretsCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientListSecretsOptions) (*policy.Request, error) { +func (client *ContainerAppsClient) listSecretsCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, _ *ContainerAppsClientListSecretsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listSecrets" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -564,7 +560,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 +578,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 +604,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" @@ -631,7 +627,7 @@ func (client *ContainerAppsClient) start(ctx context.Context, resourceGroupName } // startCreateRequest creates the Start request. -func (client *ContainerAppsClient) startCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientBeginStartOptions) (*policy.Request, error) { +func (client *ContainerAppsClient) startCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, _ *ContainerAppsClientBeginStartOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/start" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -650,7 +646,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 +655,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 +680,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" @@ -707,7 +703,7 @@ func (client *ContainerAppsClient) stop(ctx context.Context, resourceGroupName s } // stopCreateRequest creates the Stop request. -func (client *ContainerAppsClient) stopCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientBeginStopOptions) (*policy.Request, error) { +func (client *ContainerAppsClient) stopCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, _ *ContainerAppsClientBeginStopOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -726,7 +722,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 +731,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 +757,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" @@ -784,7 +780,7 @@ func (client *ContainerAppsClient) update(ctx context.Context, resourceGroupName } // updateCreateRequest creates the Update request. -func (client *ContainerAppsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, containerAppEnvelope ContainerApp, options *ContainerAppsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ContainerAppsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, containerAppEnvelope ContainerApp, _ *ContainerAppsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -803,7 +799,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..a4c771777c17 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsapi_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsapi_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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) { @@ -73,7 +69,7 @@ func (client *ContainerAppsAPIClient) GetCustomDomainVerificationID(ctx context. } // getCustomDomainVerificationIDCreateRequest creates the GetCustomDomainVerificationID request. -func (client *ContainerAppsAPIClient) getCustomDomainVerificationIDCreateRequest(ctx context.Context, options *ContainerAppsAPIClientGetCustomDomainVerificationIDOptions) (*policy.Request, error) { +func (client *ContainerAppsAPIClient) getCustomDomainVerificationIDCreateRequest(ctx context.Context, _ *ContainerAppsAPIClientGetCustomDomainVerificationIDOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.App/getCustomDomainVerificationId" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -84,7 +80,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 +98,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. @@ -131,7 +127,7 @@ func (client *ContainerAppsAPIClient) JobExecution(ctx context.Context, resource } // jobExecutionCreateRequest creates the JobExecution request. -func (client *ContainerAppsAPIClient) jobExecutionCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobExecutionName string, options *ContainerAppsAPIClientJobExecutionOptions) (*policy.Request, error) { +func (client *ContainerAppsAPIClient) jobExecutionCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobExecutionName string, _ *ContainerAppsAPIClientJobExecutionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -154,7 +150,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..03520d69f5ac 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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. @@ -77,7 +73,7 @@ func (client *ContainerAppsAuthConfigsClient) CreateOrUpdate(ctx context.Context } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ContainerAppsAuthConfigsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, authConfigName string, authConfigEnvelope AuthConfig, options *ContainerAppsAuthConfigsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ContainerAppsAuthConfigsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, authConfigName string, authConfigEnvelope AuthConfig, _ *ContainerAppsAuthConfigsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -100,7 +96,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 +117,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. @@ -149,7 +145,7 @@ func (client *ContainerAppsAuthConfigsClient) Delete(ctx context.Context, resour } // deleteCreateRequest creates the Delete request. -func (client *ContainerAppsAuthConfigsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, authConfigName string, options *ContainerAppsAuthConfigsClientDeleteOptions) (*policy.Request, error) { +func (client *ContainerAppsAuthConfigsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, authConfigName string, _ *ContainerAppsAuthConfigsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -172,7 +168,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 +177,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. @@ -210,7 +206,7 @@ func (client *ContainerAppsAuthConfigsClient) Get(ctx context.Context, resourceG } // getCreateRequest creates the Get request. -func (client *ContainerAppsAuthConfigsClient) getCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, authConfigName string, options *ContainerAppsAuthConfigsClientGetOptions) (*policy.Request, error) { +func (client *ContainerAppsAuthConfigsClient) getCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, authConfigName string, _ *ContainerAppsAuthConfigsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -233,7 +229,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 +246,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 @@ -279,7 +275,7 @@ func (client *ContainerAppsAuthConfigsClient) NewListByContainerAppPager(resourc } // listByContainerAppCreateRequest creates the ListByContainerApp request. -func (client *ContainerAppsAuthConfigsClient) listByContainerAppCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsAuthConfigsClientListByContainerAppOptions) (*policy.Request, error) { +func (client *ContainerAppsAuthConfigsClient) listByContainerAppCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, _ *ContainerAppsAuthConfigsClientListByContainerAppOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -298,7 +294,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..f64ddca6eb1b 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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. @@ -76,7 +72,7 @@ func (client *ContainerAppsDiagnosticsClient) GetDetector(ctx context.Context, r } // getDetectorCreateRequest creates the GetDetector request. -func (client *ContainerAppsDiagnosticsClient) getDetectorCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, detectorName string, options *ContainerAppsDiagnosticsClientGetDetectorOptions) (*policy.Request, error) { +func (client *ContainerAppsDiagnosticsClient) getDetectorCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, detectorName string, _ *ContainerAppsDiagnosticsClientGetDetectorOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors/{detectorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -99,7 +95,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 +113,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. @@ -146,7 +142,7 @@ func (client *ContainerAppsDiagnosticsClient) GetRevision(ctx context.Context, r } // getRevisionCreateRequest creates the GetRevision request. -func (client *ContainerAppsDiagnosticsClient) getRevisionCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, options *ContainerAppsDiagnosticsClientGetRevisionOptions) (*policy.Request, error) { +func (client *ContainerAppsDiagnosticsClient) getRevisionCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, _ *ContainerAppsDiagnosticsClientGetRevisionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/{revisionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -169,7 +165,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 +183,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 @@ -215,7 +211,7 @@ func (client *ContainerAppsDiagnosticsClient) GetRoot(ctx context.Context, resou } // getRootCreateRequest creates the GetRoot request. -func (client *ContainerAppsDiagnosticsClient) getRootCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsDiagnosticsClientGetRootOptions) (*policy.Request, error) { +func (client *ContainerAppsDiagnosticsClient) getRootCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, _ *ContainerAppsDiagnosticsClientGetRootOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/rootApi/" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -234,7 +230,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 +247,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 @@ -280,7 +276,7 @@ func (client *ContainerAppsDiagnosticsClient) NewListDetectorsPager(resourceGrou } // listDetectorsCreateRequest creates the ListDetectors request. -func (client *ContainerAppsDiagnosticsClient) listDetectorsCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsDiagnosticsClientListDetectorsOptions) (*policy.Request, error) { +func (client *ContainerAppsDiagnosticsClient) listDetectorsCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, _ *ContainerAppsDiagnosticsClientListDetectorsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -299,7 +295,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 +312,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 +363,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..5d2e5f9aa432 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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. @@ -77,7 +73,7 @@ func (client *ContainerAppsRevisionReplicasClient) GetReplica(ctx context.Contex } // getReplicaCreateRequest creates the GetReplica request. -func (client *ContainerAppsRevisionReplicasClient) getReplicaCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, replicaName string, options *ContainerAppsRevisionReplicasClientGetReplicaOptions) (*policy.Request, error) { +func (client *ContainerAppsRevisionReplicasClient) getReplicaCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, replicaName string, _ *ContainerAppsRevisionReplicasClientGetReplicaOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas/{replicaName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -104,7 +100,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 +118,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. @@ -151,7 +147,7 @@ func (client *ContainerAppsRevisionReplicasClient) ListReplicas(ctx context.Cont } // listReplicasCreateRequest creates the ListReplicas request. -func (client *ContainerAppsRevisionReplicasClient) listReplicasCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, options *ContainerAppsRevisionReplicasClientListReplicasOptions) (*policy.Request, error) { +func (client *ContainerAppsRevisionReplicasClient) listReplicasCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, _ *ContainerAppsRevisionReplicasClientListReplicasOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -174,7 +170,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..44bc975b5fb2 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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. @@ -75,7 +71,7 @@ func (client *ContainerAppsRevisionsClient) ActivateRevision(ctx context.Context } // activateRevisionCreateRequest creates the ActivateRevision request. -func (client *ContainerAppsRevisionsClient) activateRevisionCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, options *ContainerAppsRevisionsClientActivateRevisionOptions) (*policy.Request, error) { +func (client *ContainerAppsRevisionsClient) activateRevisionCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, _ *ContainerAppsRevisionsClientActivateRevisionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/activate" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -98,7 +94,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 +103,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. @@ -135,7 +131,7 @@ func (client *ContainerAppsRevisionsClient) DeactivateRevision(ctx context.Conte } // deactivateRevisionCreateRequest creates the DeactivateRevision request. -func (client *ContainerAppsRevisionsClient) deactivateRevisionCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, options *ContainerAppsRevisionsClientDeactivateRevisionOptions) (*policy.Request, error) { +func (client *ContainerAppsRevisionsClient) deactivateRevisionCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, _ *ContainerAppsRevisionsClientDeactivateRevisionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/deactivate" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -158,7 +154,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 +163,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. @@ -196,7 +192,7 @@ func (client *ContainerAppsRevisionsClient) GetRevision(ctx context.Context, res } // getRevisionCreateRequest creates the GetRevision request. -func (client *ContainerAppsRevisionsClient) getRevisionCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, options *ContainerAppsRevisionsClientGetRevisionOptions) (*policy.Request, error) { +func (client *ContainerAppsRevisionsClient) getRevisionCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, _ *ContainerAppsRevisionsClientGetRevisionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -219,7 +215,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 +232,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 +283,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 +301,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. @@ -333,7 +329,7 @@ func (client *ContainerAppsRevisionsClient) RestartRevision(ctx context.Context, } // restartRevisionCreateRequest creates the RestartRevision request. -func (client *ContainerAppsRevisionsClient) restartRevisionCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, options *ContainerAppsRevisionsClientRestartRevisionOptions) (*policy.Request, error) { +func (client *ContainerAppsRevisionsClient) restartRevisionCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, _ *ContainerAppsRevisionsClientRestartRevisionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/restart" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -356,7 +352,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 index 2204ef02833c..6721561bf320 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssessionpools_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappssessionpools_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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" ) // ContainerAppsSessionPoolsClient contains the methods for the ContainerAppsSessionPools group. @@ -29,7 +25,7 @@ type ContainerAppsSessionPoolsClient struct { } // NewContainerAppsSessionPoolsClient creates a new instance of ContainerAppsSessionPoolsClient 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 NewContainerAppsSessionPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerAppsSessionPoolsClient, error) { @@ -47,7 +43,7 @@ func NewContainerAppsSessionPoolsClient(subscriptionID string, credential azcore // 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 +// Generated from API version 2025-01-01 // - 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 @@ -74,7 +70,7 @@ func (client *ContainerAppsSessionPoolsClient) BeginCreateOrUpdate(ctx context.C // 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 +// Generated from API version 2025-01-01 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" @@ -97,7 +93,7 @@ func (client *ContainerAppsSessionPoolsClient) createOrUpdate(ctx context.Contex } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ContainerAppsSessionPoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, sessionPoolName string, sessionPoolEnvelope SessionPool, options *ContainerAppsSessionPoolsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ContainerAppsSessionPoolsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, sessionPoolName string, sessionPoolEnvelope SessionPool, _ *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") @@ -116,7 +112,7 @@ func (client *ContainerAppsSessionPoolsClient) createOrUpdateCreateRequest(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, sessionPoolEnvelope); err != nil { @@ -128,7 +124,7 @@ func (client *ContainerAppsSessionPoolsClient) createOrUpdateCreateRequest(ctx c // 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 +// Generated from API version 2025-01-01 // - 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 @@ -154,7 +150,7 @@ func (client *ContainerAppsSessionPoolsClient) BeginDelete(ctx context.Context, // 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 +// Generated from API version 2025-01-01 func (client *ContainerAppsSessionPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, sessionPoolName string, options *ContainerAppsSessionPoolsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ContainerAppsSessionPoolsClient.BeginDelete" @@ -177,7 +173,7 @@ func (client *ContainerAppsSessionPoolsClient) deleteOperation(ctx context.Conte } // deleteCreateRequest creates the Delete request. -func (client *ContainerAppsSessionPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sessionPoolName string, options *ContainerAppsSessionPoolsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ContainerAppsSessionPoolsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, sessionPoolName string, _ *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") @@ -196,7 +192,7 @@ func (client *ContainerAppsSessionPoolsClient) deleteCreateRequest(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 @@ -205,7 +201,7 @@ func (client *ContainerAppsSessionPoolsClient) deleteCreateRequest(ctx context.C // 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 +// Generated from API version 2025-01-01 // - 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 @@ -233,7 +229,7 @@ func (client *ContainerAppsSessionPoolsClient) Get(ctx context.Context, resource } // getCreateRequest creates the Get request. -func (client *ContainerAppsSessionPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, sessionPoolName string, options *ContainerAppsSessionPoolsClientGetOptions) (*policy.Request, error) { +func (client *ContainerAppsSessionPoolsClient) getCreateRequest(ctx context.Context, resourceGroupName string, sessionPoolName string, _ *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") @@ -252,7 +248,7 @@ func (client *ContainerAppsSessionPoolsClient) 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 @@ -269,7 +265,7 @@ func (client *ContainerAppsSessionPoolsClient) getHandleResponse(resp *http.Resp // NewListByResourceGroupPager - Get the session pools in a given resource group of a subscription. // -// 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 - ContainerAppsSessionPoolsClientListByResourceGroupOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.NewListByResourceGroupPager // method. @@ -297,7 +293,7 @@ func (client *ContainerAppsSessionPoolsClient) NewListByResourceGroupPager(resou } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ContainerAppsSessionPoolsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ContainerAppsSessionPoolsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ContainerAppsSessionPoolsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *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") @@ -312,7 +308,7 @@ func (client *ContainerAppsSessionPoolsClient) listByResourceGroupCreateRequest( 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 +325,7 @@ func (client *ContainerAppsSessionPoolsClient) listByResourceGroupHandleResponse // NewListBySubscriptionPager - Get the session pools in a given subscription. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 // - options - ContainerAppsSessionPoolsClientListBySubscriptionOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.NewListBySubscriptionPager // method. func (client *ContainerAppsSessionPoolsClient) NewListBySubscriptionPager(options *ContainerAppsSessionPoolsClientListBySubscriptionOptions) *runtime.Pager[ContainerAppsSessionPoolsClientListBySubscriptionResponse] { @@ -356,7 +352,7 @@ func (client *ContainerAppsSessionPoolsClient) NewListBySubscriptionPager(option } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ContainerAppsSessionPoolsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ContainerAppsSessionPoolsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *ContainerAppsSessionPoolsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *ContainerAppsSessionPoolsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.App/sessionPools" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -367,7 +363,7 @@ func (client *ContainerAppsSessionPoolsClient) listBySubscriptionCreateRequest(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 @@ -385,7 +381,7 @@ func (client *ContainerAppsSessionPoolsClient) listBySubscriptionHandleResponse( // 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 +// Generated from API version 2025-01-01 // - 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 @@ -412,7 +408,7 @@ func (client *ContainerAppsSessionPoolsClient) BeginUpdate(ctx context.Context, // 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 +// Generated from API version 2025-01-01 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" @@ -435,7 +431,7 @@ func (client *ContainerAppsSessionPoolsClient) update(ctx context.Context, resou } // updateCreateRequest creates the Update request. -func (client *ContainerAppsSessionPoolsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sessionPoolName string, sessionPoolEnvelope SessionPoolUpdatableProperties, options *ContainerAppsSessionPoolsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ContainerAppsSessionPoolsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sessionPoolName string, sessionPoolEnvelope SessionPoolUpdatableProperties, _ *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") @@ -454,7 +450,7 @@ func (client *ContainerAppsSessionPoolsClient) updateCreateRequest(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, sessionPoolEnvelope); err != 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..90d3f334f02d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,15 +8,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 +25,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 +43,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 +70,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" @@ -98,7 +93,7 @@ func (client *ContainerAppsSourceControlsClient) createOrUpdate(ctx context.Cont } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ContainerAppsSourceControlsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, sourceControlEnvelope SourceControl, options *ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ContainerAppsSourceControlsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, sourceControlEnvelope SourceControl, _ *ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -121,12 +116,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 +128,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 +154,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" @@ -185,7 +177,7 @@ func (client *ContainerAppsSourceControlsClient) deleteOperation(ctx context.Con } // deleteCreateRequest creates the Delete request. -func (client *ContainerAppsSourceControlsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, options *ContainerAppsSourceControlsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ContainerAppsSourceControlsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, _ *ContainerAppsSourceControlsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -208,25 +200,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. @@ -255,7 +238,7 @@ func (client *ContainerAppsSourceControlsClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *ContainerAppsSourceControlsClient) getCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, options *ContainerAppsSourceControlsClientGetOptions) (*policy.Request, error) { +func (client *ContainerAppsSourceControlsClient) getCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, _ *ContainerAppsSourceControlsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -278,7 +261,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 +278,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 @@ -324,7 +307,7 @@ func (client *ContainerAppsSourceControlsClient) NewListByContainerAppPager(reso } // listByContainerAppCreateRequest creates the ListByContainerApp request. -func (client *ContainerAppsSourceControlsClient) listByContainerAppCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsSourceControlsClientListByContainerAppOptions) (*policy.Request, error) { +func (client *ContainerAppsSourceControlsClient) listByContainerAppCreateRequest(ctx context.Context, resourceGroupName string, containerAppName string, _ *ContainerAppsSourceControlsClientListByContainerAppOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -343,7 +326,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..13a198a97929 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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. @@ -77,7 +73,7 @@ func (client *DaprComponentsClient) CreateOrUpdate(ctx context.Context, resource } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DaprComponentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, componentName string, daprComponentEnvelope DaprComponent, options *DaprComponentsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DaprComponentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, componentName string, daprComponentEnvelope DaprComponent, _ *DaprComponentsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -100,7 +96,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 +117,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. @@ -148,7 +144,7 @@ func (client *DaprComponentsClient) Delete(ctx context.Context, resourceGroupNam } // deleteCreateRequest creates the Delete request. -func (client *DaprComponentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, componentName string, options *DaprComponentsClientDeleteOptions) (*policy.Request, error) { +func (client *DaprComponentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, componentName string, _ *DaprComponentsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -171,7 +167,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 +176,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. @@ -208,7 +204,7 @@ func (client *DaprComponentsClient) Get(ctx context.Context, resourceGroupName s } // getCreateRequest creates the Get request. -func (client *DaprComponentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, componentName string, options *DaprComponentsClientGetOptions) (*policy.Request, error) { +func (client *DaprComponentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, componentName string, _ *DaprComponentsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -231,7 +227,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 +244,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. @@ -276,7 +272,7 @@ func (client *DaprComponentsClient) NewListPager(resourceGroupName string, envir } // listCreateRequest creates the List request. -func (client *DaprComponentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *DaprComponentsClientListOptions) (*policy.Request, error) { +func (client *DaprComponentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, _ *DaprComponentsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -295,7 +291,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 +309,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. @@ -342,7 +338,7 @@ func (client *DaprComponentsClient) ListSecrets(ctx context.Context, resourceGro } // listSecretsCreateRequest creates the ListSecrets request. -func (client *DaprComponentsClient) listSecretsCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, componentName string, options *DaprComponentsClientListSecretsOptions) (*policy.Request, error) { +func (client *DaprComponentsClient) listSecretsCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, componentName string, _ *DaprComponentsClientListSecretsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/listSecrets" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -365,7 +361,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..f4cbd3292c20 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/availableworkloadprofiles_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/availableworkloadprofiles_server.go @@ -1,6 +1,3 @@ -//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. @@ -11,15 +8,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. @@ -54,21 +50,40 @@ func (a *AvailableWorkloadProfilesServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AvailableWorkloadProfilesClient.NewGetPager": - resp, err = a.dispatchNewGetPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AvailableWorkloadProfilesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if availableWorkloadProfilesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = availableWorkloadProfilesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AvailableWorkloadProfilesClient.NewGetPager": + res.resp, res.err = a.dispatchNewGetPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AvailableWorkloadProfilesServerTransport) dispatchNewGetPager(req *http.Request) (*http.Response, error) { @@ -107,3 +122,9 @@ func (a *AvailableWorkloadProfilesServerTransport) dispatchNewGetPager(req *http } return resp, nil } + +// set this to conditionally intercept incoming requests to AvailableWorkloadProfilesServerTransport +var availableWorkloadProfilesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/billingmeters_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/billingmeters_server.go index 3ec8c1e13e1c..282d4efddff5 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/billingmeters_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/billingmeters_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,14 +9,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. @@ -50,21 +46,40 @@ func (b *BillingMetersServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return b.dispatchToMethodFake(req, method) +} + +func (b *BillingMetersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - switch method { - case "BillingMetersClient.Get": - resp, err = b.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + go func() { + var intercepted bool + var res result + if billingMetersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = billingMetersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "BillingMetersClient.Get": + res.resp, res.err = b.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - if err != nil { - return nil, err - } + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() - return resp, nil + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (b *BillingMetersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -95,3 +110,9 @@ func (b *BillingMetersServerTransport) dispatchGet(req *http.Request) (*http.Res } return resp, nil } + +// set this to conditionally intercept incoming requests to BillingMetersServerTransport +var billingMetersServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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..76e03e8ecdf3 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/certificates_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/certificates_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,16 +9,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. @@ -72,29 +68,48 @@ func (c *CertificatesServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "CertificatesClient.CreateOrUpdate": - resp, err = c.dispatchCreateOrUpdate(req) - case "CertificatesClient.Delete": - resp, err = c.dispatchDelete(req) - case "CertificatesClient.Get": - resp, err = c.dispatchGet(req) - case "CertificatesClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - case "CertificatesClient.Update": - resp, err = c.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *CertificatesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if certificatesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = certificatesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CertificatesClient.CreateOrUpdate": + res.resp, res.err = c.dispatchCreateOrUpdate(req) + case "CertificatesClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "CertificatesClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CertificatesClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + case "CertificatesClient.Update": + res.resp, res.err = c.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CertificatesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -299,3 +314,9 @@ func (c *CertificatesServerTransport) dispatchUpdate(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to CertificatesServerTransport +var certificatesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironments_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironments_server.go index 3502eb18a3d4..d8726248969d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironments_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironments_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,15 +9,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. @@ -85,33 +81,52 @@ func (c *ConnectedEnvironmentsServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ConnectedEnvironmentsClient.CheckNameAvailability": - resp, err = c.dispatchCheckNameAvailability(req) - case "ConnectedEnvironmentsClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "ConnectedEnvironmentsClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "ConnectedEnvironmentsClient.Get": - resp, err = c.dispatchGet(req) - case "ConnectedEnvironmentsClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "ConnectedEnvironmentsClient.NewListBySubscriptionPager": - resp, err = c.dispatchNewListBySubscriptionPager(req) - case "ConnectedEnvironmentsClient.Update": - resp, err = c.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ConnectedEnvironmentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if connectedEnvironmentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = connectedEnvironmentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConnectedEnvironmentsClient.CheckNameAvailability": + res.resp, res.err = c.dispatchCheckNameAvailability(req) + case "ConnectedEnvironmentsClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "ConnectedEnvironmentsClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "ConnectedEnvironmentsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ConnectedEnvironmentsClient.NewListByResourceGroupPager": + res.resp, res.err = c.dispatchNewListByResourceGroupPager(req) + case "ConnectedEnvironmentsClient.NewListBySubscriptionPager": + res.resp, res.err = c.dispatchNewListBySubscriptionPager(req) + case "ConnectedEnvironmentsClient.Update": + res.resp, res.err = c.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ConnectedEnvironmentsServerTransport) dispatchCheckNameAvailability(req *http.Request) (*http.Response, error) { @@ -378,3 +393,9 @@ func (c *ConnectedEnvironmentsServerTransport) dispatchUpdate(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to ConnectedEnvironmentsServerTransport +var connectedEnvironmentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentscertificates_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentscertificates_server.go index 8d6c858ff015..0a54351733e9 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentscertificates_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentscertificates_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,22 +9,21 @@ 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. type ConnectedEnvironmentsCertificatesServer struct { // CreateOrUpdate is the fake for method ConnectedEnvironmentsCertificatesClient.CreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated CreateOrUpdate func(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, certificateName string, options *armappcontainers.ConnectedEnvironmentsCertificatesClientCreateOrUpdateOptions) (resp azfake.Responder[armappcontainers.ConnectedEnvironmentsCertificatesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // Delete is the fake for method ConnectedEnvironmentsCertificatesClient.Delete @@ -72,29 +68,48 @@ func (c *ConnectedEnvironmentsCertificatesServerTransport) Do(req *http.Request) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ConnectedEnvironmentsCertificatesClient.CreateOrUpdate": - resp, err = c.dispatchCreateOrUpdate(req) - case "ConnectedEnvironmentsCertificatesClient.Delete": - resp, err = c.dispatchDelete(req) - case "ConnectedEnvironmentsCertificatesClient.Get": - resp, err = c.dispatchGet(req) - case "ConnectedEnvironmentsCertificatesClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - case "ConnectedEnvironmentsCertificatesClient.Update": - resp, err = c.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ConnectedEnvironmentsCertificatesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if connectedEnvironmentsCertificatesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = connectedEnvironmentsCertificatesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConnectedEnvironmentsCertificatesClient.CreateOrUpdate": + res.resp, res.err = c.dispatchCreateOrUpdate(req) + case "ConnectedEnvironmentsCertificatesClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "ConnectedEnvironmentsCertificatesClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ConnectedEnvironmentsCertificatesClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + case "ConnectedEnvironmentsCertificatesClient.Update": + res.resp, res.err = c.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ConnectedEnvironmentsCertificatesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -134,8 +149,8 @@ func (c *ConnectedEnvironmentsCertificatesServerTransport) dispatchCreateOrUpdat 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)} + 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).Certificate, req) if err != nil { @@ -299,3 +314,9 @@ func (c *ConnectedEnvironmentsCertificatesServerTransport) dispatchUpdate(req *h } return resp, nil } + +// set this to conditionally intercept incoming requests to ConnectedEnvironmentsCertificatesServerTransport +var connectedEnvironmentsCertificatesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsdaprcomponents_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsdaprcomponents_server.go index 26fa054b179f..e3f2375820f1 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsdaprcomponents_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsdaprcomponents_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,15 +9,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. @@ -42,7 +38,7 @@ type ConnectedEnvironmentsDaprComponentsServer struct { NewListPager func(resourceGroupName string, connectedEnvironmentName string, options *armappcontainers.ConnectedEnvironmentsDaprComponentsClientListOptions) (resp azfake.PagerResponder[armappcontainers.ConnectedEnvironmentsDaprComponentsClientListResponse]) // ListSecrets is the fake for method ConnectedEnvironmentsDaprComponentsClient.ListSecrets - // HTTP status codes to indicate success: http.StatusOK + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated ListSecrets func(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, options *armappcontainers.ConnectedEnvironmentsDaprComponentsClientListSecretsOptions) (resp azfake.Responder[armappcontainers.ConnectedEnvironmentsDaprComponentsClientListSecretsResponse], errResp azfake.ErrorResponder) } @@ -71,29 +67,48 @@ func (c *ConnectedEnvironmentsDaprComponentsServerTransport) Do(req *http.Reques return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ConnectedEnvironmentsDaprComponentsClient.CreateOrUpdate": - resp, err = c.dispatchCreateOrUpdate(req) - case "ConnectedEnvironmentsDaprComponentsClient.Delete": - resp, err = c.dispatchDelete(req) - case "ConnectedEnvironmentsDaprComponentsClient.Get": - resp, err = c.dispatchGet(req) - case "ConnectedEnvironmentsDaprComponentsClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - case "ConnectedEnvironmentsDaprComponentsClient.ListSecrets": - resp, err = c.dispatchListSecrets(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ConnectedEnvironmentsDaprComponentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if connectedEnvironmentsDaprComponentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = connectedEnvironmentsDaprComponentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConnectedEnvironmentsDaprComponentsClient.CreateOrUpdate": + res.resp, res.err = c.dispatchCreateOrUpdate(req) + case "ConnectedEnvironmentsDaprComponentsClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "ConnectedEnvironmentsDaprComponentsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ConnectedEnvironmentsDaprComponentsClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + case "ConnectedEnvironmentsDaprComponentsClient.ListSecrets": + res.resp, res.err = c.dispatchListSecrets(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ConnectedEnvironmentsDaprComponentsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -279,8 +294,8 @@ func (c *ConnectedEnvironmentsDaprComponentsServerTransport) dispatchListSecrets 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)} + 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).DaprSecretsCollection, req) if err != nil { @@ -288,3 +303,9 @@ func (c *ConnectedEnvironmentsDaprComponentsServerTransport) dispatchListSecrets } return resp, nil } + +// set this to conditionally intercept incoming requests to ConnectedEnvironmentsDaprComponentsServerTransport +var connectedEnvironmentsDaprComponentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsstorages_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsstorages_server.go index 87a61a5c2952..1f3790ba9e4c 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsstorages_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/connectedenvironmentsstorages_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,20 +9,19 @@ 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. type ConnectedEnvironmentsStoragesServer struct { // CreateOrUpdate is the fake for method ConnectedEnvironmentsStoragesClient.CreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated CreateOrUpdate func(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, storageName string, storageEnvelope armappcontainers.ConnectedEnvironmentStorage, options *armappcontainers.ConnectedEnvironmentsStoragesClientCreateOrUpdateOptions) (resp azfake.Responder[armappcontainers.ConnectedEnvironmentsStoragesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // Delete is the fake for method ConnectedEnvironmentsStoragesClient.Delete @@ -62,27 +58,46 @@ func (c *ConnectedEnvironmentsStoragesServerTransport) Do(req *http.Request) (*h return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ConnectedEnvironmentsStoragesClient.CreateOrUpdate": - resp, err = c.dispatchCreateOrUpdate(req) - case "ConnectedEnvironmentsStoragesClient.Delete": - resp, err = c.dispatchDelete(req) - case "ConnectedEnvironmentsStoragesClient.Get": - resp, err = c.dispatchGet(req) - case "ConnectedEnvironmentsStoragesClient.List": - resp, err = c.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return c.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (c *ConnectedEnvironmentsStoragesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if connectedEnvironmentsStoragesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = connectedEnvironmentsStoragesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConnectedEnvironmentsStoragesClient.CreateOrUpdate": + res.resp, res.err = c.dispatchCreateOrUpdate(req) + case "ConnectedEnvironmentsStoragesClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "ConnectedEnvironmentsStoragesClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ConnectedEnvironmentsStoragesClient.List": + res.resp, res.err = c.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (c *ConnectedEnvironmentsStoragesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -116,8 +131,8 @@ func (c *ConnectedEnvironmentsStoragesServerTransport) dispatchCreateOrUpdate(re 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)} + 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).ConnectedEnvironmentStorage, req) if err != nil { @@ -232,3 +247,9 @@ func (c *ConnectedEnvironmentsStoragesServerTransport) dispatchList(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to ConnectedEnvironmentsStoragesServerTransport +var connectedEnvironmentsStoragesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerapps_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerapps_server.go index 66764ff84795..c88b43c73001 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerapps_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerapps_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,15 +9,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. @@ -107,41 +103,60 @@ func (c *ContainerAppsServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ContainerAppsClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "ContainerAppsClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "ContainerAppsClient.Get": - resp, err = c.dispatchGet(req) - case "ContainerAppsClient.GetAuthToken": - resp, err = c.dispatchGetAuthToken(req) - case "ContainerAppsClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "ContainerAppsClient.NewListBySubscriptionPager": - resp, err = c.dispatchNewListBySubscriptionPager(req) - case "ContainerAppsClient.ListCustomHostNameAnalysis": - resp, err = c.dispatchListCustomHostNameAnalysis(req) - case "ContainerAppsClient.ListSecrets": - resp, err = c.dispatchListSecrets(req) - case "ContainerAppsClient.BeginStart": - resp, err = c.dispatchBeginStart(req) - case "ContainerAppsClient.BeginStop": - resp, err = c.dispatchBeginStop(req) - case "ContainerAppsClient.BeginUpdate": - resp, err = c.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return c.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (c *ContainerAppsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if containerAppsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = containerAppsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ContainerAppsClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "ContainerAppsClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "ContainerAppsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ContainerAppsClient.GetAuthToken": + res.resp, res.err = c.dispatchGetAuthToken(req) + case "ContainerAppsClient.NewListByResourceGroupPager": + res.resp, res.err = c.dispatchNewListByResourceGroupPager(req) + case "ContainerAppsClient.NewListBySubscriptionPager": + res.resp, res.err = c.dispatchNewListBySubscriptionPager(req) + case "ContainerAppsClient.ListCustomHostNameAnalysis": + res.resp, res.err = c.dispatchListCustomHostNameAnalysis(req) + case "ContainerAppsClient.ListSecrets": + res.resp, res.err = c.dispatchListSecrets(req) + case "ContainerAppsClient.BeginStart": + res.resp, res.err = c.dispatchBeginStart(req) + case "ContainerAppsClient.BeginStop": + res.resp, res.err = c.dispatchBeginStop(req) + case "ContainerAppsClient.BeginUpdate": + res.resp, res.err = c.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ContainerAppsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -585,3 +600,9 @@ func (c *ContainerAppsServerTransport) dispatchBeginUpdate(req *http.Request) (* return resp, nil } + +// set this to conditionally intercept incoming requests to ContainerAppsServerTransport +var containerAppsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsapi_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsapi_server.go index 84cf870fcb4f..1abd2689476a 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsapi_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsapi_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,14 +9,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. @@ -54,23 +50,42 @@ func (c *ContainerAppsAPIServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} + +func (c *ContainerAppsAPIServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - switch method { - case "ContainerAppsAPIClient.GetCustomDomainVerificationID": - resp, err = c.dispatchGetCustomDomainVerificationID(req) - case "ContainerAppsAPIClient.JobExecution": - resp, err = c.dispatchJobExecution(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + go func() { + var intercepted bool + var res result + if containerAppsApiServerTransportInterceptor != nil { + res.resp, res.err, intercepted = containerAppsApiServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ContainerAppsAPIClient.GetCustomDomainVerificationID": + res.resp, res.err = c.dispatchGetCustomDomainVerificationID(req) + case "ContainerAppsAPIClient.JobExecution": + res.resp, res.err = c.dispatchJobExecution(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - if err != nil { - return nil, err - } + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() - return resp, nil + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ContainerAppsAPIServerTransport) dispatchGetCustomDomainVerificationID(req *http.Request) (*http.Response, error) { @@ -134,3 +149,9 @@ func (c *ContainerAppsAPIServerTransport) dispatchJobExecution(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to ContainerAppsAPIServerTransport +var containerAppsApiServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsauthconfigs_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsauthconfigs_server.go index 31ff382f8d88..d4459c20dfa2 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsauthconfigs_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsauthconfigs_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,15 +9,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. @@ -67,27 +63,46 @@ func (c *ContainerAppsAuthConfigsServerTransport) Do(req *http.Request) (*http.R return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ContainerAppsAuthConfigsClient.CreateOrUpdate": - resp, err = c.dispatchCreateOrUpdate(req) - case "ContainerAppsAuthConfigsClient.Delete": - resp, err = c.dispatchDelete(req) - case "ContainerAppsAuthConfigsClient.Get": - resp, err = c.dispatchGet(req) - case "ContainerAppsAuthConfigsClient.NewListByContainerAppPager": - resp, err = c.dispatchNewListByContainerAppPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ContainerAppsAuthConfigsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if containerAppsAuthConfigsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = containerAppsAuthConfigsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ContainerAppsAuthConfigsClient.CreateOrUpdate": + res.resp, res.err = c.dispatchCreateOrUpdate(req) + case "ContainerAppsAuthConfigsClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "ContainerAppsAuthConfigsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ContainerAppsAuthConfigsClient.NewListByContainerAppPager": + res.resp, res.err = c.dispatchNewListByContainerAppPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ContainerAppsAuthConfigsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -245,3 +260,9 @@ func (c *ContainerAppsAuthConfigsServerTransport) dispatchNewListByContainerAppP } return resp, nil } + +// set this to conditionally intercept incoming requests to ContainerAppsAuthConfigsServerTransport +var containerAppsAuthConfigsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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..8310c27346f1 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsdiagnostics_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsdiagnostics_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,15 +9,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. @@ -73,29 +69,48 @@ func (c *ContainerAppsDiagnosticsServerTransport) Do(req *http.Request) (*http.R return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ContainerAppsDiagnosticsClient.GetDetector": - resp, err = c.dispatchGetDetector(req) - case "ContainerAppsDiagnosticsClient.GetRevision": - resp, err = c.dispatchGetRevision(req) - case "ContainerAppsDiagnosticsClient.GetRoot": - resp, err = c.dispatchGetRoot(req) - case "ContainerAppsDiagnosticsClient.NewListDetectorsPager": - resp, err = c.dispatchNewListDetectorsPager(req) - case "ContainerAppsDiagnosticsClient.NewListRevisionsPager": - resp, err = c.dispatchNewListRevisionsPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ContainerAppsDiagnosticsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if containerAppsDiagnosticsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = containerAppsDiagnosticsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ContainerAppsDiagnosticsClient.GetDetector": + res.resp, res.err = c.dispatchGetDetector(req) + case "ContainerAppsDiagnosticsClient.GetRevision": + res.resp, res.err = c.dispatchGetRevision(req) + case "ContainerAppsDiagnosticsClient.GetRoot": + res.resp, res.err = c.dispatchGetRoot(req) + case "ContainerAppsDiagnosticsClient.NewListDetectorsPager": + res.resp, res.err = c.dispatchNewListDetectorsPager(req) + case "ContainerAppsDiagnosticsClient.NewListRevisionsPager": + res.resp, res.err = c.dispatchNewListRevisionsPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ContainerAppsDiagnosticsServerTransport) dispatchGetDetector(req *http.Request) (*http.Response, error) { @@ -298,3 +313,9 @@ func (c *ContainerAppsDiagnosticsServerTransport) dispatchNewListRevisionsPager( } return resp, nil } + +// set this to conditionally intercept incoming requests to ContainerAppsDiagnosticsServerTransport +var containerAppsDiagnosticsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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..188e81872cc3 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisionreplicas_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisionreplicas_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,14 +9,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. @@ -54,23 +50,42 @@ func (c *ContainerAppsRevisionReplicasServerTransport) Do(req *http.Request) (*h return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} + +func (c *ContainerAppsRevisionReplicasServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - switch method { - case "ContainerAppsRevisionReplicasClient.GetReplica": - resp, err = c.dispatchGetReplica(req) - case "ContainerAppsRevisionReplicasClient.ListReplicas": - resp, err = c.dispatchListReplicas(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + go func() { + var intercepted bool + var res result + if containerAppsRevisionReplicasServerTransportInterceptor != nil { + res.resp, res.err, intercepted = containerAppsRevisionReplicasServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ContainerAppsRevisionReplicasClient.GetReplica": + res.resp, res.err = c.dispatchGetReplica(req) + case "ContainerAppsRevisionReplicasClient.ListReplicas": + res.resp, res.err = c.dispatchListReplicas(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - if err != nil { - return nil, err - } + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() - return resp, nil + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ContainerAppsRevisionReplicasServerTransport) dispatchGetReplica(req *http.Request) (*http.Response, error) { @@ -150,3 +165,9 @@ func (c *ContainerAppsRevisionReplicasServerTransport) dispatchListReplicas(req } return resp, nil } + +// set this to conditionally intercept incoming requests to ContainerAppsRevisionReplicasServerTransport +var containerAppsRevisionReplicasServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisions_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisions_server.go index 25666dad3ace..043afad876f7 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisions_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappsrevisions_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,15 +9,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. @@ -71,29 +67,48 @@ func (c *ContainerAppsRevisionsServerTransport) Do(req *http.Request) (*http.Res return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ContainerAppsRevisionsClient.ActivateRevision": - resp, err = c.dispatchActivateRevision(req) - case "ContainerAppsRevisionsClient.DeactivateRevision": - resp, err = c.dispatchDeactivateRevision(req) - case "ContainerAppsRevisionsClient.GetRevision": - resp, err = c.dispatchGetRevision(req) - case "ContainerAppsRevisionsClient.NewListRevisionsPager": - resp, err = c.dispatchNewListRevisionsPager(req) - case "ContainerAppsRevisionsClient.RestartRevision": - resp, err = c.dispatchRestartRevision(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ContainerAppsRevisionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if containerAppsRevisionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = containerAppsRevisionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ContainerAppsRevisionsClient.ActivateRevision": + res.resp, res.err = c.dispatchActivateRevision(req) + case "ContainerAppsRevisionsClient.DeactivateRevision": + res.resp, res.err = c.dispatchDeactivateRevision(req) + case "ContainerAppsRevisionsClient.GetRevision": + res.resp, res.err = c.dispatchGetRevision(req) + case "ContainerAppsRevisionsClient.NewListRevisionsPager": + res.resp, res.err = c.dispatchNewListRevisionsPager(req) + case "ContainerAppsRevisionsClient.RestartRevision": + res.resp, res.err = c.dispatchRestartRevision(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ContainerAppsRevisionsServerTransport) dispatchActivateRevision(req *http.Request) (*http.Response, error) { @@ -296,3 +311,9 @@ func (c *ContainerAppsRevisionsServerTransport) dispatchRestartRevision(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to ContainerAppsRevisionsServerTransport +var containerAppsRevisionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssessionpools_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssessionpools_server.go index c69f07f68dae..c41a11730aec 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssessionpools_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssessionpools_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,15 +9,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" ) // ContainerAppsSessionPoolsServer is a fake server for instances of the armappcontainers.ContainerAppsSessionPoolsClient type. @@ -30,7 +26,7 @@ type ContainerAppsSessionPoolsServer struct { 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 + // HTTP status codes to indicate success: http.StatusOK, 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 @@ -83,31 +79,50 @@ func (c *ContainerAppsSessionPoolsServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - 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) - } +func (c *ContainerAppsSessionPoolsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if containerAppsSessionPoolsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = containerAppsSessionPoolsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ContainerAppsSessionPoolsClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "ContainerAppsSessionPoolsClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "ContainerAppsSessionPoolsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ContainerAppsSessionPoolsClient.NewListByResourceGroupPager": + res.resp, res.err = c.dispatchNewListByResourceGroupPager(req) + case "ContainerAppsSessionPoolsClient.NewListBySubscriptionPager": + res.resp, res.err = c.dispatchNewListBySubscriptionPager(req) + case "ContainerAppsSessionPoolsClient.BeginUpdate": + res.resp, res.err = c.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ContainerAppsSessionPoolsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -191,9 +206,9 @@ func (c *ContainerAppsSessionPoolsServerTransport) dispatchBeginDelete(req *http return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, 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)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { c.beginDelete.remove(req) @@ -352,3 +367,9 @@ func (c *ContainerAppsSessionPoolsServerTransport) dispatchBeginUpdate(req *http return resp, nil } + +// set this to conditionally intercept incoming requests to ContainerAppsSessionPoolsServerTransport +var containerAppsSessionPoolsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssourcecontrols_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssourcecontrols_server.go index 4befa944532d..e27d036405af 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssourcecontrols_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/containerappssourcecontrols_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,16 +9,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. @@ -72,27 +67,46 @@ func (c *ContainerAppsSourceControlsServerTransport) Do(req *http.Request) (*htt return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ContainerAppsSourceControlsClient.BeginCreateOrUpdate": - resp, err = c.dispatchBeginCreateOrUpdate(req) - case "ContainerAppsSourceControlsClient.BeginDelete": - resp, err = c.dispatchBeginDelete(req) - case "ContainerAppsSourceControlsClient.Get": - resp, err = c.dispatchGet(req) - case "ContainerAppsSourceControlsClient.NewListByContainerAppPager": - resp, err = c.dispatchNewListByContainerAppPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ContainerAppsSourceControlsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if containerAppsSourceControlsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = containerAppsSourceControlsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ContainerAppsSourceControlsClient.BeginCreateOrUpdate": + res.resp, res.err = c.dispatchBeginCreateOrUpdate(req) + case "ContainerAppsSourceControlsClient.BeginDelete": + res.resp, res.err = c.dispatchBeginDelete(req) + case "ContainerAppsSourceControlsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ContainerAppsSourceControlsClient.NewListByContainerAppPager": + res.resp, res.err = c.dispatchNewListByContainerAppPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ContainerAppsSourceControlsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -123,14 +137,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 +173,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 +185,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 } @@ -305,3 +286,9 @@ func (c *ContainerAppsSourceControlsServerTransport) dispatchNewListByContainerA } return resp, nil } + +// set this to conditionally intercept incoming requests to ContainerAppsSourceControlsServerTransport +var containerAppsSourceControlsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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..8374166fac5c 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/daprcomponents_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/daprcomponents_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,15 +9,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. @@ -71,29 +67,48 @@ func (d *DaprComponentsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DaprComponentsClient.CreateOrUpdate": - resp, err = d.dispatchCreateOrUpdate(req) - case "DaprComponentsClient.Delete": - resp, err = d.dispatchDelete(req) - case "DaprComponentsClient.Get": - resp, err = d.dispatchGet(req) - case "DaprComponentsClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - case "DaprComponentsClient.ListSecrets": - resp, err = d.dispatchListSecrets(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DaprComponentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if daprComponentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = daprComponentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DaprComponentsClient.CreateOrUpdate": + res.resp, res.err = d.dispatchCreateOrUpdate(req) + case "DaprComponentsClient.Delete": + res.resp, res.err = d.dispatchDelete(req) + case "DaprComponentsClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DaprComponentsClient.NewListPager": + res.resp, res.err = d.dispatchNewListPager(req) + case "DaprComponentsClient.ListSecrets": + res.resp, res.err = d.dispatchListSecrets(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DaprComponentsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -288,3 +303,9 @@ func (d *DaprComponentsServerTransport) dispatchListSecrets(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to DaprComponentsServerTransport +var daprComponentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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..486a30a014e6 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/internal.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/internal.go @@ -1,6 +1,3 @@ -//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. @@ -9,13 +6,17 @@ 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 result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } @@ -33,14 +34,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 +41,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 index fe84627587a3..4b81acad9194 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/javacomponents_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/javacomponents_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,15 +9,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" ) // JavaComponentsServer is a fake server for instances of the armappcontainers.JavaComponentsClient type. @@ -30,7 +26,7 @@ type JavaComponentsServer struct { 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 + // HTTP status codes to indicate success: http.StatusOK, 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 @@ -77,29 +73,48 @@ func (j *JavaComponentsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return j.dispatchToMethodFake(req, method) +} - 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) - } +func (j *JavaComponentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if javaComponentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = javaComponentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "JavaComponentsClient.BeginCreateOrUpdate": + res.resp, res.err = j.dispatchBeginCreateOrUpdate(req) + case "JavaComponentsClient.BeginDelete": + res.resp, res.err = j.dispatchBeginDelete(req) + case "JavaComponentsClient.Get": + res.resp, res.err = j.dispatchGet(req) + case "JavaComponentsClient.NewListPager": + res.resp, res.err = j.dispatchNewListPager(req) + case "JavaComponentsClient.BeginUpdate": + res.resp, res.err = j.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (j *JavaComponentsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -191,9 +206,9 @@ func (j *JavaComponentsServerTransport) dispatchBeginDelete(req *http.Request) ( return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + if !contains([]int{http.StatusOK, 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)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { j.beginDelete.remove(req) @@ -331,3 +346,9 @@ func (j *JavaComponentsServerTransport) dispatchBeginUpdate(req *http.Request) ( return resp, nil } + +// set this to conditionally intercept incoming requests to JavaComponentsServerTransport +var javaComponentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobs_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobs_server.go index 6813d1e1115c..37fc112989fa 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobs_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobs_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,16 +9,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,26 +58,18 @@ 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) // BeginStopExecution is the fake for method JobsClient.BeginStopExecution - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginStopExecution func(ctx context.Context, resourceGroupName string, jobName string, jobExecutionName string, options *armappcontainers.JobsClientBeginStopExecutionOptions) (resp azfake.PollerResponder[armappcontainers.JobsClientStopExecutionResponse], errResp azfake.ErrorResponder) // BeginStopMultipleExecutions is the fake for method JobsClient.BeginStopMultipleExecutions // 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 +86,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 +102,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]] } @@ -132,49 +116,64 @@ func (j *JobsServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "JobsClient.BeginCreateOrUpdate": - resp, err = j.dispatchBeginCreateOrUpdate(req) - case "JobsClient.BeginDelete": - resp, err = j.dispatchBeginDelete(req) - case "JobsClient.Get": - resp, err = j.dispatchGet(req) - case "JobsClient.GetDetector": - resp, err = j.dispatchGetDetector(req) - case "JobsClient.NewListByResourceGroupPager": - resp, err = j.dispatchNewListByResourceGroupPager(req) - case "JobsClient.NewListBySubscriptionPager": - resp, err = j.dispatchNewListBySubscriptionPager(req) - case "JobsClient.NewListDetectorsPager": - resp, err = j.dispatchNewListDetectorsPager(req) - case "JobsClient.ListSecrets": - 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: - err = fmt.Errorf("unhandled API %s", method) - } + return j.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (j *JobsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if jobsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = jobsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "JobsClient.BeginCreateOrUpdate": + res.resp, res.err = j.dispatchBeginCreateOrUpdate(req) + case "JobsClient.BeginDelete": + res.resp, res.err = j.dispatchBeginDelete(req) + case "JobsClient.Get": + res.resp, res.err = j.dispatchGet(req) + case "JobsClient.GetDetector": + res.resp, res.err = j.dispatchGetDetector(req) + case "JobsClient.NewListByResourceGroupPager": + res.resp, res.err = j.dispatchNewListByResourceGroupPager(req) + case "JobsClient.NewListBySubscriptionPager": + res.resp, res.err = j.dispatchNewListBySubscriptionPager(req) + case "JobsClient.NewListDetectorsPager": + res.resp, res.err = j.dispatchNewListDetectorsPager(req) + case "JobsClient.ListSecrets": + res.resp, res.err = j.dispatchListSecrets(req) + case "JobsClient.ProxyGet": + res.resp, res.err = j.dispatchProxyGet(req) + case "JobsClient.BeginStart": + res.resp, res.err = j.dispatchBeginStart(req) + case "JobsClient.BeginStopExecution": + res.resp, res.err = j.dispatchBeginStopExecution(req) + case "JobsClient.BeginStopMultipleExecutions": + res.resp, res.err = j.dispatchBeginStopMultipleExecutions(req) + case "JobsClient.BeginUpdate": + res.resp, res.err = j.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (j *JobsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -520,50 +519,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")} @@ -655,9 +610,9 @@ func (j *JobsServerTransport) dispatchBeginStopExecution(req *http.Request) (*ht return nil, err } - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { j.beginStopExecution.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginStopExecution) { j.beginStopExecution.remove(req) @@ -710,50 +665,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")} @@ -801,3 +712,9 @@ func (j *JobsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Resp return resp, nil } + +// set this to conditionally intercept incoming requests to JobsServerTransport +var jobsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobsexecutions_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobsexecutions_server.go index 819baaab8e17..933778d465cc 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobsexecutions_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/jobsexecutions_server.go @@ -1,6 +1,3 @@ -//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. @@ -11,15 +8,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. @@ -54,21 +50,40 @@ func (j *JobsExecutionsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return j.dispatchToMethodFake(req, method) +} - switch method { - case "JobsExecutionsClient.NewListPager": - resp, err = j.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (j *JobsExecutionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if jobsExecutionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = jobsExecutionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "JobsExecutionsClient.NewListPager": + res.resp, res.err = j.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (j *JobsExecutionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -123,3 +138,9 @@ func (j *JobsExecutionsServerTransport) dispatchNewListPager(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to JobsExecutionsServerTransport +var jobsExecutionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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..a868cdde22a3 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedcertificates_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedcertificates_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,16 +9,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. @@ -74,29 +70,48 @@ func (m *ManagedCertificatesServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagedCertificatesClient.BeginCreateOrUpdate": - resp, err = m.dispatchBeginCreateOrUpdate(req) - case "ManagedCertificatesClient.Delete": - resp, err = m.dispatchDelete(req) - case "ManagedCertificatesClient.Get": - resp, err = m.dispatchGet(req) - case "ManagedCertificatesClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - case "ManagedCertificatesClient.Update": - resp, err = m.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagedCertificatesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managedCertificatesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedCertificatesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedCertificatesClient.BeginCreateOrUpdate": + res.resp, res.err = m.dispatchBeginCreateOrUpdate(req) + case "ManagedCertificatesClient.Delete": + res.resp, res.err = m.dispatchDelete(req) + case "ManagedCertificatesClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "ManagedCertificatesClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + case "ManagedCertificatesClient.Update": + res.resp, res.err = m.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagedCertificatesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -312,3 +327,9 @@ func (m *ManagedCertificatesServerTransport) dispatchUpdate(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedCertificatesServerTransport +var managedCertificatesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentdiagnostics_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentdiagnostics_server.go index 416184a99668..a76cfda6220b 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentdiagnostics_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentdiagnostics_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,14 +9,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. @@ -54,23 +50,42 @@ func (m *ManagedEnvironmentDiagnosticsServerTransport) Do(req *http.Request) (*h return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} + +func (m *ManagedEnvironmentDiagnosticsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - switch method { - case "ManagedEnvironmentDiagnosticsClient.GetDetector": - resp, err = m.dispatchGetDetector(req) - case "ManagedEnvironmentDiagnosticsClient.ListDetectors": - resp, err = m.dispatchListDetectors(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + go func() { + var intercepted bool + var res result + if managedEnvironmentDiagnosticsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedEnvironmentDiagnosticsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedEnvironmentDiagnosticsClient.GetDetector": + res.resp, res.err = m.dispatchGetDetector(req) + case "ManagedEnvironmentDiagnosticsClient.ListDetectors": + res.resp, res.err = m.dispatchListDetectors(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - if err != nil { - return nil, err - } + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() - return resp, nil + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagedEnvironmentDiagnosticsServerTransport) dispatchGetDetector(req *http.Request) (*http.Response, error) { @@ -142,3 +157,9 @@ func (m *ManagedEnvironmentDiagnosticsServerTransport) dispatchListDetectors(req } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedEnvironmentDiagnosticsServerTransport +var managedEnvironmentDiagnosticsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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..0cceab0eb680 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironments_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironments_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,15 +9,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. @@ -93,35 +89,54 @@ func (m *ManagedEnvironmentsServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ManagedEnvironmentsClient.BeginCreateOrUpdate": - resp, err = m.dispatchBeginCreateOrUpdate(req) - case "ManagedEnvironmentsClient.BeginDelete": - resp, err = m.dispatchBeginDelete(req) - case "ManagedEnvironmentsClient.Get": - resp, err = m.dispatchGet(req) - case "ManagedEnvironmentsClient.GetAuthToken": - resp, err = m.dispatchGetAuthToken(req) - case "ManagedEnvironmentsClient.NewListByResourceGroupPager": - resp, err = m.dispatchNewListByResourceGroupPager(req) - case "ManagedEnvironmentsClient.NewListBySubscriptionPager": - resp, err = m.dispatchNewListBySubscriptionPager(req) - case "ManagedEnvironmentsClient.NewListWorkloadProfileStatesPager": - resp, err = m.dispatchNewListWorkloadProfileStatesPager(req) - case "ManagedEnvironmentsClient.BeginUpdate": - resp, err = m.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return m.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (m *ManagedEnvironmentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if managedEnvironmentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedEnvironmentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedEnvironmentsClient.BeginCreateOrUpdate": + res.resp, res.err = m.dispatchBeginCreateOrUpdate(req) + case "ManagedEnvironmentsClient.BeginDelete": + res.resp, res.err = m.dispatchBeginDelete(req) + case "ManagedEnvironmentsClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "ManagedEnvironmentsClient.GetAuthToken": + res.resp, res.err = m.dispatchGetAuthToken(req) + case "ManagedEnvironmentsClient.NewListByResourceGroupPager": + res.resp, res.err = m.dispatchNewListByResourceGroupPager(req) + case "ManagedEnvironmentsClient.NewListBySubscriptionPager": + res.resp, res.err = m.dispatchNewListBySubscriptionPager(req) + case "ManagedEnvironmentsClient.NewListWorkloadProfileStatesPager": + res.resp, res.err = m.dispatchNewListWorkloadProfileStatesPager(req) + case "ManagedEnvironmentsClient.BeginUpdate": + res.resp, res.err = m.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagedEnvironmentsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -440,3 +455,9 @@ func (m *ManagedEnvironmentsServerTransport) dispatchBeginUpdate(req *http.Reque return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedEnvironmentsServerTransport +var managedEnvironmentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsdiagnostics_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsdiagnostics_server.go index 00843cabb2fc..b014760c23ca 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsdiagnostics_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsdiagnostics_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,14 +9,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. @@ -50,21 +46,40 @@ func (m *ManagedEnvironmentsDiagnosticsServerTransport) Do(req *http.Request) (* return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} + +func (m *ManagedEnvironmentsDiagnosticsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - switch method { - case "ManagedEnvironmentsDiagnosticsClient.GetRoot": - resp, err = m.dispatchGetRoot(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + go func() { + var intercepted bool + var res result + if managedEnvironmentsDiagnosticsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedEnvironmentsDiagnosticsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedEnvironmentsDiagnosticsClient.GetRoot": + res.resp, res.err = m.dispatchGetRoot(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - if err != nil { - return nil, err - } + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() - return resp, nil + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagedEnvironmentsDiagnosticsServerTransport) dispatchGetRoot(req *http.Request) (*http.Response, error) { @@ -99,3 +114,9 @@ func (m *ManagedEnvironmentsDiagnosticsServerTransport) dispatchGetRoot(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedEnvironmentsDiagnosticsServerTransport +var managedEnvironmentsDiagnosticsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsstorages_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsstorages_server.go index c92629c5f94d..c70e80bceb5e 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsstorages_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentsstorages_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,14 +9,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. @@ -62,27 +58,46 @@ func (m *ManagedEnvironmentsStoragesServerTransport) Do(req *http.Request) (*htt return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ManagedEnvironmentsStoragesClient.CreateOrUpdate": - resp, err = m.dispatchCreateOrUpdate(req) - case "ManagedEnvironmentsStoragesClient.Delete": - resp, err = m.dispatchDelete(req) - case "ManagedEnvironmentsStoragesClient.Get": - resp, err = m.dispatchGet(req) - case "ManagedEnvironmentsStoragesClient.List": - resp, err = m.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return m.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (m *ManagedEnvironmentsStoragesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if managedEnvironmentsStoragesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedEnvironmentsStoragesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedEnvironmentsStoragesClient.CreateOrUpdate": + res.resp, res.err = m.dispatchCreateOrUpdate(req) + case "ManagedEnvironmentsStoragesClient.Delete": + res.resp, res.err = m.dispatchDelete(req) + case "ManagedEnvironmentsStoragesClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "ManagedEnvironmentsStoragesClient.List": + res.resp, res.err = m.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (m *ManagedEnvironmentsStoragesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -232,3 +247,9 @@ func (m *ManagedEnvironmentsStoragesServerTransport) dispatchList(req *http.Requ } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedEnvironmentsStoragesServerTransport +var managedEnvironmentsStoragesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentusages_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentusages_server.go index 68957de1289d..eedb5c7f8ef1 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentusages_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/managedenvironmentusages_server.go @@ -1,6 +1,3 @@ -//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. @@ -11,15 +8,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. @@ -54,21 +50,40 @@ func (m *ManagedEnvironmentUsagesServerTransport) Do(req *http.Request) (*http.R return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagedEnvironmentUsagesClient.NewListPager": - resp, err = m.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagedEnvironmentUsagesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managedEnvironmentUsagesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managedEnvironmentUsagesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagedEnvironmentUsagesClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagedEnvironmentUsagesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -111,3 +126,9 @@ func (m *ManagedEnvironmentUsagesServerTransport) dispatchNewListPager(req *http } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagedEnvironmentUsagesServerTransport +var managedEnvironmentUsagesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/namespaces_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/namespaces_server.go index 01944a7af0fa..1877e4511cc9 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/namespaces_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/namespaces_server.go @@ -1,6 +1,3 @@ -//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. @@ -12,14 +9,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. @@ -50,21 +46,40 @@ func (n *NamespacesServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return n.dispatchToMethodFake(req, method) +} + +func (n *NamespacesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - switch method { - case "NamespacesClient.CheckNameAvailability": - resp, err = n.dispatchCheckNameAvailability(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + go func() { + var intercepted bool + var res result + if namespacesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = namespacesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "NamespacesClient.CheckNameAvailability": + res.resp, res.err = n.dispatchCheckNameAvailability(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - if err != nil { - return nil, err - } + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() - return resp, nil + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (n *NamespacesServerTransport) dispatchCheckNameAvailability(req *http.Request) (*http.Response, error) { @@ -103,3 +118,9 @@ func (n *NamespacesServerTransport) dispatchCheckNameAvailability(req *http.Requ } return resp, nil } + +// set this to conditionally intercept incoming requests to NamespacesServerTransport +var namespacesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/operations_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/operations_server.go index 4d523d2865f0..c66bb6751348 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/operations_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/operations_server.go @@ -1,6 +1,3 @@ -//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. @@ -11,13 +8,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. @@ -52,21 +48,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -95,3 +110,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/server_factory.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/server_factory.go index 2dff12086ed7..689c356cfaf1 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/server_factory.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/server_factory.go @@ -1,6 +1,3 @@ -//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. @@ -11,58 +8,97 @@ 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 contains the fakes for client AvailableWorkloadProfilesClient + AvailableWorkloadProfilesServer AvailableWorkloadProfilesServer + + // BillingMetersServer contains the fakes for client BillingMetersClient + BillingMetersServer BillingMetersServer + + // CertificatesServer contains the fakes for client CertificatesClient + CertificatesServer CertificatesServer + + // ConnectedEnvironmentsCertificatesServer contains the fakes for client ConnectedEnvironmentsCertificatesClient + ConnectedEnvironmentsCertificatesServer ConnectedEnvironmentsCertificatesServer + + // ConnectedEnvironmentsServer contains the fakes for client ConnectedEnvironmentsClient + ConnectedEnvironmentsServer ConnectedEnvironmentsServer + + // ConnectedEnvironmentsDaprComponentsServer contains the fakes for client ConnectedEnvironmentsDaprComponentsClient + ConnectedEnvironmentsDaprComponentsServer ConnectedEnvironmentsDaprComponentsServer + + // ConnectedEnvironmentsStoragesServer contains the fakes for client ConnectedEnvironmentsStoragesClient + ConnectedEnvironmentsStoragesServer ConnectedEnvironmentsStoragesServer + + // ContainerAppsAPIServer contains the fakes for client ContainerAppsAPIClient + ContainerAppsAPIServer ContainerAppsAPIServer + + // ContainerAppsAuthConfigsServer contains the fakes for client ContainerAppsAuthConfigsClient + ContainerAppsAuthConfigsServer ContainerAppsAuthConfigsServer + + // ContainerAppsServer contains the fakes for client ContainerAppsClient + ContainerAppsServer ContainerAppsServer + + // ContainerAppsDiagnosticsServer contains the fakes for client ContainerAppsDiagnosticsClient + ContainerAppsDiagnosticsServer ContainerAppsDiagnosticsServer + + // ContainerAppsRevisionReplicasServer contains the fakes for client ContainerAppsRevisionReplicasClient + ContainerAppsRevisionReplicasServer ContainerAppsRevisionReplicasServer + + // ContainerAppsRevisionsServer contains the fakes for client ContainerAppsRevisionsClient + ContainerAppsRevisionsServer ContainerAppsRevisionsServer + + // ContainerAppsSessionPoolsServer contains the fakes for client ContainerAppsSessionPoolsClient + ContainerAppsSessionPoolsServer ContainerAppsSessionPoolsServer + + // ContainerAppsSourceControlsServer contains the fakes for client ContainerAppsSourceControlsClient + ContainerAppsSourceControlsServer ContainerAppsSourceControlsServer + + // DaprComponentsServer contains the fakes for client DaprComponentsClient + DaprComponentsServer DaprComponentsServer + + // JavaComponentsServer contains the fakes for client JavaComponentsClient + JavaComponentsServer JavaComponentsServer + + // JobsServer contains the fakes for client JobsClient + JobsServer JobsServer + + // JobsExecutionsServer contains the fakes for client JobsExecutionsClient + JobsExecutionsServer JobsExecutionsServer + + // ManagedCertificatesServer contains the fakes for client ManagedCertificatesClient + ManagedCertificatesServer ManagedCertificatesServer + + // ManagedEnvironmentDiagnosticsServer contains the fakes for client ManagedEnvironmentDiagnosticsClient + ManagedEnvironmentDiagnosticsServer ManagedEnvironmentDiagnosticsServer + + // ManagedEnvironmentUsagesServer contains the fakes for client ManagedEnvironmentUsagesClient + ManagedEnvironmentUsagesServer ManagedEnvironmentUsagesServer + + // ManagedEnvironmentsServer contains the fakes for client ManagedEnvironmentsClient + ManagedEnvironmentsServer ManagedEnvironmentsServer + + // ManagedEnvironmentsDiagnosticsServer contains the fakes for client ManagedEnvironmentsDiagnosticsClient + ManagedEnvironmentsDiagnosticsServer ManagedEnvironmentsDiagnosticsServer + + // ManagedEnvironmentsStoragesServer contains the fakes for client ManagedEnvironmentsStoragesClient + ManagedEnvironmentsStoragesServer ManagedEnvironmentsStoragesServer + + // NamespacesServer contains the fakes for client NamespacesClient + NamespacesServer NamespacesServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // UsagesServer contains the fakes for client UsagesClient + UsagesServer UsagesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -77,51 +113,36 @@ 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 + trContainerAppsSessionPoolsServer *ContainerAppsSessionPoolsServerTransport + trContainerAppsSourceControlsServer *ContainerAppsSourceControlsServerTransport + trDaprComponentsServer *DaprComponentsServerTransport + trJavaComponentsServer *JavaComponentsServerTransport + 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 +158,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 +168,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 +201,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 +211,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) @@ -246,31 +231,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { 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) @@ -284,9 +249,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 +259,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..7691a451714b 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/time_rfc3339.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/time_rfc3339.go @@ -1,6 +1,3 @@ -//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. @@ -11,12 +8,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. @@ -61,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/fake/usages_server.go b/sdk/resourcemanager/appcontainers/armappcontainers/fake/usages_server.go index f6da5c8fb458..962cc531b241 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/fake/usages_server.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/fake/usages_server.go @@ -1,6 +1,3 @@ -//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. @@ -11,15 +8,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. @@ -54,21 +50,40 @@ func (u *UsagesServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return u.dispatchToMethodFake(req, method) +} - switch method { - case "UsagesClient.NewListPager": - resp, err = u.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (u *UsagesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if usagesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = usagesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "UsagesClient.NewListPager": + res.resp, res.err = u.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (u *UsagesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -107,3 +122,9 @@ func (u *UsagesServerTransport) dispatchNewListPager(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to UsagesServerTransport +var usagesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} 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 06eea8947f63..157c36604c8c 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.17.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.4.0 // 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.33.0 // indirect golang.org/x/net v0.35.0 // indirect - golang.org/x/sys v0.30.0 // indirect golang.org/x/text v0.22.0 // indirect ) diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/go.sum b/sdk/resourcemanager/appcontainers/armappcontainers/go.sum index 6324123af695..da9d756575fb 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.17.0 h1:g0EZJwz7xkXQiZAI5xi9f3WWFYBlX1CPTrR+NDToRkQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0/go.mod h1:XCW7KnZet0Opnr7HccfUw1PLc4CjHqpcaxW8DHklNkQ= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 h1:F0gBpfdPLGsw+nsgk6aqqkZS1jiixa5WwFe3fk/T3Ys= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2/go.mod h1:SqINnQ9lVVdRlyC8cd1lCI0SdX4n2paeABd2K8ggfnE= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= 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.4.0 h1:MUkXAnvvDHgvPItl0nBj0hgk0f7hnnQbGm0h0+YxbN4= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.0/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.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= -golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= 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 index 192994842aa9..cd7cefecab56 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/interfaces.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/interfaces.go @@ -1,6 +1,3 @@ -//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. @@ -11,8 +8,7 @@ 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 +// - *JavaComponentProperties, *SpringBootAdminComponent, *SpringCloudConfigComponent, *SpringCloudEurekaComponent type JavaComponentPropertiesClassification interface { // GetJavaComponentProperties returns the JavaComponentProperties content of the underlying type. GetJavaComponentProperties() *JavaComponentProperties diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client.go index 7cfd4fa86fc8..7a616c94781d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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" ) // JavaComponentsClient contains the methods for the JavaComponents group. @@ -29,7 +25,7 @@ type JavaComponentsClient struct { } // NewJavaComponentsClient creates a new instance of JavaComponentsClient 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 NewJavaComponentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JavaComponentsClient, error) { @@ -47,7 +43,7 @@ func NewJavaComponentsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates a Java Component in a Managed Environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 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. // - name - Name of the Java Component. @@ -75,7 +71,7 @@ func (client *JavaComponentsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates a Java Component in a Managed Environment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -98,7 +94,7 @@ func (client *JavaComponentsClient) createOrUpdate(ctx context.Context, resource } // 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) { +func (client *JavaComponentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, javaComponentEnvelope JavaComponent, _ *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") @@ -121,7 +117,7 @@ func (client *JavaComponentsClient) 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, javaComponentEnvelope); err != nil { @@ -133,7 +129,7 @@ func (client *JavaComponentsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Delete a Java Component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 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. // - name - Name of the Java Component. @@ -160,7 +156,7 @@ func (client *JavaComponentsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Delete a Java Component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -183,7 +179,7 @@ func (client *JavaComponentsClient) deleteOperation(ctx context.Context, resourc } // deleteCreateRequest creates the Delete request. -func (client *JavaComponentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, options *JavaComponentsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *JavaComponentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, _ *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") @@ -206,7 +202,7 @@ func (client *JavaComponentsClient) 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 @@ -215,7 +211,7 @@ func (client *JavaComponentsClient) deleteCreateRequest(ctx context.Context, res // Get - Get a Java Component. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 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. // - name - Name of the Java Component. @@ -243,7 +239,7 @@ func (client *JavaComponentsClient) Get(ctx context.Context, resourceGroupName s } // getCreateRequest creates the Get request. -func (client *JavaComponentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, options *JavaComponentsClientGetOptions) (*policy.Request, error) { +func (client *JavaComponentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, _ *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") @@ -266,7 +262,7 @@ func (client *JavaComponentsClient) 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 @@ -283,7 +279,7 @@ func (client *JavaComponentsClient) getHandleResponse(resp *http.Response) (Java // NewListPager - Get the Java 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 - JavaComponentsClientListOptions contains the optional parameters for the JavaComponentsClient.NewListPager method. @@ -311,7 +307,7 @@ func (client *JavaComponentsClient) NewListPager(resourceGroupName string, envir } // listCreateRequest creates the List request. -func (client *JavaComponentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *JavaComponentsClientListOptions) (*policy.Request, error) { +func (client *JavaComponentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, _ *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") @@ -330,7 +326,7 @@ func (client *JavaComponentsClient) 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 @@ -348,7 +344,7 @@ func (client *JavaComponentsClient) listHandleResponse(resp *http.Response) (Jav // BeginUpdate - Patches a Java Component using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 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. // - name - Name of the Java Component. @@ -375,7 +371,7 @@ func (client *JavaComponentsClient) BeginUpdate(ctx context.Context, resourceGro // Update - Patches a Java Component using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-08-02-preview +// Generated from API version 2025-01-01 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" @@ -398,7 +394,7 @@ func (client *JavaComponentsClient) update(ctx context.Context, resourceGroupNam } // 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) { +func (client *JavaComponentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, name string, javaComponentEnvelope JavaComponent, _ *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") @@ -421,7 +417,7 @@ func (client *JavaComponentsClient) updateCreateRequest(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"} if err := runtime.MarshalAsJSON(req, javaComponentEnvelope); err != nil { diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/javacomponents_client_example_test.go deleted file mode 100644 index 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..59602eca3598 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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 +70,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" @@ -97,7 +93,7 @@ func (client *JobsClient) createOrUpdate(ctx context.Context, resourceGroupName } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *JobsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope Job, options *JobsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *JobsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope Job, _ *JobsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -116,7 +112,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 +124,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 +149,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" @@ -176,7 +172,7 @@ func (client *JobsClient) deleteOperation(ctx context.Context, resourceGroupName } // deleteCreateRequest creates the Delete request. -func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, jobName string, _ *JobsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -195,7 +191,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 +200,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. @@ -231,7 +227,7 @@ func (client *JobsClient) Get(ctx context.Context, resourceGroupName string, job } // getCreateRequest creates the Get request. -func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientGetOptions) (*policy.Request, error) { +func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupName string, jobName string, _ *JobsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -250,7 +246,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 +264,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. @@ -296,7 +292,7 @@ func (client *JobsClient) GetDetector(ctx context.Context, resourceGroupName str } // getDetectorCreateRequest creates the GetDetector request. -func (client *JobsClient) getDetectorCreateRequest(ctx context.Context, resourceGroupName string, jobName string, detectorName string, options *JobsClientGetDetectorOptions) (*policy.Request, error) { +func (client *JobsClient) getDetectorCreateRequest(ctx context.Context, resourceGroupName string, jobName string, detectorName string, _ *JobsClientGetDetectorOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors/{detectorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -319,7 +315,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 +332,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. @@ -364,7 +360,7 @@ func (client *JobsClient) NewListByResourceGroupPager(resourceGroupName string, } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *JobsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *JobsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *JobsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *JobsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -379,7 +375,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 +392,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] { @@ -423,7 +419,7 @@ func (client *JobsClient) NewListBySubscriptionPager(options *JobsClientListBySu } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *JobsClient) listBySubscriptionCreateRequest(ctx context.Context, options *JobsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *JobsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *JobsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.App/jobs" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -434,7 +430,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 +447,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. @@ -479,7 +475,7 @@ func (client *JobsClient) NewListDetectorsPager(resourceGroupName string, jobNam } // listDetectorsCreateRequest creates the ListDetectors request. -func (client *JobsClient) listDetectorsCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientListDetectorsOptions) (*policy.Request, error) { +func (client *JobsClient) listDetectorsCreateRequest(ctx context.Context, resourceGroupName string, jobName string, _ *JobsClientListDetectorsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -498,7 +494,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 +512,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. @@ -543,7 +539,7 @@ func (client *JobsClient) ListSecrets(ctx context.Context, resourceGroupName str } // listSecretsCreateRequest creates the ListSecrets request. -func (client *JobsClient) listSecretsCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientListSecretsOptions) (*policy.Request, error) { +func (client *JobsClient) listSecretsCreateRequest(ctx context.Context, resourceGroupName string, jobName string, _ *JobsClientListSecretsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/listSecrets" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -562,7 +558,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 +576,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. @@ -608,7 +604,7 @@ func (client *JobsClient) ProxyGet(ctx context.Context, resourceGroupName string } // proxyGetCreateRequest creates the ProxyGet request. -func (client *JobsClient) proxyGetCreateRequest(ctx context.Context, resourceGroupName string, jobName string, apiName string, options *JobsClientProxyGetOptions) (*policy.Request, error) { +func (client *JobsClient) proxyGetCreateRequest(ctx context.Context, resourceGroupName string, jobName string, apiName string, _ *JobsClientProxyGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectorProperties/{apiName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -631,7 +627,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 +642,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 +670,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 +712,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 +727,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 +753,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" @@ -856,7 +776,7 @@ func (client *JobsClient) stopExecution(ctx context.Context, resourceGroupName s } // stopExecutionCreateRequest creates the StopExecution request. -func (client *JobsClient) stopExecutionCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobExecutionName string, options *JobsClientBeginStopExecutionOptions) (*policy.Request, error) { +func (client *JobsClient) stopExecutionCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobExecutionName string, _ *JobsClientBeginStopExecutionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}/stop" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -879,7 +799,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 +808,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 +834,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" @@ -937,7 +857,7 @@ func (client *JobsClient) stopMultipleExecutions(ctx context.Context, resourceGr } // stopMultipleExecutionsCreateRequest creates the StopMultipleExecutions request. -func (client *JobsClient) stopMultipleExecutionsCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientBeginStopMultipleExecutionsOptions) (*policy.Request, error) { +func (client *JobsClient) stopMultipleExecutionsCreateRequest(ctx context.Context, resourceGroupName string, jobName string, _ *JobsClientBeginStopMultipleExecutionsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -956,83 +876,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 +885,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 +910,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" @@ -1089,7 +933,7 @@ func (client *JobsClient) update(ctx context.Context, resourceGroupName string, } // updateCreateRequest creates the Update request. -func (client *JobsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope JobPatchProperties, options *JobsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *JobsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope JobPatchProperties, _ *JobsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -1108,7 +952,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..569f2923867d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/jobsexecutions_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +42,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 +92,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..0f2a758c3a74 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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 +70,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 +116,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 +131,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. @@ -163,7 +159,7 @@ func (client *ManagedCertificatesClient) Delete(ctx context.Context, resourceGro } // deleteCreateRequest creates the Delete request. -func (client *ManagedCertificatesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, options *ManagedCertificatesClientDeleteOptions) (*policy.Request, error) { +func (client *ManagedCertificatesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, _ *ManagedCertificatesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -186,7 +182,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 +191,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. @@ -223,7 +219,7 @@ func (client *ManagedCertificatesClient) Get(ctx context.Context, resourceGroupN } // getCreateRequest creates the Get request. -func (client *ManagedCertificatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, options *ManagedCertificatesClientGetOptions) (*policy.Request, error) { +func (client *ManagedCertificatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, _ *ManagedCertificatesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -246,7 +242,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 +259,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 @@ -292,7 +288,7 @@ func (client *ManagedCertificatesClient) NewListPager(resourceGroupName string, } // listCreateRequest creates the List request. -func (client *ManagedCertificatesClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedCertificatesClientListOptions) (*policy.Request, error) { +func (client *ManagedCertificatesClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, _ *ManagedCertificatesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -311,7 +307,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 +325,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. @@ -359,7 +355,7 @@ func (client *ManagedCertificatesClient) Update(ctx context.Context, resourceGro } // updateCreateRequest creates the Update request. -func (client *ManagedCertificatesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, managedCertificateEnvelope ManagedCertificatePatch, options *ManagedCertificatesClientUpdateOptions) (*policy.Request, error) { +func (client *ManagedCertificatesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, managedCertificateEnvelope ManagedCertificatePatch, _ *ManagedCertificatesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -382,7 +378,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..c57214983aea 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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. @@ -76,7 +72,7 @@ func (client *ManagedEnvironmentDiagnosticsClient) GetDetector(ctx context.Conte } // getDetectorCreateRequest creates the GetDetector request. -func (client *ManagedEnvironmentDiagnosticsClient) getDetectorCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, detectorName string, options *ManagedEnvironmentDiagnosticsClientGetDetectorOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentDiagnosticsClient) getDetectorCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, detectorName string, _ *ManagedEnvironmentDiagnosticsClientGetDetectorOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors/{detectorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -99,7 +95,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 +113,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 @@ -145,7 +141,7 @@ func (client *ManagedEnvironmentDiagnosticsClient) ListDetectors(ctx context.Con } // listDetectorsCreateRequest creates the ListDetectors request. -func (client *ManagedEnvironmentDiagnosticsClient) listDetectorsCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentDiagnosticsClientListDetectorsOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentDiagnosticsClient) listDetectorsCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, _ *ManagedEnvironmentDiagnosticsClientListDetectorsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -164,7 +160,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..80c556f22bbf 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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 +69,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" @@ -96,7 +92,7 @@ func (client *ManagedEnvironmentsClient) createOrUpdate(ctx context.Context, res } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagedEnvironmentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, environmentEnvelope ManagedEnvironment, options *ManagedEnvironmentsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, environmentEnvelope ManagedEnvironment, _ *ManagedEnvironmentsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,7 +111,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 +123,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 +148,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" @@ -175,7 +171,7 @@ func (client *ManagedEnvironmentsClient) deleteOperation(ctx context.Context, re } // deleteCreateRequest creates the Delete request. -func (client *ManagedEnvironmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, _ *ManagedEnvironmentsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -194,7 +190,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 +199,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. @@ -230,7 +226,7 @@ func (client *ManagedEnvironmentsClient) Get(ctx context.Context, resourceGroupN } // getCreateRequest creates the Get request. -func (client *ManagedEnvironmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsClientGetOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, _ *ManagedEnvironmentsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -249,7 +245,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 +263,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 @@ -295,7 +291,7 @@ func (client *ManagedEnvironmentsClient) GetAuthToken(ctx context.Context, resou } // getAuthTokenCreateRequest creates the GetAuthToken request. -func (client *ManagedEnvironmentsClient) getAuthTokenCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsClientGetAuthTokenOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsClient) getAuthTokenCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, _ *ManagedEnvironmentsClientGetAuthTokenOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/getAuthtoken" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -314,7 +310,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 +327,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. @@ -359,7 +355,7 @@ func (client *ManagedEnvironmentsClient) NewListByResourceGroupPager(resourceGro } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ManagedEnvironmentsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ManagedEnvironmentsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ManagedEnvironmentsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -374,7 +370,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 +387,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] { @@ -418,7 +414,7 @@ func (client *ManagedEnvironmentsClient) NewListBySubscriptionPager(options *Man } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ManagedEnvironmentsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ManagedEnvironmentsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *ManagedEnvironmentsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.App/managedEnvironments" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -429,7 +425,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 +442,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 @@ -475,7 +471,7 @@ func (client *ManagedEnvironmentsClient) NewListWorkloadProfileStatesPager(resou } // listWorkloadProfileStatesCreateRequest creates the ListWorkloadProfileStates request. -func (client *ManagedEnvironmentsClient) listWorkloadProfileStatesCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsClientListWorkloadProfileStatesOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsClient) listWorkloadProfileStatesCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, _ *ManagedEnvironmentsClientListWorkloadProfileStatesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/workloadProfileStates" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -494,7 +490,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 +508,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 +534,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" @@ -561,7 +557,7 @@ func (client *ManagedEnvironmentsClient) update(ctx context.Context, resourceGro } // updateCreateRequest creates the Update request. -func (client *ManagedEnvironmentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, environmentEnvelope ManagedEnvironment, options *ManagedEnvironmentsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, environmentEnvelope ManagedEnvironment, _ *ManagedEnvironmentsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -580,7 +576,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..7742e9710eb3 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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 @@ -75,7 +71,7 @@ func (client *ManagedEnvironmentsDiagnosticsClient) GetRoot(ctx context.Context, } // getRootCreateRequest creates the GetRoot request. -func (client *ManagedEnvironmentsDiagnosticsClient) getRootCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsDiagnosticsClientGetRootOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsDiagnosticsClient) getRootCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, _ *ManagedEnvironmentsDiagnosticsClientGetRootOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectorProperties/rootApi/" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -94,7 +90,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..fac328b8d4e6 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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. @@ -77,7 +73,7 @@ func (client *ManagedEnvironmentsStoragesClient) CreateOrUpdate(ctx context.Cont } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagedEnvironmentsStoragesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, storageName string, storageEnvelope ManagedEnvironmentStorage, options *ManagedEnvironmentsStoragesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsStoragesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, storageName string, storageEnvelope ManagedEnvironmentStorage, _ *ManagedEnvironmentsStoragesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -100,7 +96,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 +117,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. @@ -149,7 +145,7 @@ func (client *ManagedEnvironmentsStoragesClient) Delete(ctx context.Context, res } // deleteCreateRequest creates the Delete request. -func (client *ManagedEnvironmentsStoragesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, storageName string, options *ManagedEnvironmentsStoragesClientDeleteOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsStoragesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, storageName string, _ *ManagedEnvironmentsStoragesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -172,7 +168,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 +177,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. @@ -210,7 +206,7 @@ func (client *ManagedEnvironmentsStoragesClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *ManagedEnvironmentsStoragesClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, storageName string, options *ManagedEnvironmentsStoragesClientGetOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsStoragesClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, storageName string, _ *ManagedEnvironmentsStoragesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -233,7 +229,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 +247,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 @@ -279,7 +275,7 @@ func (client *ManagedEnvironmentsStoragesClient) List(ctx context.Context, resou } // listCreateRequest creates the List request. -func (client *ManagedEnvironmentsStoragesClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsStoragesClientListOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentsStoragesClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, _ *ManagedEnvironmentsStoragesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -298,7 +294,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..f84b4041d3f3 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentusages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentusages_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +42,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 @@ -75,7 +71,7 @@ func (client *ManagedEnvironmentUsagesClient) NewListPager(resourceGroupName str } // listCreateRequest creates the List request. -func (client *ManagedEnvironmentUsagesClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentUsagesClientListOptions) (*policy.Request, error) { +func (client *ManagedEnvironmentUsagesClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, _ *ManagedEnvironmentUsagesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/usages" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -94,7 +90,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..017c43634c83 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/models.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/models.go @@ -1,6 +1,3 @@ -//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. @@ -25,12 +22,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 +40,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. @@ -374,10 +317,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 @@ -396,7 +335,7 @@ type BillingMeter struct { // Revision resource specific properties Properties *BillingMeterProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // 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 @@ -433,150 +372,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 @@ -630,9 +425,6 @@ 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 +480,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 +499,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 @@ -822,9 +597,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 +619,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 +644,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. @@ -1046,9 +809,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 +818,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 @@ -1078,14 +835,9 @@ type ContainerAppProperties struct { // READ-ONLY; Provisioning state of the Container App. 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 + // READ-ONLY; Running status of the Container App. + RunningStatus *ContainerAppRunningStatus } // ContainerAppSecret - Container App Secret. @@ -1103,121 +855,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 @@ -1474,111 +1111,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,130 +1157,28 @@ 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 + // The configuration settings of the Azure Active Directory allowed principals. + AllowedPrincipals *AllowedPrincipals } -// DaprSubscription - Dapr PubSub Event Subscription. -type DaprSubscription struct { - // Dapr PubSub Event Subscription resource specific properties - Properties *DaprSubscriptionProperties +// DefaultErrorResponse - App Service error response. +type DefaultErrorResponse struct { + // READ-ONLY; Error model. + Error *DefaultErrorResponseError +} - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - ID *string +// DefaultErrorResponseError - Error model. +type DefaultErrorResponseError struct { + // Details or the error + Details []*DefaultErrorResponseErrorDetailsItem - // 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 -} - -// DefaultErrorResponse - App Service error response. -type DefaultErrorResponse struct { - // READ-ONLY; Error model. - Error *DefaultErrorResponseError -} - -// DefaultErrorResponseError - Error model. -type DefaultErrorResponseError struct { - // Details or the error - Details []*DefaultErrorResponseErrorDetailsItem - - // READ-ONLY; Standardized string to programmatically identify the error. - Code *string + // READ-ONLY; Standardized string to programmatically identify the error. + Code *string // READ-ONLY; More information to debug error. Innererror *string @@ -1768,15 +1202,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 @@ -1933,73 +1358,10 @@ 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 + // The lifecycle configuration of a session in the dynamic session pool + LifecycleConfiguration *LifecycleConfiguration } // EncryptionSettings - The configuration settings of the secrets references of encryption key and signing key for ContainerApp @@ -2057,15 +1419,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 +1446,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 +1453,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 +1506,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 +1560,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 +1592,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 +1636,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 +1671,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 +1713,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 @@ -2599,9 +1809,6 @@ 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 @@ -2636,10 +1843,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 +1949,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 +1973,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 +2021,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 +2043,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. @@ -2905,6 +2100,18 @@ type KedaConfiguration struct { Version *string } +// LifecycleConfiguration - The lifecycle configuration properties of a session in the dynamic session pool +type LifecycleConfiguration struct { + // The cooldown period of a session in seconds when the lifecycle type is 'Timed'. + CooldownPeriodInSeconds *int32 + + // The lifecycle type of the session pool. + LifecycleType *LifecycleType + + // The maximum alive period of a session in seconds when the lifecycle type is 'OnContainerExit'. + MaxAlivePeriodInSeconds *int32 +} + type ListUsagesResult struct { // The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page // of compute resource usage information. @@ -2919,40 +2126,10 @@ 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 } -// LoggerSetting - Logger settings for java workloads. -type LoggerSetting struct { - // REQUIRED; The specified logger's log level. - Level *Level - - // REQUIRED; Logger name. - 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 +2165,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 @@ -3084,11 +2255,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 +2278,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 +2302,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 @@ -3211,6 +2369,16 @@ type ManagedEnvironmentsCollection struct { NextLink *string } +// ManagedIdentitySetting - Optional settings for a Managed Identity that is assigned to the Session pool. +type ManagedIdentitySetting struct { + // REQUIRED; The resource ID of a user-assigned managed identity that is assigned to the Session Pool, or 'system' for system-assigned + // identity. + Identity *string + + // Use to select the lifecycle stages of a Session Pool during which the Managed Identity should be available. + Lifecycle *IdentitySettingsLifeCycle +} + // ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) type ManagedServiceIdentity struct { // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). @@ -3231,59 +2399,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. @@ -3301,11 +2428,12 @@ type Nonce struct { // OpenIDConnectClientCredential - The authentication client credentials of the custom Open ID Connect provider. type OpenIDConnectClientCredential struct { + // CONSTANT; The method that should be used to authenticate the user. + // Field has constant value "ClientSecretPost", any specified value is ignored. + Method *string + // The app setting that contains the client secret for the custom Open ID Connect provider. ClientSecretSettingName *string - - // The method that should be used to authenticate the user. - Method *string } // OpenIDConnectConfig - The configuration settings of the endpoints used for the custom Open ID Connect provider. @@ -3347,21 +2475,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,223 +2505,6 @@ 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 { @@ -3713,9 +2609,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 +2622,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. @@ -3837,46 +2721,19 @@ 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 EnableMetrics *bool - - // Diagnostic capabilities achieved by java agent - JavaAgent *RuntimeJavaAgent -} - -// RuntimeJavaAgent - Diagnostic capabilities achieved by java agent -type RuntimeJavaAgent struct { - // Enable java agent injection for the java app. - Enabled *bool - - // Capabilities on the java logging scenario. - Logging *RuntimeJavaAgentLogging -} - -// RuntimeJavaAgentLogging - Capabilities on the java logging scenario. -type RuntimeJavaAgentLogging struct { - // Settings of the logger for the java app. - LoggerSettings []*LoggerSetting } // 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,7 +2742,7 @@ 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. @@ -3928,24 +2785,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 +2823,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 @@ -4044,6 +2877,10 @@ type SessionPool struct { // REQUIRED; The geo-location where the resource lives Location *string + // Managed identities needed by a session pool to interact with other Azure services to not maintain any secrets or credentials + // in code. + Identity *ManagedServiceIdentity + // Container App session pool resource specific properties Properties *SessionPoolProperties @@ -4086,6 +2923,9 @@ type SessionPoolProperties struct { // Resource ID of the session pool's environment. EnvironmentID *string + // Optional settings for a Managed Identity that is assigned to the Session pool. + ManagedIdentitySettings []*ManagedIdentitySetting + // The pool management type of the session pool. PoolManagementType *PoolManagementType @@ -4119,8 +2959,15 @@ type SessionPoolSecret struct { // SessionPoolUpdatableProperties - Container App session pool updatable properties. type SessionPoolUpdatableProperties struct { + // Managed identities needed by a session pool to interact with other Azure services to not maintain any secrets or credentials + // in code. + Identity *ManagedServiceIdentity + // Session pool resource specific updatable properties. Properties *SessionPoolUpdatablePropertiesProperties + + // Resource tags. + Tags map[string]*string } // SessionPoolUpdatablePropertiesProperties - Session pool resource specific updatable properties. @@ -4157,27 +3004,6 @@ type SessionRegistryCredentials struct { 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 @@ -4314,41 +3140,6 @@ func (s *SpringCloudEurekaComponent) GetJavaComponentProperties() *JavaComponent } } -// 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 +3161,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 +3202,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 +3216,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 { @@ -4594,69 +3355,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 +3363,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 diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go b/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go index 18fc9972a2b5..976b60d7576c 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go @@ -1,6 +1,3 @@ -//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. @@ -11,10 +8,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 +71,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 +133,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 +810,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 +837,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 +990,377 @@ 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) + 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) + delete(rawMsg, key) + 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 BuildConfiguration. -func (b BuildConfiguration) 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, "baseOs", b.BaseOs) - populate(objectMap, "environmentVariables", b.EnvironmentVariables) - populate(objectMap, "platform", b.Platform) - populate(objectMap, "platformVersion", b.PlatformVersion) - populate(objectMap, "preBuildSteps", b.PreBuildSteps) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildConfiguration. -func (b *BuildConfiguration) 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 "baseOs": - err = unpopulate(val, "BaseOs", &b.BaseOs) - delete(rawMsg, key) - case "environmentVariables": - err = unpopulate(val, "EnvironmentVariables", &b.EnvironmentVariables) - delete(rawMsg, key) - case "platform": - err = unpopulate(val, "Platform", &b.Platform) - delete(rawMsg, key) - case "platformVersion": - err = unpopulate(val, "PlatformVersion", &b.PlatformVersion) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "preBuildSteps": - err = unpopulate(val, "PreBuildSteps", &b.PreBuildSteps) + 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 BuildProperties. -func (b BuildProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CertificateKeyVaultProperties. +func (c CertificateKeyVaultProperties) 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, "identity", c.Identity) + populate(objectMap, "keyVaultUrl", c.KeyVaultURL) 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 CertificateKeyVaultProperties. +func (c *CertificateKeyVaultProperties) UnmarshalJSON(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 "identity": + err = unpopulate(val, "Identity", &c.Identity) delete(rawMsg, key) - case "uploadEndpoint": - err = unpopulate(val, "UploadEndpoint", &b.UploadEndpoint) + case "keyVaultUrl": + err = unpopulate(val, "KeyVaultURL", &c.KeyVaultURL) 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) + populate(objectMap, "certificateKeyVaultProperties", c.CertificateKeyVaultProperties) + 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 "certificateKeyVaultProperties": + err = unpopulate(val, "CertificateKeyVaultProperties", &c.CertificateKeyVaultProperties) delete(rawMsg, key) - case "token": - err = unpopulate(val, "Token", &b.Token) + case "expirationDate": + err = unpopulateDateTimeRFC3339(val, "ExpirationDate", &c.ExpirationDate) 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 "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": - 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 +1371,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 +1380,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 +1412,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 +1443,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 +1464,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 +1490,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 +1510,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 +1533,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) { - 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) - }) +// MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentStorageProperties. +func (c ConnectedEnvironmentStorageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 +1549,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 +1560,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 +1576,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 +1587,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 +1610,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 +1642,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 +1667,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 +1705,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 +1718,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 +1727,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 +1756,47 @@ 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "expires": + err = unpopulateDateTimeRFC3339(val, "Expires", &c.Expires) + delete(rawMsg, key) + case "token": + err = unpopulate(val, "Token", &c.Token) + 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 ContainerAppCollection. +func (c ContainerAppCollection) 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 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) @@ -2024,20 +1818,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 ContainerAppJobExecutions. +func (c ContainerAppJobExecutions) 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 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) @@ -2045,23 +1835,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 +1849,23 @@ 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 ContainerAppProbe. +func (c ContainerAppProbe) 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, "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 ConnectedEnvironmentStorage. -func (c *ConnectedEnvironmentStorage) 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) @@ -2091,17 +1873,29 @@ 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) + case "failureThreshold": + err = unpopulate(val, "FailureThreshold", &c.FailureThreshold) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "httpGet": + err = unpopulate(val, "HTTPGet", &c.HTTPGet) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "initialDelaySeconds": + err = unpopulate(val, "InitialDelaySeconds", &c.InitialDelaySeconds) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + 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 "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) @@ -2114,16 +1908,19 @@ 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 ContainerAppProbeHTTPGet. +func (c ContainerAppProbeHTTPGet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "azureFile", c.AzureFile) - populate(objectMap, "smb", c.Smb) + 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 ConnectedEnvironmentStorageProperties. -func (c *ConnectedEnvironmentStorageProperties) 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) @@ -2131,11 +1928,20 @@ 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 "httpHeaders": + err = unpopulate(val, "HTTPHeaders", &c.HTTPHeaders) + delete(rawMsg, key) + case "host": + err = unpopulate(val, "Host", &c.Host) delete(rawMsg, key) - case "smb": - err = unpopulate(val, "Smb", &c.Smb) + 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 { @@ -2145,15 +1951,16 @@ 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 ContainerAppProbeHTTPGetHTTPHeadersItem. +func (c ContainerAppProbeHTTPGetHTTPHeadersItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "name", c.Name) populate(objectMap, "value", c.Value) 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 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) @@ -2161,6 +1968,9 @@ func (c *ConnectedEnvironmentStoragesCollection) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) @@ -2172,23 +1982,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 ContainerAppProbeTCPSocket. +func (c ContainerAppProbeTCPSocket) 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, "host", c.Host) + populate(objectMap, "port", c.Port) 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 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) @@ -2196,32 +1999,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) + case "host": + err = unpopulate(val, "Host", &c.Host) delete(rawMsg, key) - case "volumeMounts": - err = unpopulate(val, "VolumeMounts", &c.VolumeMounts) + case "port": + err = unpopulate(val, "Port", &c.Port) delete(rawMsg, key) } if err != nil { @@ -2231,25 +2013,27 @@ 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 ContainerAppProperties. +func (c ContainerAppProperties) 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, "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, "runningStatus", c.RunningStatus) + populate(objectMap, "template", c.Template) + populate(objectMap, "workloadProfileName", c.WorkloadProfileName) 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 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) @@ -2257,38 +2041,44 @@ 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) + case "configuration": + err = unpopulate(val, "Configuration", &c.Configuration) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &c.ID) + case "customDomainVerificationId": + err = unpopulate(val, "CustomDomainVerificationID", &c.CustomDomainVerificationID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &c.EnvironmentID) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &c.Kind) + case "eventStreamEndpoint": + err = unpopulate(val, "EventStreamEndpoint", &c.EventStreamEndpoint) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) + case "latestReadyRevisionName": + err = unpopulate(val, "LatestReadyRevisionName", &c.LatestReadyRevisionName) delete(rawMsg, key) - case "managedBy": - err = unpopulate(val, "ManagedBy", &c.ManagedBy) + case "latestRevisionFqdn": + err = unpopulate(val, "LatestRevisionFqdn", &c.LatestRevisionFqdn) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "latestRevisionName": + err = unpopulate(val, "LatestRevisionName", &c.LatestRevisionName) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "managedEnvironmentId": + err = unpopulate(val, "ManagedEnvironmentID", &c.ManagedEnvironmentID) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "outboundIpAddresses": + err = unpopulate(val, "OutboundIPAddresses", &c.OutboundIPAddresses) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &c.Tags) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "runningStatus": + err = unpopulate(val, "RunningStatus", &c.RunningStatus) + 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 { @@ -2298,21 +2088,18 @@ 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 ContainerAppSecret. +func (c ContainerAppSecret) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "keyVaultUrl", c.KeyVaultURL) 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, "value", c.Value) 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 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) @@ -2320,26 +2107,17 @@ 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 "identity": + err = unpopulate(val, "Identity", &c.Identity) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) + case "keyVaultUrl": + err = unpopulate(val, "KeyVaultURL", &c.KeyVaultURL) 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) - 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 { @@ -2349,16 +2127,17 @@ 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 ContainerResources. +func (c ContainerResources) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "expires", c.Expires) - populate(objectMap, "token", c.Token) + 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 ContainerAppAuthTokenProperties. -func (c *ContainerAppAuthTokenProperties) 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) @@ -2366,11 +2145,14 @@ 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 "cpu": + err = unpopulate(val, "CPU", &c.CPU) delete(rawMsg, key) - case "token": - err = unpopulate(val, "Token", &c.Token) + 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 { @@ -2380,16 +2162,16 @@ 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 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 ContainerAppCollection. -func (c *ContainerAppCollection) 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) @@ -2397,11 +2179,11 @@ 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 "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 { @@ -2411,16 +2193,20 @@ 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 CorsPolicy. +func (c CorsPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + 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 ContainerAppJobExecutions. -func (c *ContainerAppJobExecutions) 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) @@ -2428,11 +2214,23 @@ 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 "allowCredentials": + err = unpopulate(val, "AllowCredentials", &c.AllowCredentials) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + 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) + delete(rawMsg, key) + case "maxAge": + err = unpopulate(val, "MaxAge", &c.MaxAge) delete(rawMsg, key) } if err != nil { @@ -2442,23 +2240,17 @@ 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 CustomContainerTemplate. +func (c CustomContainerTemplate) 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, "containers", c.Containers) + populate(objectMap, "ingress", c.Ingress) + populate(objectMap, "registryCredentials", c.RegistryCredentials) 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 CustomContainerTemplate. +func (c *CustomContainerTemplate) UnmarshalJSON(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 +2258,14 @@ 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) - 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 "terminationGracePeriodSeconds": - err = unpopulate(val, "TerminationGracePeriodSeconds", &c.TerminationGracePeriodSeconds) + case "containers": + err = unpopulate(val, "Containers", &c.Containers) delete(rawMsg, key) - case "timeoutSeconds": - err = unpopulate(val, "TimeoutSeconds", &c.TimeoutSeconds) + case "ingress": + err = unpopulate(val, "Ingress", &c.Ingress) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "registryCredentials": + err = unpopulate(val, "RegistryCredentials", &c.RegistryCredentials) delete(rawMsg, key) } if err != nil { @@ -2501,19 +2275,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 +2293,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 +2310,24 @@ 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, "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) 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,42 +2335,31 @@ 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 "certificateKeyVaultProperties": + err = unpopulate(val, "CertificateKeyVaultProperties", &c.CertificateKeyVaultProperties) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "certificatePassword": + err = unpopulate(val, "CertificatePassword", &c.CertificatePassword) 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 ContainerAppProbeTCPSocket. -func (c ContainerAppProbeTCPSocket) 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) + case "certificateValue": + if val != nil && string(val) != "null" { + err = runtime.DecodeByteArray(string(val), &c.CertificateValue, runtime.Base64StdFormat) + } delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &c.Port) + 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 { @@ -2606,28 +2369,26 @@ func (c *ContainerAppProbeTCPSocket) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerAppProperties. -func (c ContainerAppProperties) 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, "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 +2396,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 +2440,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 +2459,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 +2479,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 +2497,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 +2514,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 +2532,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 +2549,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 +2568,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,4498 +2588,1823 @@ 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) - return json.Marshal(objectMap) -} - -// 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "bindingType": - err = unpopulate(val, "BindingType", &c.BindingType) - delete(rawMsg, key) - case "certificateId": - err = unpopulate(val, "CertificateID", &c.CertificateID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - 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 CustomDomainConfiguration. -func (c CustomDomainConfiguration) 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) - return json.Marshal(objectMap) -} - -// 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) - } - 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) - 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 { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CustomHostnameAnalysisResult. -func (c CustomHostnameAnalysisResult) 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) - return json.Marshal(objectMap) -} - -// 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) - } - 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) - delete(rawMsg, key) - case "txtRecords": - err = unpopulate(val, "TxtRecords", &c.TxtRecords) - 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 CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo. -func (c CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo) 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) - return json.Marshal(objectMap) -} - -// 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) - } - 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) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &c.Target) - 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 CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem. -func (c CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &c.Code) - 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 { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CustomOpenIDConnectProvider. -func (c CustomOpenIDConnectProvider) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &c.Enabled) - delete(rawMsg, key) - 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 { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CustomScaleRule. -func (c CustomScaleRule) 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) - return json.Marshal(objectMap) -} - -// 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) - } - for key, val := range rawMsg { - var err error - switch key { - case "auth": - err = unpopulate(val, "Auth", &c.Auth) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &c.Identity) - delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &c.Metadata) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Dapr. -func (d Dapr) 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) - return json.Marshal(objectMap) -} - -// 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", d, err) - } - 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) - delete(rawMsg, key) - case "logLevel": - err = unpopulate(val, "LogLevel", &d.LogLevel) - 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 DaprComponent. -func (d DaprComponent) 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 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", 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 DaprComponentProperties. -func (d DaprComponentProperties) 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) - return json.Marshal(objectMap) -} - -// 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", d, err) - } - 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) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &d.Version) - 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 DaprComponentResiliencyPoliciesCollection. -func (d DaprComponentResiliencyPoliciesCollection) 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 DaprComponentResiliencyPoliciesCollection. -func (d *DaprComponentResiliencyPoliciesCollection) UnmarshalJSON(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 DaprComponentResiliencyPolicy. -func (d DaprComponentResiliencyPolicy) 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 DaprComponentResiliencyPolicy. -func (d *DaprComponentResiliencyPolicy) UnmarshalJSON(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 DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration. -func (d DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "consecutiveErrors", d.ConsecutiveErrors) - populate(objectMap, "intervalInSeconds", d.IntervalInSeconds) - populate(objectMap, "timeoutInSeconds", d.TimeoutInSeconds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration. -func (d *DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration) UnmarshalJSON(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 "consecutiveErrors": - err = unpopulate(val, "ConsecutiveErrors", &d.ConsecutiveErrors) - delete(rawMsg, key) - case "intervalInSeconds": - err = unpopulate(val, "IntervalInSeconds", &d.IntervalInSeconds) - delete(rawMsg, key) - case "timeoutInSeconds": - err = unpopulate(val, "TimeoutInSeconds", &d.TimeoutInSeconds) - 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 DaprComponentResiliencyPolicyConfiguration. -func (d DaprComponentResiliencyPolicyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "circuitBreakerPolicy", d.CircuitBreakerPolicy) - populate(objectMap, "httpRetryPolicy", d.HTTPRetryPolicy) - populate(objectMap, "timeoutPolicy", d.TimeoutPolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicyConfiguration. -func (d *DaprComponentResiliencyPolicyConfiguration) UnmarshalJSON(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 "circuitBreakerPolicy": - err = unpopulate(val, "CircuitBreakerPolicy", &d.CircuitBreakerPolicy) - delete(rawMsg, key) - case "httpRetryPolicy": - err = unpopulate(val, "HTTPRetryPolicy", &d.HTTPRetryPolicy) - delete(rawMsg, key) - case "timeoutPolicy": - err = unpopulate(val, "TimeoutPolicy", &d.TimeoutPolicy) - 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 DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration. -func (d DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "initialDelayInMilliseconds", d.InitialDelayInMilliseconds) - populate(objectMap, "maxIntervalInMilliseconds", d.MaxIntervalInMilliseconds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration. -func (d *DaprComponentResiliencyPolicyHTTPRetryBackOffConfiguration) UnmarshalJSON(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 "initialDelayInMilliseconds": - err = unpopulate(val, "InitialDelayInMilliseconds", &d.InitialDelayInMilliseconds) - delete(rawMsg, key) - case "maxIntervalInMilliseconds": - err = unpopulate(val, "MaxIntervalInMilliseconds", &d.MaxIntervalInMilliseconds) - 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 DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration. -func (d DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "maxRetries", d.MaxRetries) - populate(objectMap, "retryBackOff", d.RetryBackOff) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration. -func (d *DaprComponentResiliencyPolicyHTTPRetryPolicyConfiguration) UnmarshalJSON(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 "maxRetries": - err = unpopulate(val, "MaxRetries", &d.MaxRetries) - delete(rawMsg, key) - case "retryBackOff": - err = unpopulate(val, "RetryBackOff", &d.RetryBackOff) - 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 DaprComponentResiliencyPolicyProperties. -func (d DaprComponentResiliencyPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "inboundPolicy", d.InboundPolicy) - populate(objectMap, "outboundPolicy", d.OutboundPolicy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicyProperties. -func (d *DaprComponentResiliencyPolicyProperties) UnmarshalJSON(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 "inboundPolicy": - err = unpopulate(val, "InboundPolicy", &d.InboundPolicy) - delete(rawMsg, key) - case "outboundPolicy": - err = unpopulate(val, "OutboundPolicy", &d.OutboundPolicy) - 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 DaprComponentResiliencyPolicyTimeoutPolicyConfiguration. -func (d DaprComponentResiliencyPolicyTimeoutPolicyConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "responseTimeoutInSeconds", d.ResponseTimeoutInSeconds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprComponentResiliencyPolicyTimeoutPolicyConfiguration. -func (d *DaprComponentResiliencyPolicyTimeoutPolicyConfiguration) UnmarshalJSON(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 "responseTimeoutInSeconds": - err = unpopulate(val, "ResponseTimeoutInSeconds", &d.ResponseTimeoutInSeconds) - 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 DaprComponentServiceBinding. -func (d DaprComponentServiceBinding) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "metadata", d.Metadata) - populate(objectMap, "name", d.Name) - populate(objectMap, "serviceId", d.ServiceID) - 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 - 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 "metadata": - err = unpopulate(val, "Metadata", &d.Metadata) - delete(rawMsg, 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 DaprComponentsCollection. -func (d DaprComponentsCollection) 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 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", 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 DaprConfiguration. -func (d DaprConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "version", d.Version) - return json.Marshal(objectMap) -} - -// 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "version": - err = unpopulate(val, "Version", &d.Version) - 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 DaprMetadata. -func (d DaprMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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 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", d, 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) - 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 DaprSecret. -func (d DaprSecret) 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 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", 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 DaprSecretsCollection. -func (d DaprSecretsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// 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", d, err) - } - for key, val := range rawMsg { - var err error - switch 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 DaprServiceBindMetadata. -func (d DaprServiceBindMetadata) 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 DaprServiceBindMetadata. -func (d *DaprServiceBindMetadata) UnmarshalJSON(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 DaprSubscription. -func (d DaprSubscription) 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 DaprSubscription. -func (d *DaprSubscription) UnmarshalJSON(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 DaprSubscriptionBulkSubscribeOptions. -func (d DaprSubscriptionBulkSubscribeOptions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", d.Enabled) - populate(objectMap, "maxAwaitDurationMs", d.MaxAwaitDurationMs) - populate(objectMap, "maxMessagesCount", d.MaxMessagesCount) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSubscriptionBulkSubscribeOptions. -func (d *DaprSubscriptionBulkSubscribeOptions) UnmarshalJSON(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 "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) - delete(rawMsg, key) - case "maxAwaitDurationMs": - err = unpopulate(val, "MaxAwaitDurationMs", &d.MaxAwaitDurationMs) - delete(rawMsg, key) - case "maxMessagesCount": - err = unpopulate(val, "MaxMessagesCount", &d.MaxMessagesCount) - 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 DaprSubscriptionProperties. -func (d DaprSubscriptionProperties) 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) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSubscriptionProperties. -func (d *DaprSubscriptionProperties) UnmarshalJSON(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 "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) - delete(rawMsg, key) - case "routes": - err = unpopulate(val, "Routes", &d.Routes) - delete(rawMsg, key) - case "scopes": - err = unpopulate(val, "Scopes", &d.Scopes) - delete(rawMsg, key) - case "topic": - err = unpopulate(val, "Topic", &d.Topic) - 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 DaprSubscriptionRouteRule. -func (d DaprSubscriptionRouteRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "match", d.Match) - populate(objectMap, "path", d.Path) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSubscriptionRouteRule. -func (d *DaprSubscriptionRouteRule) UnmarshalJSON(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 "match": - err = unpopulate(val, "Match", &d.Match) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &d.Path) - 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 DaprSubscriptionRoutes. -func (d DaprSubscriptionRoutes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "default", d.Default) - populate(objectMap, "rules", d.Rules) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DaprSubscriptionRoutes. -func (d *DaprSubscriptionRoutes) UnmarshalJSON(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 "default": - err = unpopulate(val, "Default", &d.Default) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &d.Rules) - 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 DaprSubscriptionsCollection. -func (d DaprSubscriptionsCollection) 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 DaprSubscriptionsCollection. -func (d *DaprSubscriptionsCollection) UnmarshalJSON(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 DataDogConfiguration. -func (d DataDogConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "key", d.Key) - populate(objectMap, "site", d.Site) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataDogConfiguration. -func (d *DataDogConfiguration) UnmarshalJSON(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 "key": - err = unpopulate(val, "Key", &d.Key) - delete(rawMsg, key) - case "site": - err = unpopulate(val, "Site", &d.Site) - 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) - delete(rawMsg, key) - case "allowedPrincipals": - err = unpopulate(val, "AllowedPrincipals", &d.AllowedPrincipals) - 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 DefaultErrorResponse. -func (d DefaultErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", d.Error) - return json.Marshal(objectMap) -} - -// 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &d.Error) - 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) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &d.Details) - delete(rawMsg, key) - case "innererror": - err = unpopulate(val, "Innererror", &d.Innererror) - delete(rawMsg, key) - 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 DefaultErrorResponseErrorDetailsItem. -func (d DefaultErrorResponseErrorDetailsItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - 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 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", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "code": - err = unpopulate(val, "Code", &d.Code) - delete(rawMsg, key) - 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 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) + 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 HTTPConnectionPool. -func (h *HTTPConnectionPool) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "http1MaxPendingRequests": - err = unpopulate(val, "HTTP1MaxPendingRequests", &h.HTTP1MaxPendingRequests) + case "code": + err = unpopulate(val, "Code", &d.Code) delete(rawMsg, key) - case "http2MaxRequests": - err = unpopulate(val, "HTTP2MaxRequests", &h.HTTP2MaxRequests) + case "details": + err = unpopulate(val, "Details", &d.Details) 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) + case "innererror": + err = unpopulate(val, "Innererror", &d.Innererror) delete(rawMsg, key) - case "headers": - err = unpopulate(val, "Headers", &h.Headers) + case "message": + err = unpopulate(val, "Message", &d.Message) delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &h.URL) + case "target": + err = unpopulate(val, "Target", &d.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HTTPRetryPolicy. -func (h HTTPRetryPolicy) 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, "matches", h.Matches) - populate(objectMap, "maxRetries", h.MaxRetries) - populate(objectMap, "retryBackOff", h.RetryBackOff) + 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 HTTPRetryPolicy. -func (h *HTTPRetryPolicy) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "matches": - err = unpopulate(val, "Matches", &h.Matches) + case "code": + err = unpopulate(val, "Code", &d.Code) delete(rawMsg, key) - case "maxRetries": - err = unpopulate(val, "MaxRetries", &h.MaxRetries) + case "message": + err = unpopulate(val, "Message", &d.Message) delete(rawMsg, key) - case "retryBackOff": - err = unpopulate(val, "RetryBackOff", &h.RetryBackOff) + case "target": + err = unpopulate(val, "Target", &d.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HTTPRetryPolicyMatches. -func (h HTTPRetryPolicyMatches) 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, "errors", h.Errors) - populate(objectMap, "httpStatusCodes", h.HTTPStatusCodes) - populate(objectMap, "headers", h.Headers) + populate(objectMap, "propertyBag", d.PropertyBag) + populate(objectMap, "providerName", d.ProviderName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRetryPolicyMatches. -func (h *HTTPRetryPolicyMatches) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &d.PropertyBag) delete(rawMsg, key) - case "headers": - err = unpopulate(val, "Headers", &h.Headers) + case "providerName": + err = unpopulate(val, "ProviderName", &d.ProviderName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HTTPRetryPolicyRetryBackOff. -func (h HTTPRetryPolicyRetryBackOff) 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, "initialDelayInMilliseconds", h.InitialDelayInMilliseconds) - populate(objectMap, "maxIntervalInMilliseconds", h.MaxIntervalInMilliseconds) + populate(objectMap, "name", d.Name) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPRetryPolicyRetryBackOff. -func (h *HTTPRetryPolicyRetryBackOff) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "initialDelayInMilliseconds": - err = unpopulate(val, "InitialDelayInMilliseconds", &h.InitialDelayInMilliseconds) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "maxIntervalInMilliseconds": - err = unpopulate(val, "MaxIntervalInMilliseconds", &h.MaxIntervalInMilliseconds) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HTTPScaleRule. -func (h HTTPScaleRule) 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, "auth", h.Auth) - populate(objectMap, "identity", h.Identity) - populate(objectMap, "metadata", h.Metadata) + 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 HTTPScaleRule. -func (h *HTTPScaleRule) 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", h, 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", &h.Auth) + case "columnName": + err = unpopulate(val, "ColumnName", &d.ColumnName) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &h.Identity) + case "columnType": + err = unpopulate(val, "ColumnType", &d.ColumnType) delete(rawMsg, key) - case "metadata": - err = unpopulate(val, "Metadata", &h.Metadata) + case "dataType": + err = unpopulate(val, "DataType", &d.DataType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HTTPSettings. -func (h HTTPSettings) 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, "forwardProxy", h.ForwardProxy) - populate(objectMap, "requireHttps", h.RequireHTTPS) - populate(objectMap, "routes", h.Routes) + 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 HTTPSettings. -func (h *HTTPSettings) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "forwardProxy": - err = unpopulate(val, "ForwardProxy", &h.ForwardProxy) + case "columns": + err = unpopulate(val, "Columns", &d.Columns) delete(rawMsg, key) - case "requireHttps": - err = unpopulate(val, "RequireHTTPS", &h.RequireHTTPS) + case "rows": + err = unpopulate(val, "Rows", &d.Rows) delete(rawMsg, key) - case "routes": - err = unpopulate(val, "Routes", &h.Routes) + case "tableName": + err = unpopulate(val, "TableName", &d.TableName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HTTPSettingsRoutes. -func (h HTTPSettingsRoutes) 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, "apiPrefix", h.APIPrefix) + 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 HTTPSettingsRoutes. -func (h *HTTPSettingsRoutes) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "apiPrefix": - err = unpopulate(val, "APIPrefix", &h.APIPrefix) + 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Header. -func (h Header) 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, "key", h.Key) - populate(objectMap, "value", h.Value) + populate(objectMap, "id", d.ID) + populate(objectMap, "pesId", d.PesID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Header. -func (h *Header) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "key": - err = unpopulate(val, "Key", &h.Key) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &h.Value) + case "pesId": + err = unpopulate(val, "PesID", &d.PesID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HeaderMatch. -func (h HeaderMatch) 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, "header", h.Header) - populate(objectMap, "match", h.Match) + 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 HeaderMatch. -func (h *HeaderMatch) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "header": - err = unpopulate(val, "Header", &h.Header) + 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 "match": - err = unpopulate(val, "Match", &h.Match) + 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HeaderMatchMatch. -func (h HeaderMatchMatch) 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, "exactMatch", h.ExactMatch) - populate(objectMap, "prefixMatch", h.PrefixMatch) - populate(objectMap, "regexMatch", h.RegexMatch) - populate(objectMap, "suffixMatch", h.SuffixMatch) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HeaderMatchMatch. -func (h *HeaderMatchMatch) 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", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "suffixMatch": - err = unpopulate(val, "SuffixMatch", &h.SuffixMatch) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IPSecurityRestrictionRule. -func (i IPSecurityRestrictionRule) 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, "action", i.Action) - populate(objectMap, "description", i.Description) - populate(objectMap, "ipAddressRange", i.IPAddressRange) - populate(objectMap, "name", i.Name) + populate(objectMap, "renderingProperties", d.RenderingProperties) + populate(objectMap, "table", d.Table) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IPSecurityRestrictionRule. -func (i *IPSecurityRestrictionRule) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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) + case "renderingProperties": + err = unpopulate(val, "RenderingProperties", &d.RenderingProperties) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) + case "table": + err = unpopulate(val, "Table", &d.Table) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentityProviders. -func (i IdentityProviders) 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, "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) + 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 IdentityProviders. -func (i *IdentityProviders) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "apple": - err = unpopulate(val, "Apple", &i.Apple) + case "analysisTypes": + err = unpopulate(val, "AnalysisTypes", &d.AnalysisTypes) delete(rawMsg, key) - case "azureActiveDirectory": - err = unpopulate(val, "AzureActiveDirectory", &i.AzureActiveDirectory) + case "author": + err = unpopulate(val, "Author", &d.Author) delete(rawMsg, key) - case "azureStaticWebApps": - err = unpopulate(val, "AzureStaticWebApps", &i.AzureStaticWebApps) + case "category": + err = unpopulate(val, "Category", &d.Category) delete(rawMsg, key) - case "customOpenIdConnectProviders": - err = unpopulate(val, "CustomOpenIDConnectProviders", &i.CustomOpenIDConnectProviders) + case "description": + err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "facebook": - err = unpopulate(val, "Facebook", &i.Facebook) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "gitHub": - err = unpopulate(val, "GitHub", &i.GitHub) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "google": - err = unpopulate(val, "Google", &i.Google) + case "score": + err = unpopulate(val, "Score", &d.Score) delete(rawMsg, key) - case "twitter": - err = unpopulate(val, "Twitter", &i.Twitter) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IdentitySettings. -func (i IdentitySettings) 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, "identity", i.Identity) - populate(objectMap, "lifecycle", i.Lifecycle) + 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 IdentitySettings. -func (i *IdentitySettings) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "identity": - err = unpopulate(val, "Identity", &i.Identity) + case "dataProviderMetadata": + err = unpopulate(val, "DataProviderMetadata", &d.DataProviderMetadata) delete(rawMsg, key) - case "lifecycle": - err = unpopulate(val, "Lifecycle", &i.Lifecycle) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Ingress. -func (i Ingress) 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, "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) + populate(objectMap, "message", d.Message) + populate(objectMap, "statusId", d.StatusID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Ingress. -func (i *Ingress) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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) + case "message": + err = unpopulate(val, "Message", &d.Message) delete(rawMsg, key) - case "transport": - err = unpopulate(val, "Transport", &i.Transport) + case "statusId": + err = unpopulate(val, "StatusID", &d.StatusID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IngressPortMapping. -func (i IngressPortMapping) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DynamicPoolConfiguration. +func (d DynamicPoolConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "exposedPort", i.ExposedPort) - populate(objectMap, "external", i.External) - populate(objectMap, "targetPort", i.TargetPort) + populate(objectMap, "lifecycleConfiguration", d.LifecycleConfiguration) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IngressPortMapping. -func (i *IngressPortMapping) UnmarshalJSON(data []byte) error { +// 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, 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) + case "lifecycleConfiguration": + err = unpopulate(val, "LifecycleConfiguration", &d.LifecycleConfiguration) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IngressStickySessions. -func (i IngressStickySessions) 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, "affinity", i.Affinity) + populate(objectMap, "containerAppAuthEncryptionSecretName", e.ContainerAppAuthEncryptionSecretName) + populate(objectMap, "containerAppAuthSigningSecretName", e.ContainerAppAuthSigningSecretName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IngressStickySessions. -func (i *IngressStickySessions) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "affinity": - err = unpopulate(val, "Affinity", &i.Affinity) + 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InitContainer. -func (i InitContainer) 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, "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) + 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 InitContainer. -func (i *InitContainer) 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", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, 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) + case "id": + err = unpopulate(val, "ID", &e.ID) delete(rawMsg, key) - case "env": - err = unpopulate(val, "Env", &i.Env) + case "location": + err = unpopulate(val, "Location", &e.Location) delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &i.Image) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "imageType": - err = unpopulate(val, "ImageType", &i.ImageType) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &i.Resources) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) delete(rawMsg, key) - case "volumeMounts": - err = unpopulate(val, "VolumeMounts", &i.VolumeMounts) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JavaComponent. -func (j JavaComponent) 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, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "systemData", j.SystemData) - populate(objectMap, "type", j.Type) + populateDateTimeRFC3339(objectMap, "expires", e.Expires) + populate(objectMap, "token", e.Token) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JavaComponent. -func (j *JavaComponent) 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", j, err) + 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", &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) + case "expires": + err = unpopulateDateTimeRFC3339(val, "Expires", &e.Expires) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) + case "token": + err = unpopulate(val, "Token", &e.Token) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JavaComponentConfigurationProperty. -func (j JavaComponentConfigurationProperty) 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, "propertyName", j.PropertyName) - populate(objectMap, "value", j.Value) + 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 JavaComponentConfigurationProperty. -func (j *JavaComponentConfigurationProperty) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "propertyName": - err = unpopulate(val, "PropertyName", &j.PropertyName) + 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", &j.Value) + err = unpopulate(val, "Value", &e.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JavaComponentIngress. -func (j JavaComponentIngress) 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, "fqdn", j.Fqdn) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JavaComponentIngress. -func (j *JavaComponentIngress) UnmarshalJSON(data []byte) error { +// 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "fqdn": - err = unpopulate(val, "Fqdn", &j.Fqdn) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JavaComponentProperties. -func (j JavaComponentProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) 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) + 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 JavaComponentProperties. -func (j *JavaComponentProperties) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "componentType": - err = unpopulate(val, "ComponentType", &j.ComponentType) + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) delete(rawMsg, key) - case "configurations": - err = unpopulate(val, "Configurations", &j.Configurations) + case "code": + err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &j.ProvisioningState) + case "details": + err = unpopulate(val, "Details", &e.Details) delete(rawMsg, key) - case "scale": - err = unpopulate(val, "Scale", &j.Scale) + case "message": + err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) - case "serviceBinds": - err = unpopulate(val, "ServiceBinds", &j.ServiceBinds) + case "target": + err = unpopulate(val, "Target", &e.Target) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JavaComponentPropertiesScale. -func (j JavaComponentPropertiesScale) 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, "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 ExtendedLocation. +func (e ExtendedLocation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "maxReplicas", j.MaxReplicas) - populate(objectMap, "minReplicas", j.MinReplicas) + populate(objectMap, "name", e.Name) + populate(objectMap, "type", e.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JavaComponentPropertiesScale. -func (j *JavaComponentPropertiesScale) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "maxReplicas": - err = unpopulate(val, "MaxReplicas", &j.MaxReplicas) + case "name": + err = unpopulate(val, "Name", &e.Name) delete(rawMsg, key) - case "minReplicas": - err = unpopulate(val, "MinReplicas", &j.MinReplicas) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JavaComponentServiceBind. -func (j JavaComponentServiceBind) 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", j.Name) - populate(objectMap, "serviceId", j.ServiceID) + 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 JavaComponentServiceBind. -func (j *JavaComponentServiceBind) 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", j, 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", &j.Name) + case "enabled": + err = unpopulate(val, "Enabled", &f.Enabled) delete(rawMsg, key) - case "serviceId": - err = unpopulate(val, "ServiceID", &j.ServiceID) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JavaComponentsCollection. -func (j JavaComponentsCollection) 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, "nextLink", j.NextLink) - populate(objectMap, "value", j.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 JavaComponentsCollection. -func (j *JavaComponentsCollection) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &j.NextLink) + case "convention": + err = unpopulate(val, "Convention", &f.Convention) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &j.Value) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Job. -func (j Job) 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, "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) + 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 Job. -func (j *Job) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", g, 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) + case "enabled": + err = unpopulate(val, "Enabled", &g.Enabled) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &j.Tags) + case "login": + err = unpopulate(val, "Login", &g.Login) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) + case "registration": + err = unpopulate(val, "Registration", &g.Registration) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobConfiguration. -func (j JobConfiguration) 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, "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) + 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 JobConfiguration. -func (j *JobConfiguration) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "eventTriggerConfig": - err = unpopulate(val, "EventTriggerConfig", &j.EventTriggerConfig) + case "azureCredentials": + err = unpopulate(val, "AzureCredentials", &g.AzureCredentials) delete(rawMsg, key) - case "identitySettings": - err = unpopulate(val, "IdentitySettings", &j.IdentitySettings) + case "contextPath": + err = unpopulate(val, "ContextPath", &g.ContextPath) delete(rawMsg, key) - case "manualTriggerConfig": - err = unpopulate(val, "ManualTriggerConfig", &j.ManualTriggerConfig) + case "githubPersonalAccessToken": + err = unpopulate(val, "GithubPersonalAccessToken", &g.GithubPersonalAccessToken) delete(rawMsg, key) - case "registries": - err = unpopulate(val, "Registries", &j.Registries) + case "image": + err = unpopulate(val, "Image", &g.Image) delete(rawMsg, key) - case "replicaRetryLimit": - err = unpopulate(val, "ReplicaRetryLimit", &j.ReplicaRetryLimit) + case "os": + err = unpopulate(val, "OS", &g.OS) delete(rawMsg, key) - case "replicaTimeout": - err = unpopulate(val, "ReplicaTimeout", &j.ReplicaTimeout) + case "publishType": + err = unpopulate(val, "PublishType", &g.PublishType) delete(rawMsg, key) - case "scheduleTriggerConfig": - err = unpopulate(val, "ScheduleTriggerConfig", &j.ScheduleTriggerConfig) + case "registryInfo": + err = unpopulate(val, "RegistryInfo", &g.RegistryInfo) delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &j.Secrets) + case "runtimeStack": + err = unpopulate(val, "RuntimeStack", &g.RuntimeStack) delete(rawMsg, key) - case "triggerType": - err = unpopulate(val, "TriggerType", &j.TriggerType) + case "runtimeVersion": + err = unpopulate(val, "RuntimeVersion", &g.RuntimeVersion) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobConfigurationEventTriggerConfig. -func (j JobConfigurationEventTriggerConfig) 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, "parallelism", j.Parallelism) - populate(objectMap, "replicaCompletionCount", j.ReplicaCompletionCount) - populate(objectMap, "scale", j.Scale) + 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 JobConfigurationEventTriggerConfig. -func (j *JobConfigurationEventTriggerConfig) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "parallelism": - err = unpopulate(val, "Parallelism", &j.Parallelism) + case "excludedPaths": + err = unpopulate(val, "ExcludedPaths", &g.ExcludedPaths) delete(rawMsg, key) - case "replicaCompletionCount": - err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) + case "redirectToProvider": + err = unpopulate(val, "RedirectToProvider", &g.RedirectToProvider) delete(rawMsg, key) - case "scale": - err = unpopulate(val, "Scale", &j.Scale) + case "unauthenticatedClientAction": + err = unpopulate(val, "UnauthenticatedClientAction", &g.UnauthenticatedClientAction) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobConfigurationManualTriggerConfig. -func (j JobConfigurationManualTriggerConfig) 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, "parallelism", j.Parallelism) - populate(objectMap, "replicaCompletionCount", j.ReplicaCompletionCount) + 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 JobConfigurationManualTriggerConfig. -func (j *JobConfigurationManualTriggerConfig) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "parallelism": - err = unpopulate(val, "Parallelism", &j.Parallelism) + case "enabled": + err = unpopulate(val, "Enabled", &g.Enabled) delete(rawMsg, key) - case "replicaCompletionCount": - err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobConfigurationScheduleTriggerConfig. -func (j JobConfigurationScheduleTriggerConfig) 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, "cronExpression", j.CronExpression) - populate(objectMap, "parallelism", j.Parallelism) - populate(objectMap, "replicaCompletionCount", j.ReplicaCompletionCount) + 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 JobConfigurationScheduleTriggerConfig. -func (j *JobConfigurationScheduleTriggerConfig) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { - case "cronExpression": - err = unpopulate(val, "CronExpression", &j.CronExpression) + case "auth": + err = unpopulate(val, "Auth", &h.Auth) delete(rawMsg, key) - case "parallelism": - err = unpopulate(val, "Parallelism", &j.Parallelism) + case "identity": + err = unpopulate(val, "Identity", &h.Identity) delete(rawMsg, key) - case "replicaCompletionCount": - err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) + case "metadata": + err = unpopulate(val, "Metadata", &h.Metadata) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobExecution. -func (j JobExecution) 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, "id", j.ID) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "type", j.Type) + 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 JobExecution. -func (j *JobExecution) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", h, 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) + case "forwardProxy": + err = unpopulate(val, "ForwardProxy", &h.ForwardProxy) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &j.Properties) + case "requireHttps": + err = unpopulate(val, "RequireHTTPS", &h.RequireHTTPS) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) + case "routes": + err = unpopulate(val, "Routes", &h.Routes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobExecutionBase. -func (j JobExecutionBase) 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, "id", j.ID) - populate(objectMap, "name", j.Name) + populate(objectMap, "apiPrefix", h.APIPrefix) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionBase. -func (j *JobExecutionBase) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", h, 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) + case "apiPrefix": + err = unpopulate(val, "APIPrefix", &h.APIPrefix) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobExecutionContainer. -func (j JobExecutionContainer) 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, "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) + 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 JobExecutionContainer. -func (j *JobExecutionContainer) 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", j, err) + 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", &j.Args) - delete(rawMsg, key) - case "command": - err = unpopulate(val, "Command", &j.Command) + case "action": + err = unpopulate(val, "Action", &i.Action) delete(rawMsg, key) - case "env": - err = unpopulate(val, "Env", &j.Env) + case "description": + err = unpopulate(val, "Description", &i.Description) delete(rawMsg, key) - case "image": - err = unpopulate(val, "Image", &j.Image) + case "ipAddressRange": + err = unpopulate(val, "IPAddressRange", &i.IPAddressRange) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &j.Name) - delete(rawMsg, key) - case "resources": - err = unpopulate(val, "Resources", &j.Resources) + err = unpopulate(val, "Name", &i.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobExecutionNamesCollection. -func (j JobExecutionNamesCollection) 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, "value", j.Value) + 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 JobExecutionNamesCollection. -func (j *JobExecutionNamesCollection) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &j.Value) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobExecutionProperties. -func (j JobExecutionProperties) 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, "detailedStatus", j.DetailedStatus) - populateDateTimeRFC3339(objectMap, "endTime", j.EndTime) - populateDateTimeRFC3339(objectMap, "startTime", j.StartTime) - populate(objectMap, "status", j.Status) - populate(objectMap, "template", j.Template) + 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 JobExecutionProperties. -func (j *JobExecutionProperties) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "detailedStatus": - err = unpopulate(val, "DetailedStatus", &j.DetailedStatus) + case "additionalPortMappings": + err = unpopulate(val, "AdditionalPortMappings", &i.AdditionalPortMappings) delete(rawMsg, key) - case "endTime": - err = unpopulateDateTimeRFC3339(val, "EndTime", &j.EndTime) + case "allowInsecure": + err = unpopulate(val, "AllowInsecure", &i.AllowInsecure) delete(rawMsg, key) - case "startTime": - err = unpopulateDateTimeRFC3339(val, "StartTime", &j.StartTime) + case "clientCertificateMode": + err = unpopulate(val, "ClientCertificateMode", &i.ClientCertificateMode) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) + case "corsPolicy": + err = unpopulate(val, "CorsPolicy", &i.CorsPolicy) delete(rawMsg, key) - case "template": - err = unpopulate(val, "Template", &j.Template) + 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 "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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobExecutionTemplate. -func (j JobExecutionTemplate) 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, "containers", j.Containers) - populate(objectMap, "initContainers", j.InitContainers) + 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 JobExecutionTemplate. -func (j *JobExecutionTemplate) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "containers": - err = unpopulate(val, "Containers", &j.Containers) + case "exposedPort": + err = unpopulate(val, "ExposedPort", &i.ExposedPort) delete(rawMsg, key) - case "initContainers": - err = unpopulate(val, "InitContainers", &j.InitContainers) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobPatchProperties. -func (j JobPatchProperties) 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, "extendedLocation", j.ExtendedLocation) - populate(objectMap, "identity", j.Identity) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "tags", j.Tags) + populate(objectMap, "affinity", i.Affinity) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobPatchProperties. -func (j *JobPatchProperties) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", i, 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) + case "affinity": + err = unpopulate(val, "Affinity", &i.Affinity) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobPatchPropertiesProperties. -func (j JobPatchPropertiesProperties) 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, "configuration", j.Configuration) - populate(objectMap, "environmentId", j.EnvironmentID) - populate(objectMap, "eventStreamEndpoint", j.EventStreamEndpoint) - populate(objectMap, "outboundIpAddresses", j.OutboundIPAddresses) - populate(objectMap, "template", j.Template) + 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 JobPatchPropertiesProperties. -func (j *JobPatchPropertiesProperties) 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "configuration": - err = unpopulate(val, "Configuration", &j.Configuration) + case "args": + err = unpopulate(val, "Args", &i.Args) delete(rawMsg, key) - case "environmentId": - err = unpopulate(val, "EnvironmentID", &j.EnvironmentID) + case "command": + err = unpopulate(val, "Command", &i.Command) delete(rawMsg, key) - case "eventStreamEndpoint": - err = unpopulate(val, "EventStreamEndpoint", &j.EventStreamEndpoint) + case "env": + err = unpopulate(val, "Env", &i.Env) delete(rawMsg, key) - case "outboundIpAddresses": - err = unpopulate(val, "OutboundIPAddresses", &j.OutboundIPAddresses) + case "image": + err = unpopulate(val, "Image", &i.Image) delete(rawMsg, key) - case "template": - err = unpopulate(val, "Template", &j.Template) + 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", j, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobProperties. -func (j JobProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JavaComponent. +func (j JavaComponent) 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) + 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 JobProperties. -func (j *JobProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -7324,29 +4412,20 @@ func (j *JobProperties) UnmarshalJSON(data []byte) error { 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) + case "id": + err = unpopulate(val, "ID", &j.ID) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &j.ProvisioningState) + case "name": + err = unpopulate(val, "Name", &j.Name) delete(rawMsg, key) - case "runningState": - err = unpopulate(val, "RunningState", &j.RunningState) + case "properties": + j.Properties, err = unmarshalJavaComponentPropertiesClassification(val) delete(rawMsg, key) - case "template": - err = unpopulate(val, "Template", &j.Template) + case "systemData": + err = unpopulate(val, "SystemData", &j.SystemData) delete(rawMsg, key) - case "workloadProfileName": - err = unpopulate(val, "WorkloadProfileName", &j.WorkloadProfileName) + case "type": + err = unpopulate(val, "Type", &j.Type) delete(rawMsg, key) } if err != nil { @@ -7356,18 +4435,16 @@ func (j *JobProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type JobScale. -func (j JobScale) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JavaComponentConfigurationProperty. +func (j JavaComponentConfigurationProperty) 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) + populate(objectMap, "propertyName", j.PropertyName) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobScale. -func (j *JobScale) UnmarshalJSON(data []byte) error { +// 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) @@ -7375,17 +4452,11 @@ func (j *JobScale) UnmarshalJSON(data []byte) error { 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) + case "propertyName": + err = unpopulate(val, "PropertyName", &j.PropertyName) delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &j.Rules) + case "value": + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { @@ -7395,19 +4466,15 @@ func (j *JobScale) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type JobScaleRule. -func (j JobScaleRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JavaComponentIngress. +func (j JavaComponentIngress) 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) + populate(objectMap, "fqdn", j.Fqdn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobScaleRule. -func (j *JobScaleRule) UnmarshalJSON(data []byte) error { +// 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) @@ -7415,20 +4482,8 @@ func (j *JobScaleRule) UnmarshalJSON(data []byte) error { 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) + case "fqdn": + err = unpopulate(val, "Fqdn", &j.Fqdn) delete(rawMsg, key) } if err != nil { @@ -7438,15 +4493,19 @@ func (j *JobScaleRule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type JobSecretsCollection. -func (j JobSecretsCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JavaComponentProperties. +func (j JavaComponentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", j.Value) + 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 JobSecretsCollection. -func (j *JobSecretsCollection) UnmarshalJSON(data []byte) error { +// 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) @@ -7454,8 +4513,20 @@ func (j *JobSecretsCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &j.Value) + 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 { @@ -7465,17 +4536,16 @@ func (j *JobSecretsCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type JobTemplate. -func (j JobTemplate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JavaComponentPropertiesScale. +func (j JavaComponentPropertiesScale) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "containers", j.Containers) - populate(objectMap, "initContainers", j.InitContainers) - populate(objectMap, "volumes", j.Volumes) + populate(objectMap, "maxReplicas", j.MaxReplicas) + populate(objectMap, "minReplicas", j.MinReplicas) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobTemplate. -func (j *JobTemplate) UnmarshalJSON(data []byte) error { +// 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) @@ -7483,14 +4553,11 @@ func (j *JobTemplate) UnmarshalJSON(data []byte) error { 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) + case "maxReplicas": + err = unpopulate(val, "MaxReplicas", &j.MaxReplicas) delete(rawMsg, key) - case "volumes": - err = unpopulate(val, "Volumes", &j.Volumes) + case "minReplicas": + err = unpopulate(val, "MinReplicas", &j.MinReplicas) delete(rawMsg, key) } if err != nil { @@ -7500,16 +4567,16 @@ func (j *JobTemplate) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type JobsCollection. -func (j JobsCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JavaComponentServiceBind. +func (j JavaComponentServiceBind) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", j.NextLink) - populate(objectMap, "value", j.Value) + populate(objectMap, "name", j.Name) + populate(objectMap, "serviceId", j.ServiceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobsCollection. -func (j *JobsCollection) UnmarshalJSON(data []byte) error { +// 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) @@ -7517,11 +4584,11 @@ func (j *JobsCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &j.NextLink) + case "name": + err = unpopulate(val, "Name", &j.Name) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &j.Value) + case "serviceId": + err = unpopulate(val, "ServiceID", &j.ServiceID) delete(rawMsg, key) } if err != nil { @@ -7531,16 +4598,16 @@ func (j *JobsCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type JwtClaimChecks. -func (j JwtClaimChecks) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JavaComponentsCollection. +func (j JavaComponentsCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowedClientApplications", j.AllowedClientApplications) - populate(objectMap, "allowedGroups", j.AllowedGroups) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JwtClaimChecks. -func (j *JwtClaimChecks) UnmarshalJSON(data []byte) error { +// 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) @@ -7548,11 +4615,11 @@ func (j *JwtClaimChecks) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "allowedClientApplications": - err = unpopulate(val, "AllowedClientApplications", &j.AllowedClientApplications) + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) delete(rawMsg, key) - case "allowedGroups": - err = unpopulate(val, "AllowedGroups", &j.AllowedGroups) + case "value": + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { @@ -7562,1886 +4629,1882 @@ func (j *JwtClaimChecks) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type KedaConfiguration. -func (k KedaConfiguration) 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, "version", k.Version) + 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 KedaConfiguration. -func (k *KedaConfiguration) 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", k, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "version": - err = unpopulate(val, "Version", &k.Version) + 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", k, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ListUsagesResult. -func (l ListUsagesResult) 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", l.NextLink) - populate(objectMap, "value", l.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 ListUsagesResult. -func (l *ListUsagesResult) 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", l, 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", &l.NextLink) + case "eventTriggerConfig": + err = unpopulate(val, "EventTriggerConfig", &j.EventTriggerConfig) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &l.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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsConfiguration. -func (l LogAnalyticsConfiguration) 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, "customerId", l.CustomerID) - populate(objectMap, "dynamicJsonColumns", l.DynamicJSONColumns) - populate(objectMap, "sharedKey", l.SharedKey) + 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 LogAnalyticsConfiguration. -func (l *LogAnalyticsConfiguration) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "customerId": - err = unpopulate(val, "CustomerID", &l.CustomerID) + case "parallelism": + err = unpopulate(val, "Parallelism", &j.Parallelism) delete(rawMsg, key) - case "dynamicJsonColumns": - err = unpopulate(val, "DynamicJSONColumns", &l.DynamicJSONColumns) + case "replicaCompletionCount": + err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) delete(rawMsg, key) - case "sharedKey": - err = unpopulate(val, "SharedKey", &l.SharedKey) + case "scale": + err = unpopulate(val, "Scale", &j.Scale) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LoggerSetting. -func (l LoggerSetting) 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, "level", l.Level) - populate(objectMap, "logger", l.Logger) + populate(objectMap, "parallelism", j.Parallelism) + populate(objectMap, "replicaCompletionCount", j.ReplicaCompletionCount) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerSetting. -func (l *LoggerSetting) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "level": - err = unpopulate(val, "Level", &l.Level) + case "parallelism": + err = unpopulate(val, "Parallelism", &j.Parallelism) delete(rawMsg, key) - case "logger": - err = unpopulate(val, "Logger", &l.Logger) + case "replicaCompletionCount": + err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LogicApp. -func (l LogicApp) 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, "id", l.ID) - populate(objectMap, "name", l.Name) - populateAny(objectMap, "properties", l.Properties) - populate(objectMap, "systemData", l.SystemData) - populate(objectMap, "type", l.Type) + 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 LogicApp. -func (l *LogicApp) 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", l, err) + 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", &l.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &l.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &l.Properties) + case "cronExpression": + err = unpopulate(val, "CronExpression", &j.CronExpression) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &l.SystemData) + case "parallelism": + err = unpopulate(val, "Parallelism", &j.Parallelism) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &l.Type) + case "replicaCompletionCount": + err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Login. -func (l Login) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type JobExecution. +func (j JobExecution) 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) + 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 Login. -func (l *Login) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, 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) + case "id": + err = unpopulate(val, "ID", &j.ID) delete(rawMsg, key) - case "preserveUrlFragmentsForLogins": - err = unpopulate(val, "PreserveURLFragmentsForLogins", &l.PreserveURLFragmentsForLogins) + case "name": + err = unpopulate(val, "Name", &j.Name) delete(rawMsg, key) - case "routes": - err = unpopulate(val, "Routes", &l.Routes) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) delete(rawMsg, key) - case "tokenStore": - err = unpopulate(val, "TokenStore", &l.TokenStore) + case "type": + err = unpopulate(val, "Type", &j.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LoginRoutes. -func (l LoginRoutes) 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, "logoutEndpoint", l.LogoutEndpoint) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LoginRoutes. -func (l *LoginRoutes) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "logoutEndpoint": - err = unpopulate(val, "LogoutEndpoint", &l.LogoutEndpoint) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LoginScopes. -func (l LoginScopes) 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, "scopes", l.Scopes) + 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 LoginScopes. -func (l *LoginScopes) 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "scopes": - err = unpopulate(val, "Scopes", &l.Scopes) + 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", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LogsConfiguration. -func (l LogsConfiguration) 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, "destinations", l.Destinations) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LogsConfiguration. -func (l *LogsConfiguration) 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", l, 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", &l.Destinations) + case "value": + err = unpopulate(val, "Value", &j.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedCertificate. -func (m ManagedCertificate) 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, "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) + 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 ManagedCertificate. -func (m *ManagedCertificate) 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", m, err) + 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", &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) + case "endTime": + err = unpopulateDateTimeRFC3339(val, "EndTime", &j.EndTime) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + case "startTime": + err = unpopulateDateTimeRFC3339(val, "StartTime", &j.StartTime) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + case "status": + err = unpopulate(val, "Status", &j.Status) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "template": + err = unpopulate(val, "Template", &j.Template) 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 ManagedCertificateCollection. -func (m ManagedCertificateCollection) 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, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) + populate(objectMap, "containers", j.Containers) + populate(objectMap, "initContainers", j.InitContainers) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificateCollection. -func (m *ManagedCertificateCollection) 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", 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 "containers": + err = unpopulate(val, "Containers", &j.Containers) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "initContainers": + err = unpopulate(val, "InitContainers", &j.InitContainers) 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 ManagedCertificatePatch. -func (m ManagedCertificatePatch) 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, "tags", m.Tags) + 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 ManagedCertificatePatch. -func (m *ManagedCertificatePatch) 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch 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", &m.Tags) + err = unpopulate(val, "Tags", &j.Tags) 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 ManagedCertificateProperties. -func (m ManagedCertificateProperties) 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, "domainControlValidation", m.DomainControlValidation) - populate(objectMap, "error", m.Error) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "subjectName", m.SubjectName) - populate(objectMap, "validationToken", m.ValidationToken) + 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 ManagedCertificateProperties. -func (m *ManagedCertificateProperties) 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "domainControlValidation": - err = unpopulate(val, "DomainControlValidation", &m.DomainControlValidation) + case "configuration": + err = unpopulate(val, "Configuration", &j.Configuration) delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &m.Error) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &j.EnvironmentID) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + case "eventStreamEndpoint": + err = unpopulate(val, "EventStreamEndpoint", &j.EventStreamEndpoint) delete(rawMsg, key) - case "subjectName": - err = unpopulate(val, "SubjectName", &m.SubjectName) + case "outboundIpAddresses": + err = unpopulate(val, "OutboundIPAddresses", &j.OutboundIPAddresses) delete(rawMsg, key) - case "validationToken": - err = unpopulate(val, "ValidationToken", &m.ValidationToken) + case "template": + err = unpopulate(val, "Template", &j.Template) 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 ManagedEnvironment. -func (m ManagedEnvironment) 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, "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) + 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 ManagedEnvironment. -func (m *ManagedEnvironment) 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", m, err) + 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", &m.ID) - delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &m.Identity) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &m.Kind) + case "configuration": + err = unpopulate(val, "Configuration", &j.Configuration) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &m.Location) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &j.EnvironmentID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "eventStreamEndpoint": + err = unpopulate(val, "EventStreamEndpoint", &j.EventStreamEndpoint) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "outboundIpAddresses": + err = unpopulate(val, "OutboundIPAddresses", &j.OutboundIPAddresses) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &j.ProvisioningState) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &m.Tags) + case "template": + err = unpopulate(val, "Template", &j.Template) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "workloadProfileName": + err = unpopulate(val, "WorkloadProfileName", &j.WorkloadProfileName) 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 ManagedEnvironmentProperties. -func (m ManagedEnvironmentProperties) 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, "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) + 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 ManagedEnvironmentProperties. -func (m *ManagedEnvironmentProperties) 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, 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) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &m.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &m.PublicNetworkAccess) - delete(rawMsg, key) - case "staticIp": - err = unpopulate(val, "StaticIP", &m.StaticIP) + case "maxExecutions": + err = unpopulate(val, "MaxExecutions", &j.MaxExecutions) delete(rawMsg, key) - case "vnetConfiguration": - err = unpopulate(val, "VnetConfiguration", &m.VnetConfiguration) + case "minExecutions": + err = unpopulate(val, "MinExecutions", &j.MinExecutions) delete(rawMsg, key) - case "workloadProfiles": - err = unpopulate(val, "WorkloadProfiles", &m.WorkloadProfiles) + case "pollingInterval": + err = unpopulate(val, "PollingInterval", &j.PollingInterval) delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) + case "rules": + err = unpopulate(val, "Rules", &j.Rules) 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 ManagedEnvironmentPropertiesPeerAuthentication. -func (m ManagedEnvironmentPropertiesPeerAuthentication) 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, "mtls", m.Mtls) + 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 ManagedEnvironmentPropertiesPeerAuthentication. -func (m *ManagedEnvironmentPropertiesPeerAuthentication) 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "mtls": - err = unpopulate(val, "Mtls", &m.Mtls) + 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentPropertiesPeerTrafficConfiguration. -func (m ManagedEnvironmentPropertiesPeerTrafficConfiguration) 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, "encryption", m.Encryption) + populate(objectMap, "value", j.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironmentPropertiesPeerTrafficConfiguration. -func (m *ManagedEnvironmentPropertiesPeerTrafficConfiguration) 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "encryption": - err = unpopulate(val, "Encryption", &m.Encryption) + case "value": + err = unpopulate(val, "Value", &j.Value) 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 ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption. -func (m ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption) 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, "enabled", m.Enabled) + 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 ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption. -func (m *ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption) 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", 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 "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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, 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 JobsCollection. +func (j JobsCollection) 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, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) 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 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", m, err) + 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", &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) + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "value": + err = unpopulate(val, "Value", &j.Value) 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 ManagedEnvironmentStorageProperties. -func (m ManagedEnvironmentStorageProperties) 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, "azureFile", m.AzureFile) - populate(objectMap, "nfsAzureFile", m.NfsAzureFile) + populate(objectMap, "allowedClientApplications", j.AllowedClientApplications) + populate(objectMap, "allowedGroups", j.AllowedGroups) 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 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", j, err) } for key, val := range rawMsg { var err error switch key { - case "azureFile": - err = unpopulate(val, "AzureFile", &m.AzureFile) + case "allowedClientApplications": + err = unpopulate(val, "AllowedClientApplications", &j.AllowedClientApplications) delete(rawMsg, key) - case "nfsAzureFile": - err = unpopulate(val, "NfsAzureFile", &m.NfsAzureFile) + case "allowedGroups": + err = unpopulate(val, "AllowedGroups", &j.AllowedGroups) 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 ManagedEnvironmentStoragesCollection. -func (m ManagedEnvironmentStoragesCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type KedaConfiguration. +func (k KedaConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", m.Value) + populate(objectMap, "version", k.Version) 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 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &m.Value) + case "version": + err = unpopulate(val, "Version", &k.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", k, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentsCollection. -func (m ManagedEnvironmentsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) +// MarshalJSON implements the json.Marshaller interface for type LifecycleConfiguration. +func (l LifecycleConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cooldownPeriodInSeconds", l.CooldownPeriodInSeconds) + populate(objectMap, "lifecycleType", l.LifecycleType) + populate(objectMap, "maxAlivePeriodInSeconds", l.MaxAlivePeriodInSeconds) 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 LifecycleConfiguration. +func (l *LifecycleConfiguration) UnmarshalJSON(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", l, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &m.NextLink) + case "cooldownPeriodInSeconds": + err = unpopulate(val, "CooldownPeriodInSeconds", &l.CooldownPeriodInSeconds) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &m.Value) + case "lifecycleType": + err = unpopulate(val, "LifecycleType", &l.LifecycleType) + delete(rawMsg, key) + case "maxAlivePeriodInSeconds": + err = unpopulate(val, "MaxAlivePeriodInSeconds", &l.MaxAlivePeriodInSeconds) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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 ListUsagesResult. +func (l ListUsagesResult) 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, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) 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 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + case "value": + err = unpopulate(val, "Value", &l.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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 LogAnalyticsConfiguration. +func (l LogAnalyticsConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "destinations", m.Destinations) - populate(objectMap, "includeKeda", m.IncludeKeda) + populate(objectMap, "customerId", l.CustomerID) + populate(objectMap, "sharedKey", l.SharedKey) 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 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", m, err) + 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", &m.Destinations) + case "customerId": + err = unpopulate(val, "CustomerID", &l.CustomerID) delete(rawMsg, key) - case "includeKeda": - err = unpopulate(val, "IncludeKeda", &m.IncludeKeda) + case "sharedKey": + err = unpopulate(val, "SharedKey", &l.SharedKey) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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 Login. +func (l Login) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", m.Enabled) + 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 Mtls. -func (m *Mtls) 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, err) } for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &m.Enabled) + 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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 LoginRoutes. +func (l LoginRoutes) 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, "logoutEndpoint", l.LogoutEndpoint) 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 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) - delete(rawMsg, key) - case "scale": - err = unpopulate(val, "Scale", &n.Scale) - delete(rawMsg, key) - case "serviceBinds": - err = unpopulate(val, "ServiceBinds", &n.ServiceBinds) + case "logoutEndpoint": + err = unpopulate(val, "LogoutEndpoint", &l.LogoutEndpoint) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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 LoginScopes. +func (l LoginScopes) 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, "scopes", l.Scopes) 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 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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) - delete(rawMsg, key) - case "shareName": - err = unpopulate(val, "ShareName", &n.ShareName) + case "scopes": + err = unpopulate(val, "Scopes", &l.Scopes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", n, err) + return fmt.Errorf("unmarshalling type %T: %v", l, 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 ManagedCertificate. +func (m ManagedCertificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nonceExpirationInterval", n.NonceExpirationInterval) - populate(objectMap, "validateNonce", n.ValidateNonce) + 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 Nonce. -func (n *Nonce) 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "nonceExpirationInterval": - err = unpopulate(val, "NonceExpirationInterval", &n.NonceExpirationInterval) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "validateNonce": - err = unpopulate(val, "ValidateNonce", &n.ValidateNonce) + 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", n, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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 ManagedCertificateCollection. +func (m ManagedCertificateCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "clientSecretSettingName", o.ClientSecretSettingName) - objectMap["method"] = "ClientSecretPost" + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.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 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "clientSecretSettingName": - err = unpopulate(val, "ClientSecretSettingName", &o.ClientSecretSettingName) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "method": - err = unpopulate(val, "Method", &o.Method) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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 ManagedCertificatePatch. +func (m ManagedCertificatePatch) 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) + populate(objectMap, "tags", m.Tags) 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 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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) - 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) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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 ManagedCertificateProperties. +func (m ManagedCertificateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nameClaimType", o.NameClaimType) - populate(objectMap, "scopes", o.Scopes) + 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 OpenIDConnectLogin. -func (o *OpenIDConnectLogin) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "nameClaimType": - err = unpopulate(val, "NameClaimType", &o.NameClaimType) + case "domainControlValidation": + err = unpopulate(val, "DomainControlValidation", &m.DomainControlValidation) delete(rawMsg, key) - case "scopes": - err = unpopulate(val, "Scopes", &o.Scopes) + 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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 ManagedEnvironment. +func (m ManagedEnvironment) 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, "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 OpenIDConnectRegistration. -func (o *OpenIDConnectRegistration) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "clientCredential": - err = unpopulate(val, "ClientCredential", &o.ClientCredential) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &o.ClientID) + case "identity": + err = unpopulate(val, "Identity", &m.Identity) delete(rawMsg, key) - case "openIdConnectConfiguration": - err = unpopulate(val, "OpenIDConnectConfiguration", &o.OpenIDConnectConfiguration) + 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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 ManagedEnvironmentProperties. +func (m ManagedEnvironmentProperties) 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, "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 OpenTelemetryConfiguration. -func (o *OpenTelemetryConfiguration) 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "destinationsConfiguration": - err = unpopulate(val, "DestinationsConfiguration", &o.DestinationsConfiguration) + 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 "peerAuthentication": + err = unpopulate(val, "PeerAuthentication", &m.PeerAuthentication) + delete(rawMsg, key) + case "peerTrafficConfiguration": + err = unpopulate(val, "PeerTrafficConfiguration", &m.PeerTrafficConfiguration) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "staticIp": + err = unpopulate(val, "StaticIP", &m.StaticIP) delete(rawMsg, key) - case "logsConfiguration": - err = unpopulate(val, "LogsConfiguration", &o.LogsConfiguration) + case "vnetConfiguration": + err = unpopulate(val, "VnetConfiguration", &m.VnetConfiguration) delete(rawMsg, key) - case "metricsConfiguration": - err = unpopulate(val, "MetricsConfiguration", &o.MetricsConfiguration) + case "workloadProfiles": + err = unpopulate(val, "WorkloadProfiles", &m.WorkloadProfiles) delete(rawMsg, key) - case "tracesConfiguration": - err = unpopulate(val, "TracesConfiguration", &o.TracesConfiguration) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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 ManagedEnvironmentPropertiesPeerAuthentication. +func (m ManagedEnvironmentPropertiesPeerAuthentication) 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, "mtls", m.Mtls) 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 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "display": - err = unpopulate(val, "Display", &o.Display) - delete(rawMsg, key) - case "isDataAction": - err = unpopulate(val, "IsDataAction", &o.IsDataAction) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) - delete(rawMsg, key) - case "origin": - err = unpopulate(val, "Origin", &o.Origin) + case "mtls": + err = unpopulate(val, "Mtls", &m.Mtls) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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 ManagedEnvironmentPropertiesPeerTrafficConfiguration. +func (m ManagedEnvironmentPropertiesPeerTrafficConfiguration) 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, "encryption", m.Encryption) 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 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - 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 "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "encryption": + err = unpopulate(val, "Encryption", &m.Encryption) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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 ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption. +func (m ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption) 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, "enabled", m.Enabled) 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 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", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "endpoint": - err = unpopulate(val, "Endpoint", &o.Endpoint) - delete(rawMsg, key) - case "headers": - err = unpopulate(val, "Headers", &o.Headers) - delete(rawMsg, key) - case "insecure": - err = unpopulate(val, "Insecure", &o.Insecure) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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 ManagedEnvironmentStorage. +func (m ManagedEnvironmentStorage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + 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 PatchCollection. -func (p *PatchCollection) 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", 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) + case "id": + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + 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) 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 PatchDetails. -func (p PatchDetails) 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, "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, "azureFile", m.AzureFile) + populate(objectMap, "nfsAzureFile", m.NfsAzureFile) 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 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "detectionStatus": - err = unpopulate(val, "DetectionStatus", &p.DetectionStatus) - delete(rawMsg, key) - case "lastDetectionTime": - err = unpopulateDateTimeRFC3339(val, "LastDetectionTime", &p.LastDetectionTime) - delete(rawMsg, key) - case "newImageName": - err = unpopulate(val, "NewImageName", &p.NewImageName) - delete(rawMsg, key) - case "newLayer": - err = unpopulate(val, "NewLayer", &p.NewLayer) - delete(rawMsg, key) - case "oldLayer": - err = unpopulate(val, "OldLayer", &p.OldLayer) - delete(rawMsg, key) - case "patchType": - err = unpopulate(val, "PatchType", &p.PatchType) - delete(rawMsg, key) - case "targetContainerName": - err = unpopulate(val, "TargetContainerName", &p.TargetContainerName) + case "azureFile": + err = unpopulate(val, "AzureFile", &m.AzureFile) delete(rawMsg, key) - case "targetImage": - err = unpopulate(val, "TargetImage", &p.TargetImage) + case "nfsAzureFile": + err = unpopulate(val, "NfsAzureFile", &m.NfsAzureFile) 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 PatchDetailsNewLayer. -func (p PatchDetailsNewLayer) 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, "frameworkAndVersion", p.FrameworkAndVersion) - populate(objectMap, "name", p.Name) - populate(objectMap, "osAndVersion", p.OSAndVersion) + populate(objectMap, "value", m.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 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "frameworkAndVersion": - err = unpopulate(val, "FrameworkAndVersion", &p.FrameworkAndVersion) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "osAndVersion": - err = unpopulate(val, "OSAndVersion", &p.OSAndVersion) + case "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 PatchDetailsOldLayer. -func (p PatchDetailsOldLayer) 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, "frameworkAndVersion", p.FrameworkAndVersion) - populate(objectMap, "name", p.Name) - populate(objectMap, "osAndVersion", p.OSAndVersion) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) 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 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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", &m.NextLink) delete(rawMsg, key) - case "osAndVersion": - err = unpopulate(val, "OSAndVersion", &p.OSAndVersion) + case "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 PatchProperties. -func (p PatchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ManagedIdentitySetting. +func (m ManagedIdentitySetting) 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, "identity", m.Identity) + populate(objectMap, "lifecycle", m.Lifecycle) 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 ManagedIdentitySetting. +func (m *ManagedIdentitySetting) UnmarshalJSON(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 "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) + case "identity": + err = unpopulate(val, "Identity", &m.Identity) delete(rawMsg, key) - case "targetRevisionId": - err = unpopulate(val, "TargetRevisionID", &p.TargetRevisionID) + case "lifecycle": + err = unpopulate(val, "Lifecycle", &m.Lifecycle) 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 PatchSkipConfig. -func (p PatchSkipConfig) 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, "skip", p.Skip) + 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 PatchSkipConfig. -func (p *PatchSkipConfig) 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "skip": - err = unpopulate(val, "Skip", &p.Skip) + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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 Mtls. +func (m Mtls) 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, "enabled", m.Enabled) 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 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "httpGet": - err = unpopulate(val, "HTTPGet", &p.HTTPGet) - delete(rawMsg, key) - case "scripts": - err = unpopulate(val, "Scripts", &p.Scripts) + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) 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 PrivateEndpoint. -func (p PrivateEndpoint) 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, "id", p.ID) + 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 PrivateEndpoint. -func (p *PrivateEndpoint) 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) + case "accessMode": + err = unpopulate(val, "AccessMode", &n.AccessMode) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &n.Server) + delete(rawMsg, key) + case "shareName": + err = unpopulate(val, "ShareName", &n.ShareName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, 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 Nonce. +func (n Nonce) 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, "nonceExpirationInterval", n.NonceExpirationInterval) + populate(objectMap, "validateNonce", n.ValidateNonce) 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 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + case "nonceExpirationInterval": + err = unpopulate(val, "NonceExpirationInterval", &n.NonceExpirationInterval) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "validateNonce": + err = unpopulate(val, "ValidateNonce", &n.ValidateNonce) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", n, 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 OpenIDConnectClientCredential. +func (o OpenIDConnectClientCredential) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + populate(objectMap, "clientSecretSettingName", o.ClientSecretSettingName) + objectMap["method"] = "ClientSecretPost" 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 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + case "clientSecretSettingName": + err = unpopulate(val, "ClientSecretSettingName", &o.ClientSecretSettingName) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + case "method": + err = unpopulate(val, "Method", &o.Method) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OpenIDConnectConfig. +func (o OpenIDConnectConfig) 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, "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 PrivateEndpointConnectionProperties. -func (p *PrivateEndpointConnectionProperties) 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "groupIds": - err = unpopulate(val, "GroupIDs", &p.GroupIDs) + case "authorizationEndpoint": + err = unpopulate(val, "AuthorizationEndpoint", &o.AuthorizationEndpoint) + delete(rawMsg, key) + case "certificationUri": + err = unpopulate(val, "CertificationURI", &o.CertificationURI) delete(rawMsg, key) - case "privateEndpoint": - err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + case "issuer": + err = unpopulate(val, "Issuer", &o.Issuer) delete(rawMsg, key) - case "privateLinkServiceConnectionState": - err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + case "tokenEndpoint": + err = unpopulate(val, "TokenEndpoint", &o.TokenEndpoint) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + case "wellKnownOpenIdConfiguration": + err = unpopulate(val, "WellKnownOpenIDConfiguration", &o.WellKnownOpenIDConfiguration) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OpenIDConnectLogin. +func (o OpenIDConnectLogin) 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, "nameClaimType", o.NameClaimType) + populate(objectMap, "scopes", o.Scopes) 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 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &p.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) + case "nameClaimType": + err = unpopulate(val, "NameClaimType", &o.NameClaimType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "scopes": + err = unpopulate(val, "Scopes", &o.Scopes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OpenIDConnectRegistration. +func (o OpenIDConnectRegistration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) + 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 PrivateLinkResourceListResult. -func (p *PrivateLinkResourceListResult) 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &p.NextLink) + case "clientCredential": + err = unpopulate(val, "ClientCredential", &o.ClientCredential) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) + 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OperationDetail. +func (o OperationDetail) 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, "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 PrivateLinkResourceProperties. -func (p *PrivateLinkResourceProperties) 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "groupId": - err = unpopulate(val, "GroupID", &p.GroupID) + case "display": + err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) - case "requiredMembers": - err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "requiredZoneNames": - err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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 OperationDisplay. +func (o OperationDisplay) 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, "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 PrivateLinkServiceConnectionState. -func (p *PrivateLinkServiceConnectionState) 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", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "actionsRequired": - err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) - delete(rawMsg, key) case "description": - err = unpopulate(val, "Description", &p.Description) + err = unpopulate(val, "Description", &o.Description) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil @@ -9677,7 +6740,6 @@ func (r *ReplicaCollection) UnmarshalJSON(data []byte) error { func (r ReplicaContainer) 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) @@ -9701,9 +6763,6 @@ func (r *ReplicaContainer) UnmarshalJSON(data []byte) error { 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) @@ -9736,37 +6795,6 @@ func (r *ReplicaContainer) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ReplicaExecutionStatus. -func (r ReplicaExecutionStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "containers", r.Containers) - populate(objectMap, "name", r.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicaExecutionStatus. -func (r *ReplicaExecutionStatus) UnmarshalJSON(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 "containers": - err = unpopulate(val, "Containers", &r.Containers) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ReplicaProperties. func (r ReplicaProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -9993,7 +7021,6 @@ func (r *RevisionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Runtime. func (r Runtime) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dotnet", r.Dotnet) populate(objectMap, "java", r.Java) return json.Marshal(objectMap) } @@ -10007,9 +7034,6 @@ func (r *Runtime) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "dotnet": - err = unpopulate(val, "Dotnet", &r.Dotnet) - delete(rawMsg, key) case "java": err = unpopulate(val, "Java", &r.Java) delete(rawMsg, key) @@ -10021,38 +7045,10 @@ func (r *Runtime) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RuntimeDotnet. -func (r RuntimeDotnet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "autoConfigureDataProtection", r.AutoConfigureDataProtection) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RuntimeDotnet. -func (r *RuntimeDotnet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "autoConfigureDataProtection": - err = unpopulate(val, "AutoConfigureDataProtection", &r.AutoConfigureDataProtection) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type RuntimeJava. func (r RuntimeJava) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "enableMetrics", r.EnableMetrics) - populate(objectMap, "javaAgent", r.JavaAgent) return json.Marshal(objectMap) } @@ -10068,67 +7064,6 @@ func (r *RuntimeJava) UnmarshalJSON(data []byte) error { case "enableMetrics": err = unpopulate(val, "EnableMetrics", &r.EnableMetrics) delete(rawMsg, key) - case "javaAgent": - err = unpopulate(val, "JavaAgent", &r.JavaAgent) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RuntimeJavaAgent. -func (r RuntimeJavaAgent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "enabled", r.Enabled) - populate(objectMap, "logging", r.Logging) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RuntimeJavaAgent. -func (r *RuntimeJavaAgent) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &r.Enabled) - delete(rawMsg, key) - case "logging": - err = unpopulate(val, "Logging", &r.Logging) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RuntimeJavaAgentLogging. -func (r RuntimeJavaAgentLogging) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "loggerSettings", r.LoggerSettings) - return json.Marshal(objectMap) -} - -// 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "loggerSettings": - err = unpopulate(val, "LoggerSettings", &r.LoggerSettings) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -10285,49 +7220,6 @@ func (s *ScaleRuleAuth) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ScgRoute. -func (s ScgRoute) 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) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScgRoute. -func (s *ScgRoute) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "filters": - err = unpopulate(val, "Filters", &s.Filters) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "order": - err = unpopulate(val, "Order", &s.Order) - delete(rawMsg, key) - case "predicates": - err = unpopulate(val, "Predicates", &s.Predicates) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &s.URI) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Secret. func (s Secret) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -10455,8 +7347,6 @@ func (s *Service) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServiceBind. func (s ServiceBind) 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) return json.Marshal(objectMap) @@ -10471,12 +7361,6 @@ func (s *ServiceBind) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "clientType": - err = unpopulate(val, "ClientType", &s.ClientType) - delete(rawMsg, key) - case "customizedKeys": - err = unpopulate(val, "CustomizedKeys", &s.CustomizedKeys) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) @@ -10627,6 +7511,7 @@ func (s *SessionNetworkConfiguration) UnmarshalJSON(data []byte) error { func (s SessionPool) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -10648,6 +7533,9 @@ func (s *SessionPool) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &s.ID) delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &s.Location) delete(rawMsg, key) @@ -10712,6 +7600,7 @@ func (s SessionPoolProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "customContainerTemplate", s.CustomContainerTemplate) populate(objectMap, "dynamicPoolConfiguration", s.DynamicPoolConfiguration) populate(objectMap, "environmentId", s.EnvironmentID) + populate(objectMap, "managedIdentitySettings", s.ManagedIdentitySettings) populate(objectMap, "nodeCount", s.NodeCount) populate(objectMap, "poolManagementEndpoint", s.PoolManagementEndpoint) populate(objectMap, "poolManagementType", s.PoolManagementType) @@ -10743,6 +7632,9 @@ func (s *SessionPoolProperties) UnmarshalJSON(data []byte) error { case "environmentId": err = unpopulate(val, "EnvironmentID", &s.EnvironmentID) delete(rawMsg, key) + case "managedIdentitySettings": + err = unpopulate(val, "ManagedIdentitySettings", &s.ManagedIdentitySettings) + delete(rawMsg, key) case "nodeCount": err = unpopulate(val, "NodeCount", &s.NodeCount) delete(rawMsg, key) @@ -10806,7 +7698,9 @@ func (s *SessionPoolSecret) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SessionPoolUpdatableProperties. func (s SessionPoolUpdatableProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "identity", s.Identity) populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) return json.Marshal(objectMap) } @@ -10819,9 +7713,15 @@ func (s *SessionPoolUpdatableProperties) 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 "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -10912,53 +7812,6 @@ func (s *SessionRegistryCredentials) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SmbStorage. -func (s SmbStorage) 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) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SmbStorage. -func (s *SmbStorage) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "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) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &s.Password) - delete(rawMsg, key) - case "shareName": - err = unpopulate(val, "ShareName", &s.ShareName) - delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &s.Username) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type SourceControl. func (s SourceControl) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -11058,58 +7911,11 @@ func (s *SourceControlProperties) UnmarshalJSON(data []byte) error { 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) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SpringBootAdminComponent. -func (s SpringBootAdminComponent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - objectMap["componentType"] = JavaComponentTypeSpringBootAdmin - populate(objectMap, "configurations", s.Configurations) - populate(objectMap, "ingress", s.Ingress) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "scale", s.Scale) - populate(objectMap, "serviceBinds", s.ServiceBinds) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SpringBootAdminComponent. -func (s *SpringBootAdminComponent) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "componentType": - err = unpopulate(val, "ComponentType", &s.ComponentType) - delete(rawMsg, key) - case "configurations": - err = unpopulate(val, "Configurations", &s.Configurations) - delete(rawMsg, key) - case "ingress": - err = unpopulate(val, "Ingress", &s.Ingress) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "scale": - err = unpopulate(val, "Scale", &s.Scale) - delete(rawMsg, key) - case "serviceBinds": - err = unpopulate(val, "ServiceBinds", &s.ServiceBinds) + case "operationState": + err = unpopulate(val, "OperationState", &s.OperationState) + delete(rawMsg, key) + case "repoUrl": + err = unpopulate(val, "RepoURL", &s.RepoURL) delete(rawMsg, key) } if err != nil { @@ -11119,19 +7925,20 @@ 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 SpringBootAdminComponent. +func (s SpringBootAdminComponent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["componentType"] = JavaComponentTypeSpringCloudConfig + 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) 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 SpringBootAdminComponent. +func (s *SpringBootAdminComponent) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -11145,6 +7952,9 @@ func (s *SpringCloudConfigComponent) UnmarshalJSON(data []byte) error { 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) @@ -11162,20 +7972,19 @@ 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 SpringCloudConfigComponent. +func (s SpringCloudConfigComponent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["componentType"] = JavaComponentTypeSpringCloudEureka + objectMap["componentType"] = JavaComponentTypeSpringCloudConfig 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) 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 SpringCloudConfigComponent. +func (s *SpringCloudConfigComponent) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -11189,9 +7998,6 @@ func (s *SpringCloudEurekaComponent) UnmarshalJSON(data []byte) error { 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) @@ -11209,21 +8015,20 @@ 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 SpringCloudEurekaComponent. +func (s SpringCloudEurekaComponent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["componentType"] = JavaComponentTypeSpringCloudGateway + 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, "springCloudGatewayRoutes", s.SpringCloudGatewayRoutes) 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 SpringCloudEurekaComponent. +func (s *SpringCloudEurekaComponent) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -11249,9 +8054,6 @@ func (s *SpringCloudGatewayComponent) UnmarshalJSON(data []byte) error { case "serviceBinds": err = unpopulate(val, "ServiceBinds", &s.ServiceBinds) delete(rawMsg, key) - case "springCloudGatewayRoutes": - err = unpopulate(val, "SpringCloudGatewayRoutes", &s.SpringCloudGatewayRoutes) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -11307,60 +8109,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 +8195,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 +8230,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 +8600,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 +8619,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..c8f71a66e65d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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. @@ -76,7 +72,7 @@ func (client *NamespacesClient) CheckNameAvailability(ctx context.Context, resou } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. -func (client *NamespacesClient) checkNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, checkNameAvailabilityRequest CheckNameAvailabilityRequest, options *NamespacesClientCheckNameAvailabilityOptions) (*policy.Request, error) { +func (client *NamespacesClient) checkNameAvailabilityCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, checkNameAvailabilityRequest CheckNameAvailabilityRequest, _ *NamespacesClientCheckNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/checkNameAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -95,7 +91,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..ced46b330c0a 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/operations_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/operations_client.go @@ -1,6 +1,3 @@ -//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. @@ -10,12 +7,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 +36,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]{ @@ -66,14 +62,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.App/operations" 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") + 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..c944cb670adc 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/options.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/options.go @@ -1,6 +1,3 @@ -//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. @@ -8,31 +5,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 +16,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 @@ -167,14 +76,14 @@ type ConnectedEnvironmentsCertificatesClientUpdateOptions struct { // ConnectedEnvironmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConnectedEnvironmentsClient.BeginCreateOrUpdate // method. type ConnectedEnvironmentsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ConnectedEnvironmentsClientBeginDeleteOptions contains the optional parameters for the ConnectedEnvironmentsClient.BeginDelete // method. type ConnectedEnvironmentsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -295,52 +204,34 @@ 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 { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ContainerAppsClientBeginDeleteOptions contains the optional parameters for the ContainerAppsClient.BeginDelete method. type ContainerAppsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ContainerAppsClientBeginStartOptions contains the optional parameters for the ContainerAppsClient.BeginStart method. type ContainerAppsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ContainerAppsClientBeginStopOptions contains the optional parameters for the ContainerAppsClient.BeginStop method. type ContainerAppsClientBeginStopOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ContainerAppsClientBeginUpdateOptions contains the optional parameters for the ContainerAppsClient.BeginUpdate method. type ContainerAppsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -409,39 +300,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 { @@ -488,21 +346,21 @@ type ContainerAppsRevisionsClientRestartRevisionOptions struct { // ContainerAppsSessionPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerAppsSessionPoolsClient.BeginCreateOrUpdate // method. type ContainerAppsSessionPoolsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation 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. + // Resumes the long-running operation 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. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -527,27 +385,15 @@ type ContainerAppsSessionPoolsClientListBySubscriptionOptions struct { // ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerAppsSourceControlsClient.BeginCreateOrUpdate // method. type ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation 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. + // Resumes the long-running operation 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 +408,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,78 +434,22 @@ 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. + // Resumes the long-running operation 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. + // Resumes the long-running operation 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. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -699,25 +465,19 @@ type JavaComponentsClientListOptions struct { // JobsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobsClient.BeginCreateOrUpdate method. type JobsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // JobsClientBeginDeleteOptions contains the optional parameters for the JobsClient.BeginDelete method. type JobsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JobsClientBeginResumeOptions contains the optional parameters for the JobsClient.BeginResume method. -type JobsClientBeginResumeOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation 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. + // Resumes the long-running operation from the provided token. ResumeToken string // Properties used to start a job execution. @@ -726,26 +486,20 @@ type JobsClientBeginStartOptions struct { // JobsClientBeginStopExecutionOptions contains the optional parameters for the JobsClient.BeginStopExecution method. type JobsClientBeginStopExecutionOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // JobsClientBeginStopMultipleExecutionsOptions contains the optional parameters for the JobsClient.BeginStopMultipleExecutions // method. type JobsClientBeginStopMultipleExecutionsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// JobsClientBeginSuspendOptions contains the optional parameters for the JobsClient.BeginSuspend method. -type JobsClientBeginSuspendOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation 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. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -790,56 +544,13 @@ 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 { // Managed Certificate to be created or updated ManagedCertificateEnvelope *ManagedCertificate - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -875,38 +586,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 { @@ -916,21 +595,21 @@ type ManagedEnvironmentUsagesClientListOptions struct { // ManagedEnvironmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedEnvironmentsClient.BeginCreateOrUpdate // method. type ManagedEnvironmentsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ManagedEnvironmentsClientBeginDeleteOptions contains the optional parameters for the ManagedEnvironmentsClient.BeginDelete // method. type ManagedEnvironmentsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // ManagedEnvironmentsClientBeginUpdateOptions contains the optional parameters for the ManagedEnvironmentsClient.BeginUpdate // method. type ManagedEnvironmentsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/polymorphic_helpers.go b/sdk/resourcemanager/appcontainers/armappcontainers/polymorphic_helpers.go index b87e1909d3ec..224a7365e9c4 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/polymorphic_helpers.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/polymorphic_helpers.go @@ -1,6 +1,3 @@ -//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. @@ -20,16 +17,12 @@ func unmarshalJavaComponentPropertiesClassification(rawMsg json.RawMessage) (Jav } 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{} } diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/responses.go b/sdk/resourcemanager/appcontainers/armappcontainers/responses.go index 2c8ca17c0040..78aa51a9964e 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/responses.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/responses.go @@ -1,6 +1,3 @@ -//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. @@ -8,35 +5,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 +17,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 +203,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 +298,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. @@ -536,29 +395,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,63 +424,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. @@ -727,12 +506,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 +523,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 +535,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 +576,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..054f8ff8aaf1 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/time_rfc3339.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/time_rfc3339.go @@ -1,6 +1,3 @@ -//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. @@ -11,12 +8,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. @@ -61,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/usages_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/usages_client.go index 4788ab98995a..eda955cd6b32 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/usages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/usages_client.go @@ -1,6 +1,3 @@ -//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. @@ -11,14 +8,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 +25,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 +43,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] { @@ -74,7 +70,7 @@ func (client *UsagesClient) NewListPager(location string, options *UsagesClientL } // listCreateRequest creates the List request. -func (client *UsagesClient) listCreateRequest(ctx context.Context, location string, options *UsagesClientListOptions) (*policy.Request, error) { +func (client *UsagesClient) listCreateRequest(ctx context.Context, location string, _ *UsagesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/usages" if location == "" { return nil, errors.New("parameter location cannot be empty") @@ -89,7 +85,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"), - // }}, - // } - } -}