diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md b/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md index 47ef21557dfa..77ad572e288a 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md +++ b/sdk/resourcemanager/appcontainers/armappcontainers/CHANGELOG.md @@ -1,5 +1,97 @@ # Release History +## 2.0.0-beta.2 (2023-03-01) +### Breaking Changes + +- Type of `BillingMeterProperties.Category` has been changed from `*Category` to `*string` +- Type of `CustomDomainConfiguration.CertificatePassword` has been changed from `[]byte` to `*string` +- Type of `DaprSecretsCollection.Value` has been changed from `[]*Secret` to `[]*DaprSecret` +- Type alias `Category` has been removed +- Type alias `ManagedEnvironmentOutBoundType` has been removed +- Type alias `SKUName` has been removed +- Struct `EnvironmentSKUProperties` has been removed +- Struct `ManagedEnvironmentOutboundSettings` has been removed +- Field `BillingMeterCategory` of struct `AvailableWorkloadProfileProperties` has been removed +- Field `SKU` of struct `ManagedEnvironment` has been removed +- Field `OutboundSettings` of struct `VnetConfiguration` has been removed +- Field `RuntimeSubnetID` of struct `VnetConfiguration` has been removed + +### Features Added + +- New value `StorageTypeSecret` added to type alias `StorageType` +- New type alias `Affinity` with values `AffinityNone`, `AffinitySticky` +- New type alias `IngressClientCertificateMode` with values `IngressClientCertificateModeAccept`, `IngressClientCertificateModeIgnore`, `IngressClientCertificateModeRequire` +- New type alias `JobExecutionRunningState` with values `JobExecutionRunningStateDegraded`, `JobExecutionRunningStateFailed`, `JobExecutionRunningStateProcessing`, `JobExecutionRunningStateRunning`, `JobExecutionRunningStateStopped`, `JobExecutionRunningStateSucceeded`, `JobExecutionRunningStateUnknown` +- New type alias `JobProvisioningState` with values `JobProvisioningStateCanceled`, `JobProvisioningStateDeleting`, `JobProvisioningStateFailed`, `JobProvisioningStateInProgress`, `JobProvisioningStateSucceeded` +- New type alias `ManagedCertificateDomainControlValidation` with values `ManagedCertificateDomainControlValidationCNAME`, `ManagedCertificateDomainControlValidationHTTP`, `ManagedCertificateDomainControlValidationTXT` +- New type alias `TriggerType` with values `TriggerTypeEvent`, `TriggerTypeManual`, `TriggerTypeScheduled` +- New function `NewJobClient(string, azcore.TokenCredential, *arm.ClientOptions) (*JobClient, error)` +- New function `*JobClient.BeginCreateOrUpdate(context.Context, string, string, Job, *JobClientBeginCreateOrUpdateOptions) (*runtime.Poller[JobClientCreateOrUpdateResponse], error)` +- New function `*JobClient.BeginDelete(context.Context, string, string, *JobClientBeginDeleteOptions) (*runtime.Poller[JobClientDeleteResponse], error)` +- New function `*JobClient.BeginExecutions(context.Context, string, string, *JobClientBeginExecutionsOptions) (*runtime.Poller[*runtime.Pager[JobClientExecutionsResponse]], error)` +- New function `*JobClient.Get(context.Context, string, string, *JobClientGetOptions) (JobClientGetResponse, error)` +- New function `*JobClient.BeginRun(context.Context, string, string, JobExecutionTemplate, *JobClientBeginRunOptions) (*runtime.Poller[JobClientRunResponse], error)` +- New function `*JobClient.BeginUpdate(context.Context, string, string, JobPatchProperties, *JobClientBeginUpdateOptions) (*runtime.Poller[JobClientUpdateResponse], error)` +- New function `NewJobsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*JobsClient, error)` +- New function `*JobsClient.NewListByResourceGroupPager(string, *JobsClientListByResourceGroupOptions) *runtime.Pager[JobsClientListByResourceGroupResponse]` +- New function `*JobsClient.NewListBySubscriptionPager(*JobsClientListBySubscriptionOptions) *runtime.Pager[JobsClientListBySubscriptionResponse]` +- New function `*JobsClient.ListSecrets(context.Context, string, string, *JobsClientListSecretsOptions) (JobsClientListSecretsResponse, error)` +- New function `*JobsClient.BeginStopExecution(context.Context, string, string, string, *JobsClientBeginStopExecutionOptions) (*runtime.Poller[JobsClientStopExecutionResponse], error)` +- New function `*JobsClient.BeginStopMultipleExecutions(context.Context, string, string, JobExecutionNamesCollection, *JobsClientBeginStopMultipleExecutionsOptions) (*runtime.Poller[JobsClientStopMultipleExecutionsResponse], error)` +- New function `NewManagedCertificatesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedCertificatesClient, error)` +- New function `*ManagedCertificatesClient.BeginCreateOrUpdate(context.Context, string, string, string, *ManagedCertificatesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedCertificatesClientCreateOrUpdateResponse], error)` +- New function `*ManagedCertificatesClient.Delete(context.Context, string, string, string, *ManagedCertificatesClientDeleteOptions) (ManagedCertificatesClientDeleteResponse, error)` +- New function `*ManagedCertificatesClient.Get(context.Context, string, string, string, *ManagedCertificatesClientGetOptions) (ManagedCertificatesClientGetResponse, error)` +- New function `*ManagedCertificatesClient.NewListPager(string, string, *ManagedCertificatesClientListOptions) *runtime.Pager[ManagedCertificatesClientListResponse]` +- New function `*ManagedCertificatesClient.Update(context.Context, string, string, string, ManagedCertificatePatch, *ManagedCertificatesClientUpdateOptions) (ManagedCertificatesClientUpdateResponse, error)` +- New struct `ContainerAppJobExecutions` +- New struct `CorsPolicy` +- New struct `DaprConfiguration` +- New struct `IngressStickySessions` +- New struct `Job` +- New struct `JobClient` +- New struct `JobClientExecutionsResponse` +- New struct `JobConfiguration` +- New struct `JobConfigurationManualTriggerConfig` +- New struct `JobConfigurationScheduleTriggerConfig` +- New struct `JobExecution` +- New struct `JobExecutionBase` +- New struct `JobExecutionContainer` +- New struct `JobExecutionNamesCollection` +- New struct `JobExecutionTemplate` +- New struct `JobPatchProperties` +- New struct `JobPatchPropertiesProperties` +- New struct `JobProperties` +- New struct `JobSecretsCollection` +- New struct `JobTemplate` +- New struct `JobsClient` +- New struct `JobsCollection` +- New struct `KedaConfiguration` +- New struct `ManagedCertificate` +- New struct `ManagedCertificateCollection` +- New struct `ManagedCertificatePatch` +- New struct `ManagedCertificateProperties` +- New struct `ManagedCertificatesClient` +- New struct `SecretVolumeItem` +- New field `Category` in struct `AvailableWorkloadProfileProperties` +- New field `ManagedBy` in struct `ContainerApp` +- New field `LatestReadyRevisionName` in struct `ContainerAppProperties` +- New field `Identity` in struct `ContainerAppSecret` +- New field `KeyVaultURL` in struct `ContainerAppSecret` +- New anonymous field `ContainerApp` in struct `ContainerAppsClientUpdateResponse` +- New field `ClientCertificateMode` in struct `Ingress` +- New field `CorsPolicy` in struct `Ingress` +- New field `StickySessions` in struct `Ingress` +- New field `Kind` in struct `ManagedEnvironment` +- New field `DaprConfiguration` in struct `ManagedEnvironmentProperties` +- New field `InfrastructureResourceGroup` in struct `ManagedEnvironmentProperties` +- New field `KedaConfiguration` in struct `ManagedEnvironmentProperties` +- New anonymous field `ManagedEnvironment` in struct `ManagedEnvironmentsClientUpdateResponse` +- New field `Identity` in struct `Secret` +- New field `KeyVaultURL` in struct `Secret` +- New field `Secrets` in struct `Volume` + + ## 2.0.0-beta.1 (2022-10-06) ### Breaking Changes diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/autorest.md b/sdk/resourcemanager/appcontainers/armappcontainers/autorest.md index b7642a1eb725..ca18e2e311ae 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/autorest.md +++ b/sdk/resourcemanager/appcontainers/armappcontainers/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/212686c8383679e034b19143e13cbeb5a40ab454/specification/app/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/212686c8383679e034b19143e13cbeb5a40ab454/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: 2.0.0-beta.1 +module-version: 2.0.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client.go index 2d22f22d2e4b..9058640c2f88 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client.go @@ -32,9 +32,9 @@ type AvailableWorkloadProfilesClient struct { } // NewAvailableWorkloadProfilesClient creates a new instance of AvailableWorkloadProfilesClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -56,10 +56,11 @@ func NewAvailableWorkloadProfilesClient(subscriptionID string, credential azcore } // NewGetPager - Get all available workload profiles for a location. -// Generated from API version 2022-06-01-preview -// location - The name of Azure region. -// options - AvailableWorkloadProfilesClientGetOptions contains the optional parameters for the AvailableWorkloadProfilesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - location - The name of Azure region. +// - options - AvailableWorkloadProfilesClientGetOptions contains the optional parameters for the AvailableWorkloadProfilesClient.NewGetPager +// method. func (client *AvailableWorkloadProfilesClient) NewGetPager(location string, options *AvailableWorkloadProfilesClientGetOptions) *runtime.Pager[AvailableWorkloadProfilesClientGetResponse] { return runtime.NewPager(runtime.PagingHandler[AvailableWorkloadProfilesClientGetResponse]{ More: func(page AvailableWorkloadProfilesClientGetResponse) bool { @@ -104,7 +105,7 @@ func (client *AvailableWorkloadProfilesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client_example_test.go deleted file mode 100644 index a37ecee746f5..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/availableworkloadprofiles_client_example_test.go +++ /dev/null @@ -1,41 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewAvailableWorkloadProfilesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetPager("East US", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client.go index c1f2614bd187..c20866920c6f 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client.go @@ -32,9 +32,9 @@ type BillingMetersClient struct { } // NewBillingMetersClient creates a new instance of BillingMetersClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,9 +57,10 @@ 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 2022-06-01-preview -// location - The name of Azure region. -// options - BillingMetersClientGetOptions contains the optional parameters for the BillingMetersClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - location - The name of Azure region. +// - options - BillingMetersClientGetOptions contains the optional parameters for the BillingMetersClient.Get method. func (client *BillingMetersClient) Get(ctx context.Context, location string, options *BillingMetersClientGetOptions) (BillingMetersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, location, options) if err != nil { @@ -91,7 +92,7 @@ func (client *BillingMetersClient) getCreateRequest(ctx context.Context, locatio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client_example_test.go deleted file mode 100644 index 17616f47451a..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/billingmeters_client_example_test.go +++ /dev/null @@ -1,36 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewBillingMetersClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "East US", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client.go index 857d79d0ec4a..4fad35168734 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client.go @@ -32,9 +32,9 @@ type CertificatesClient struct { } // NewCertificatesClient creates a new instance of CertificatesClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Managed Environment. -// certificateName - Name of the Certificate. -// options - CertificatesClientCreateOrUpdateOptions contains the optional parameters for the CertificatesClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - certificateName - Name of the Certificate. +// - options - CertificatesClientCreateOrUpdateOptions contains the optional parameters for the CertificatesClient.CreateOrUpdate +// method. func (client *CertificatesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, certificateName string, options *CertificatesClientCreateOrUpdateOptions) (CertificatesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, environmentName, certificateName, options) if err != nil { @@ -102,7 +103,7 @@ func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.CertificateEnvelope != nil { @@ -122,11 +123,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Managed Environment. -// certificateName - Name of the Certificate. -// options - CertificatesClientDeleteOptions contains the optional parameters for the CertificatesClient.Delete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - certificateName - Name of the Certificate. +// - options - CertificatesClientDeleteOptions contains the optional parameters for the CertificatesClient.Delete method. func (client *CertificatesClient) Delete(ctx context.Context, resourceGroupName string, environmentName string, certificateName string, options *CertificatesClientDeleteOptions) (CertificatesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, environmentName, certificateName, options) if err != nil { @@ -166,7 +168,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,11 +176,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Managed Environment. -// certificateName - Name of the Certificate. -// options - CertificatesClientGetOptions contains the optional parameters for the CertificatesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - certificateName - Name of the Certificate. +// - options - CertificatesClientGetOptions contains the optional parameters for the CertificatesClient.Get method. func (client *CertificatesClient) Get(ctx context.Context, resourceGroupName string, environmentName string, certificateName string, options *CertificatesClientGetOptions) (CertificatesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, environmentName, certificateName, options) if err != nil { @@ -218,7 +221,7 @@ func (client *CertificatesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,10 +237,11 @@ func (client *CertificatesClient) getHandleResponse(resp *http.Response) (Certif } // NewListPager - Get the Certificates in a given managed environment. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Managed Environment. -// options - CertificatesClientListOptions contains the optional parameters for the CertificatesClient.List method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - options - CertificatesClientListOptions contains the optional parameters for the CertificatesClient.NewListPager method. func (client *CertificatesClient) NewListPager(resourceGroupName string, environmentName string, options *CertificatesClientListOptions) *runtime.Pager[CertificatesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[CertificatesClientListResponse]{ More: func(page CertificatesClientListResponse) bool { @@ -286,7 +290,7 @@ func (client *CertificatesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,12 +307,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Managed Environment. -// certificateName - Name of the Certificate. -// certificateEnvelope - Properties of a certificate that need to be updated -// options - CertificatesClientUpdateOptions contains the optional parameters for the CertificatesClient.Update method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - certificateName - Name of the Certificate. +// - certificateEnvelope - Properties of a certificate that need to be updated +// - options - CertificatesClientUpdateOptions contains the optional parameters for the CertificatesClient.Update method. func (client *CertificatesClient) Update(ctx context.Context, resourceGroupName string, environmentName string, certificateName string, certificateEnvelope CertificatePatch, options *CertificatesClientUpdateOptions) (CertificatesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, environmentName, certificateName, certificateEnvelope, options) if err != nil { @@ -348,7 +353,7 @@ func (client *CertificatesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, certificateEnvelope) 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 42b60a1a2b85..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/certificates_client_example_test.go +++ /dev/null @@ -1,128 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewCertificatesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("examplerg", "testcontainerenv", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewCertificatesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/Certificate_CreateOrUpdate.json -func ExampleCertificatesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappcontainers.NewCertificatesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", &armappcontainers.CertificatesClientCreateOrUpdateOptions{CertificateEnvelope: &armappcontainers.Certificate{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.CertificateProperties{ - Password: to.Ptr("private key password"), - Value: []byte("PFX-or-PEM-blob"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewCertificatesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewCertificatesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go index 57192705a9cd..8a551a876feb 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client.go @@ -32,9 +32,9 @@ type ConnectedEnvironmentsClient struct { } // NewConnectedEnvironmentsClient creates a new instance of ConnectedEnvironmentsClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the Managed Environment. -// checkNameAvailabilityRequest - The check connectedEnvironmentName availability request. -// options - ConnectedEnvironmentsClientCheckNameAvailabilityOptions contains the optional parameters for the ConnectedEnvironmentsClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the Managed Environment. +// - checkNameAvailabilityRequest - The check connectedEnvironmentName availability request. +// - options - ConnectedEnvironmentsClientCheckNameAvailabilityOptions contains the optional parameters for the ConnectedEnvironmentsClient.CheckNameAvailability +// method. func (client *ConnectedEnvironmentsClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, checkNameAvailabilityRequest CheckNameAvailabilityRequest, options *ConnectedEnvironmentsClientCheckNameAvailabilityOptions) (ConnectedEnvironmentsClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, checkNameAvailabilityRequest, options) if err != nil { @@ -98,7 +99,7 @@ func (client *ConnectedEnvironmentsClient) checkNameAvailabilityCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, checkNameAvailabilityRequest) @@ -115,12 +116,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the connectedEnvironment. -// environmentEnvelope - Configuration details of the connectedEnvironment. -// options - ConnectedEnvironmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConnectedEnvironmentsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the connectedEnvironment. +// - environmentEnvelope - Configuration details of the connectedEnvironment. +// - options - ConnectedEnvironmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the ConnectedEnvironmentsClient.BeginCreateOrUpdate +// method. func (client *ConnectedEnvironmentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, environmentEnvelope ConnectedEnvironment, options *ConnectedEnvironmentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ConnectedEnvironmentsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, connectedEnvironmentName, environmentEnvelope, options) @@ -135,7 +137,8 @@ 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 2022-06-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ConnectedEnvironmentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, environmentEnvelope ConnectedEnvironment, options *ConnectedEnvironmentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, environmentEnvelope, options) if err != nil { @@ -171,7 +174,7 @@ func (client *ConnectedEnvironmentsClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, environmentEnvelope) @@ -179,11 +182,12 @@ func (client *ConnectedEnvironmentsClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Delete an connectedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the connectedEnvironment. -// options - ConnectedEnvironmentsClientBeginDeleteOptions contains the optional parameters for the ConnectedEnvironmentsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the connectedEnvironment. +// - options - ConnectedEnvironmentsClientBeginDeleteOptions contains the optional parameters for the ConnectedEnvironmentsClient.BeginDelete +// method. func (client *ConnectedEnvironmentsClient) BeginDelete(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsClientBeginDeleteOptions) (*runtime.Poller[ConnectedEnvironmentsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, connectedEnvironmentName, options) @@ -198,7 +202,8 @@ 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 2022-06-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ConnectedEnvironmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, options) if err != nil { @@ -234,7 +239,7 @@ func (client *ConnectedEnvironmentsClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,11 +247,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the connectedEnvironment. -// options - ConnectedEnvironmentsClientGetOptions contains the optional parameters for the ConnectedEnvironmentsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the connectedEnvironment. +// - options - ConnectedEnvironmentsClientGetOptions contains the optional parameters for the ConnectedEnvironmentsClient.Get +// method. func (client *ConnectedEnvironmentsClient) Get(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsClientGetOptions) (ConnectedEnvironmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, options) if err != nil { @@ -282,7 +288,7 @@ func (client *ConnectedEnvironmentsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,10 +304,11 @@ func (client *ConnectedEnvironmentsClient) getHandleResponse(resp *http.Response } // NewListByResourceGroupPager - Get all connectedEnvironments in a resource group. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// options - ConnectedEnvironmentsClientListByResourceGroupOptions contains the optional parameters for the ConnectedEnvironmentsClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ConnectedEnvironmentsClientListByResourceGroupOptions contains the optional parameters for the ConnectedEnvironmentsClient.NewListByResourceGroupPager +// method. func (client *ConnectedEnvironmentsClient) NewListByResourceGroupPager(resourceGroupName string, options *ConnectedEnvironmentsClientListByResourceGroupOptions) *runtime.Pager[ConnectedEnvironmentsClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[ConnectedEnvironmentsClientListByResourceGroupResponse]{ More: func(page ConnectedEnvironmentsClientListByResourceGroupResponse) bool { @@ -346,7 +353,7 @@ func (client *ConnectedEnvironmentsClient) listByResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -362,9 +369,10 @@ func (client *ConnectedEnvironmentsClient) listByResourceGroupHandleResponse(res } // NewListBySubscriptionPager - Get all connectedEnvironments for a subscription. -// Generated from API version 2022-06-01-preview -// options - ConnectedEnvironmentsClientListBySubscriptionOptions contains the optional parameters for the ConnectedEnvironmentsClient.ListBySubscription -// method. +// +// Generated from API version 2022-11-01-preview +// - options - ConnectedEnvironmentsClientListBySubscriptionOptions contains the optional parameters for the ConnectedEnvironmentsClient.NewListBySubscriptionPager +// method. func (client *ConnectedEnvironmentsClient) NewListBySubscriptionPager(options *ConnectedEnvironmentsClientListBySubscriptionOptions) *runtime.Pager[ConnectedEnvironmentsClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[ConnectedEnvironmentsClientListBySubscriptionResponse]{ More: func(page ConnectedEnvironmentsClientListBySubscriptionResponse) bool { @@ -405,7 +413,7 @@ func (client *ConnectedEnvironmentsClient) listBySubscriptionCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -422,11 +430,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the connectedEnvironment. -// options - ConnectedEnvironmentsClientUpdateOptions contains the optional parameters for the ConnectedEnvironmentsClient.Update -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the connectedEnvironment. +// - options - ConnectedEnvironmentsClientUpdateOptions contains the optional parameters for the ConnectedEnvironmentsClient.Update +// method. func (client *ConnectedEnvironmentsClient) Update(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsClientUpdateOptions) (ConnectedEnvironmentsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, options) if err != nil { @@ -462,7 +471,7 @@ func (client *ConnectedEnvironmentsClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client_example_test.go deleted file mode 100644 index d7455c02d65a..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironments_client_example_test.go +++ /dev/null @@ -1,181 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("examplerg", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "examplekenv", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "examplerg", "testenv", armappcontainers.ConnectedEnvironment{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.ConnectedEnvironmentProperties{ - CustomDomainConfiguration: &armappcontainers.CustomDomainConfiguration{ - CertificatePassword: []byte("private key password"), - CertificateValue: []byte("PFX-or-PEM-blob"), - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "examplerg", "testenv", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client.go index 7e52c9b053f2..76c18beb3e94 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client.go @@ -32,9 +32,9 @@ type ConnectedEnvironmentsCertificatesClient struct { } // NewConnectedEnvironmentsCertificatesClient creates a new instance of ConnectedEnvironmentsCertificatesClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the Connected Environment. -// certificateName - Name of the Certificate. -// options - ConnectedEnvironmentsCertificatesClientCreateOrUpdateOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the Connected Environment. +// - certificateName - Name of the Certificate. +// - options - ConnectedEnvironmentsCertificatesClientCreateOrUpdateOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.CreateOrUpdate +// method. func (client *ConnectedEnvironmentsCertificatesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, certificateName string, options *ConnectedEnvironmentsCertificatesClientCreateOrUpdateOptions) (ConnectedEnvironmentsCertificatesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, certificateName, options) if err != nil { @@ -102,7 +103,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) createOrUpdateCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.CertificateEnvelope != nil { @@ -122,12 +123,13 @@ func (client *ConnectedEnvironmentsCertificatesClient) createOrUpdateHandleRespo // Delete - Deletes the specified Certificate. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the Connected Environment. -// certificateName - Name of the Certificate. -// options - ConnectedEnvironmentsCertificatesClientDeleteOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the Connected Environment. +// - certificateName - Name of the Certificate. +// - options - ConnectedEnvironmentsCertificatesClientDeleteOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.Delete +// method. func (client *ConnectedEnvironmentsCertificatesClient) Delete(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, certificateName string, options *ConnectedEnvironmentsCertificatesClientDeleteOptions) (ConnectedEnvironmentsCertificatesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, certificateName, options) if err != nil { @@ -167,7 +169,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) deleteCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -175,12 +177,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the Connected Environment. -// certificateName - Name of the Certificate. -// options - ConnectedEnvironmentsCertificatesClientGetOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the Connected Environment. +// - certificateName - Name of the Certificate. +// - options - ConnectedEnvironmentsCertificatesClientGetOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.Get +// method. func (client *ConnectedEnvironmentsCertificatesClient) Get(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, certificateName string, options *ConnectedEnvironmentsCertificatesClientGetOptions) (ConnectedEnvironmentsCertificatesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, certificateName, options) if err != nil { @@ -220,7 +223,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,11 +239,12 @@ func (client *ConnectedEnvironmentsCertificatesClient) getHandleResponse(resp *h } // NewListPager - Get the Certificates in a given connected environment. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the Connected Environment. -// options - ConnectedEnvironmentsCertificatesClientListOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.List -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the Connected Environment. +// - options - ConnectedEnvironmentsCertificatesClientListOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.NewListPager +// method. func (client *ConnectedEnvironmentsCertificatesClient) NewListPager(resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsCertificatesClientListOptions) *runtime.Pager[ConnectedEnvironmentsCertificatesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConnectedEnvironmentsCertificatesClientListResponse]{ More: func(page ConnectedEnvironmentsCertificatesClientListResponse) bool { @@ -289,7 +293,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) listCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,13 +310,14 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the Connected Environment. -// certificateName - Name of the Certificate. -// certificateEnvelope - Properties of a certificate that need to be updated -// options - ConnectedEnvironmentsCertificatesClientUpdateOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.Update -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the Connected Environment. +// - certificateName - Name of the Certificate. +// - certificateEnvelope - Properties of a certificate that need to be updated +// - options - ConnectedEnvironmentsCertificatesClientUpdateOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.Update +// method. func (client *ConnectedEnvironmentsCertificatesClient) Update(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, certificateName string, certificateEnvelope CertificatePatch, options *ConnectedEnvironmentsCertificatesClientUpdateOptions) (ConnectedEnvironmentsCertificatesClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, certificateName, certificateEnvelope, options) if err != nil { @@ -352,7 +357,7 @@ func (client *ConnectedEnvironmentsCertificatesClient) updateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, certificateEnvelope) 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 49785d573f2a..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentscertificates_client_example_test.go +++ /dev/null @@ -1,128 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsCertificatesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("examplerg", "testcontainerenv", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsCertificatesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "testcontainerenv", "certificate-firendly-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsCertificatesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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("PFX-or-PEM-blob"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsCertificatesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsCertificatesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client.go index 1ae55877bc94..18e3d4ceddee 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client.go @@ -32,9 +32,9 @@ type ConnectedEnvironmentsDaprComponentsClient struct { } // NewConnectedEnvironmentsDaprComponentsClient creates a new instance of ConnectedEnvironmentsDaprComponentsClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the connected environment. -// componentName - Name of the Dapr Component. -// daprComponentEnvelope - Configuration details of the Dapr Component. -// options - ConnectedEnvironmentsDaprComponentsClientCreateOrUpdateOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the connected environment. +// - componentName - Name of the Dapr Component. +// - daprComponentEnvelope - Configuration details of the Dapr Component. +// - options - ConnectedEnvironmentsDaprComponentsClientCreateOrUpdateOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.CreateOrUpdate +// method. func (client *ConnectedEnvironmentsDaprComponentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, daprComponentEnvelope DaprComponent, options *ConnectedEnvironmentsDaprComponentsClientCreateOrUpdateOptions) (ConnectedEnvironmentsDaprComponentsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, componentName, daprComponentEnvelope, options) if err != nil { @@ -103,7 +104,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) createOrUpdateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, daprComponentEnvelope) @@ -120,12 +121,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the connected environment. -// componentName - Name of the Dapr Component. -// options - ConnectedEnvironmentsDaprComponentsClientDeleteOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the connected environment. +// - componentName - Name of the Dapr Component. +// - options - ConnectedEnvironmentsDaprComponentsClientDeleteOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.Delete +// method. func (client *ConnectedEnvironmentsDaprComponentsClient) Delete(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, options *ConnectedEnvironmentsDaprComponentsClientDeleteOptions) (ConnectedEnvironmentsDaprComponentsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, componentName, options) if err != nil { @@ -165,7 +167,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,12 +175,13 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) deleteCreateRequest(ctx // Get - Get a dapr component. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the connected environment. -// componentName - Name of the Dapr Component. -// options - ConnectedEnvironmentsDaprComponentsClientGetOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the connected environment. +// - componentName - Name of the Dapr Component. +// - options - ConnectedEnvironmentsDaprComponentsClientGetOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.Get +// method. func (client *ConnectedEnvironmentsDaprComponentsClient) Get(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, options *ConnectedEnvironmentsDaprComponentsClientGetOptions) (ConnectedEnvironmentsDaprComponentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, componentName, options) if err != nil { @@ -218,7 +221,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,11 +237,12 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) getHandleResponse(resp } // NewListPager - Get the Dapr Components for a connected environment. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the connected environment. -// options - ConnectedEnvironmentsDaprComponentsClientListOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.List -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the connected environment. +// - options - ConnectedEnvironmentsDaprComponentsClientListOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.NewListPager +// method. func (client *ConnectedEnvironmentsDaprComponentsClient) NewListPager(resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsDaprComponentsClientListOptions) *runtime.Pager[ConnectedEnvironmentsDaprComponentsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConnectedEnvironmentsDaprComponentsClientListResponse]{ More: func(page ConnectedEnvironmentsDaprComponentsClientListResponse) bool { @@ -287,7 +291,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) listCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,12 +308,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the connected environment. -// componentName - Name of the Dapr Component. -// options - ConnectedEnvironmentsDaprComponentsClientListSecretsOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.ListSecrets -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the connected environment. +// - componentName - Name of the Dapr Component. +// - options - ConnectedEnvironmentsDaprComponentsClientListSecretsOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.ListSecrets +// method. func (client *ConnectedEnvironmentsDaprComponentsClient) ListSecrets(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, componentName string, options *ConnectedEnvironmentsDaprComponentsClientListSecretsOptions) (ConnectedEnvironmentsDaprComponentsClientListSecretsResponse, error) { req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, componentName, options) if err != nil { @@ -349,7 +354,7 @@ func (client *ConnectedEnvironmentsDaprComponentsClient) listSecretsCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client_example_test.go deleted file mode 100644 index 6c78176aaeaf..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsdaprcomponents_client_example_test.go +++ /dev/null @@ -1,148 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsDaprComponentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("examplerg", "myenvironment", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsDaprComponentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "myenvironment", "reddog", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsDaprComponentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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"), - }}, - Version: to.Ptr("v1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsDaprComponentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsDaprComponentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, "examplerg", "myenvironment", "reddog", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client.go index 836148a00a14..eeee66ed0946 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client.go @@ -32,9 +32,9 @@ type ConnectedEnvironmentsStoragesClient struct { } // NewConnectedEnvironmentsStoragesClient creates a new instance of ConnectedEnvironmentsStoragesClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the Environment. -// storageName - Name of the storage. -// storageEnvelope - Configuration details of storage. -// options - ConnectedEnvironmentsStoragesClientCreateOrUpdateOptions contains the optional parameters for the ConnectedEnvironmentsStoragesClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the Environment. +// - storageName - Name of the storage. +// - storageEnvelope - Configuration details of storage. +// - options - ConnectedEnvironmentsStoragesClientCreateOrUpdateOptions contains the optional parameters for the ConnectedEnvironmentsStoragesClient.CreateOrUpdate +// method. func (client *ConnectedEnvironmentsStoragesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, storageName string, storageEnvelope ConnectedEnvironmentStorage, options *ConnectedEnvironmentsStoragesClientCreateOrUpdateOptions) (ConnectedEnvironmentsStoragesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, storageName, storageEnvelope, options) if err != nil { @@ -103,7 +104,7 @@ func (client *ConnectedEnvironmentsStoragesClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, storageEnvelope) @@ -120,12 +121,13 @@ func (client *ConnectedEnvironmentsStoragesClient) createOrUpdateHandleResponse( // Delete - Delete storage for a connectedEnvironment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the Environment. -// storageName - Name of the storage. -// options - ConnectedEnvironmentsStoragesClientDeleteOptions contains the optional parameters for the ConnectedEnvironmentsStoragesClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the Environment. +// - storageName - Name of the storage. +// - options - ConnectedEnvironmentsStoragesClientDeleteOptions contains the optional parameters for the ConnectedEnvironmentsStoragesClient.Delete +// method. func (client *ConnectedEnvironmentsStoragesClient) Delete(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, storageName string, options *ConnectedEnvironmentsStoragesClientDeleteOptions) (ConnectedEnvironmentsStoragesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, storageName, options) if err != nil { @@ -165,7 +167,7 @@ func (client *ConnectedEnvironmentsStoragesClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,12 +175,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the Environment. -// storageName - Name of the storage. -// options - ConnectedEnvironmentsStoragesClientGetOptions contains the optional parameters for the ConnectedEnvironmentsStoragesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the Environment. +// - storageName - Name of the storage. +// - options - ConnectedEnvironmentsStoragesClientGetOptions contains the optional parameters for the ConnectedEnvironmentsStoragesClient.Get +// method. func (client *ConnectedEnvironmentsStoragesClient) Get(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, storageName string, options *ConnectedEnvironmentsStoragesClientGetOptions) (ConnectedEnvironmentsStoragesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, storageName, options) if err != nil { @@ -218,7 +221,7 @@ func (client *ConnectedEnvironmentsStoragesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,11 +238,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// connectedEnvironmentName - Name of the Environment. -// options - ConnectedEnvironmentsStoragesClientListOptions contains the optional parameters for the ConnectedEnvironmentsStoragesClient.List -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - connectedEnvironmentName - Name of the Environment. +// - options - ConnectedEnvironmentsStoragesClientListOptions contains the optional parameters for the ConnectedEnvironmentsStoragesClient.List +// method. func (client *ConnectedEnvironmentsStoragesClient) List(ctx context.Context, resourceGroupName string, connectedEnvironmentName string, options *ConnectedEnvironmentsStoragesClientListOptions) (ConnectedEnvironmentsStoragesClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, connectedEnvironmentName, options) if err != nil { @@ -275,7 +279,7 @@ func (client *ConnectedEnvironmentsStoragesClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client_example_test.go deleted file mode 100644 index 3f9ccaa1ed2e..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/connectedenvironmentsstorages_client_example_test.go +++ /dev/null @@ -1,101 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsStoragesClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "examplerg", "managedEnv", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsStoragesClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "env", "jlaw-demo1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsStoragesClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewConnectedEnvironmentsStoragesClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 90db98f3da15..e46020b7fc76 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/constants.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/constants.go @@ -11,7 +11,7 @@ package armappcontainers const ( moduleName = "armappcontainers" - moduleVersion = "v2.0.0-beta.1" + moduleVersion = "v2.0.0-beta.2" ) // AccessMode - Access mode for storage @@ -64,6 +64,22 @@ func PossibleActiveRevisionsModeValues() []ActiveRevisionsMode { } } +// Affinity - Sticky Session Affinity +type Affinity string + +const ( + AffinityNone Affinity = "none" + AffinitySticky Affinity = "sticky" +) + +// PossibleAffinityValues returns the possible values for the Affinity const type. +func PossibleAffinityValues() []Affinity { + return []Affinity{ + AffinityNone, + AffinitySticky, + } +} + // AppProtocol - Tells Dapr which protocol your application is using. Valid options are http and grpc. Default is http type AppProtocol string @@ -112,24 +128,6 @@ func PossibleBindingTypeValues() []BindingType { } } -// Category - Used to map workload profile types to billing meter. -type Category string - -const ( - CategoryPremiumSKUComputeOptimized Category = "PremiumSkuComputeOptimized" - CategoryPremiumSKUGeneralPurpose Category = "PremiumSkuGeneralPurpose" - CategoryPremiumSKUMemoryOptimized Category = "PremiumSkuMemoryOptimized" -) - -// PossibleCategoryValues returns the possible values for the Category const type. -func PossibleCategoryValues() []Category { - return []Category{ - CategoryPremiumSKUComputeOptimized, - CategoryPremiumSKUGeneralPurpose, - CategoryPremiumSKUMemoryOptimized, - } -} - // CertificateProvisioningState - Provisioning state of the certificate. type CertificateProvisioningState string @@ -336,6 +334,26 @@ func PossibleForwardProxyConventionValues() []ForwardProxyConvention { } } +// 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. +type IngressClientCertificateMode string + +const ( + IngressClientCertificateModeAccept IngressClientCertificateMode = "accept" + IngressClientCertificateModeIgnore IngressClientCertificateMode = "ignore" + IngressClientCertificateModeRequire IngressClientCertificateMode = "require" +) + +// PossibleIngressClientCertificateModeValues returns the possible values for the IngressClientCertificateMode const type. +func PossibleIngressClientCertificateModeValues() []IngressClientCertificateMode { + return []IngressClientCertificateMode{ + IngressClientCertificateModeAccept, + IngressClientCertificateModeIgnore, + IngressClientCertificateModeRequire, + } +} + // IngressTransportMethod - Ingress transport protocol type IngressTransportMethod string @@ -356,6 +374,54 @@ func PossibleIngressTransportMethodValues() []IngressTransportMethod { } } +// JobExecutionRunningState - Current running State of the job +type JobExecutionRunningState string + +const ( + JobExecutionRunningStateDegraded JobExecutionRunningState = "Degraded" + JobExecutionRunningStateFailed JobExecutionRunningState = "Failed" + JobExecutionRunningStateProcessing JobExecutionRunningState = "Processing" + JobExecutionRunningStateRunning JobExecutionRunningState = "Running" + JobExecutionRunningStateStopped JobExecutionRunningState = "Stopped" + JobExecutionRunningStateSucceeded JobExecutionRunningState = "Succeeded" + JobExecutionRunningStateUnknown JobExecutionRunningState = "Unknown" +) + +// PossibleJobExecutionRunningStateValues returns the possible values for the JobExecutionRunningState const type. +func PossibleJobExecutionRunningStateValues() []JobExecutionRunningState { + return []JobExecutionRunningState{ + JobExecutionRunningStateDegraded, + JobExecutionRunningStateFailed, + JobExecutionRunningStateProcessing, + JobExecutionRunningStateRunning, + JobExecutionRunningStateStopped, + JobExecutionRunningStateSucceeded, + JobExecutionRunningStateUnknown, + } +} + +// JobProvisioningState - Provisioning state of the Container Apps Job. +type JobProvisioningState string + +const ( + JobProvisioningStateCanceled JobProvisioningState = "Canceled" + JobProvisioningStateDeleting JobProvisioningState = "Deleting" + JobProvisioningStateFailed JobProvisioningState = "Failed" + JobProvisioningStateInProgress JobProvisioningState = "InProgress" + JobProvisioningStateSucceeded JobProvisioningState = "Succeeded" +) + +// PossibleJobProvisioningStateValues returns the possible values for the JobProvisioningState const type. +func PossibleJobProvisioningStateValues() []JobProvisioningState { + return []JobProvisioningState{ + JobProvisioningStateCanceled, + JobProvisioningStateDeleting, + JobProvisioningStateFailed, + JobProvisioningStateInProgress, + JobProvisioningStateSucceeded, + } +} + // LogLevel - Sets the log level for the Dapr sidecar. Allowed values are debug, info, warn, error. Default is info. type LogLevel string @@ -376,19 +442,21 @@ func PossibleLogLevelValues() []LogLevel { } } -// ManagedEnvironmentOutBoundType - Outbound type for the cluster -type ManagedEnvironmentOutBoundType string +// ManagedCertificateDomainControlValidation - Selected type of domain control validation for managed certificates. +type ManagedCertificateDomainControlValidation string const ( - ManagedEnvironmentOutBoundTypeLoadBalancer ManagedEnvironmentOutBoundType = "LoadBalancer" - ManagedEnvironmentOutBoundTypeUserDefinedRouting ManagedEnvironmentOutBoundType = "UserDefinedRouting" + ManagedCertificateDomainControlValidationCNAME ManagedCertificateDomainControlValidation = "CNAME" + ManagedCertificateDomainControlValidationHTTP ManagedCertificateDomainControlValidation = "HTTP" + ManagedCertificateDomainControlValidationTXT ManagedCertificateDomainControlValidation = "TXT" ) -// PossibleManagedEnvironmentOutBoundTypeValues returns the possible values for the ManagedEnvironmentOutBoundType const type. -func PossibleManagedEnvironmentOutBoundTypeValues() []ManagedEnvironmentOutBoundType { - return []ManagedEnvironmentOutBoundType{ - ManagedEnvironmentOutBoundTypeLoadBalancer, - ManagedEnvironmentOutBoundTypeUserDefinedRouting, +// PossibleManagedCertificateDomainControlValidationValues returns the possible values for the ManagedCertificateDomainControlValidation const type. +func PossibleManagedCertificateDomainControlValidationValues() []ManagedCertificateDomainControlValidation { + return []ManagedCertificateDomainControlValidation{ + ManagedCertificateDomainControlValidationCNAME, + ManagedCertificateDomainControlValidationHTTP, + ManagedCertificateDomainControlValidationTXT, } } @@ -452,24 +520,6 @@ func PossibleRevisionProvisioningStateValues() []RevisionProvisioningState { } } -// SKUName - Name of the Sku. -type SKUName string - -const ( - // SKUNameConsumption - Consumption SKU of Managed Environment. - SKUNameConsumption SKUName = "Consumption" - // SKUNamePremium - Premium SKU of Managed Environment. - SKUNamePremium SKUName = "Premium" -) - -// PossibleSKUNameValues returns the possible values for the SKUName const type. -func PossibleSKUNameValues() []SKUName { - return []SKUName{ - SKUNameConsumption, - SKUNamePremium, - } -} - // Scheme - Scheme to use for connecting to the host. Defaults to HTTP. type Scheme string @@ -512,6 +562,7 @@ type StorageType string const ( StorageTypeAzureFile StorageType = "AzureFile" StorageTypeEmptyDir StorageType = "EmptyDir" + StorageTypeSecret StorageType = "Secret" ) // PossibleStorageTypeValues returns the possible values for the StorageType const type. @@ -519,6 +570,25 @@ func PossibleStorageTypeValues() []StorageType { return []StorageType{ StorageTypeAzureFile, StorageTypeEmptyDir, + StorageTypeSecret, + } +} + +// TriggerType - Trigger type of the job +type TriggerType string + +const ( + TriggerTypeEvent TriggerType = "Event" + TriggerTypeManual TriggerType = "Manual" + TriggerTypeScheduled TriggerType = "Scheduled" +) + +// PossibleTriggerTypeValues returns the possible values for the TriggerType const type. +func PossibleTriggerTypeValues() []TriggerType { + return []TriggerType{ + TriggerTypeEvent, + TriggerTypeManual, + TriggerTypeScheduled, } } diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go index c05d6c923e34..8892cf74bf49 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_client.go @@ -32,9 +32,9 @@ type ContainerAppsClient struct { } // NewContainerAppsClient creates a new instance of ContainerAppsClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// containerAppEnvelope - Properties used to create a container app -// options - ContainerAppsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerAppsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - containerAppEnvelope - Properties used to create a container app +// - options - ContainerAppsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerAppsClient.BeginCreateOrUpdate +// method. func (client *ContainerAppsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, containerAppName string, containerAppEnvelope ContainerApp, options *ContainerAppsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ContainerAppsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, containerAppName, containerAppEnvelope, options) @@ -77,7 +78,8 @@ 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 2022-06-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ContainerAppsClient) createOrUpdate(ctx context.Context, resourceGroupName string, containerAppName string, containerAppEnvelope ContainerApp, options *ContainerAppsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, containerAppName, containerAppEnvelope, options) if err != nil { @@ -113,7 +115,7 @@ func (client *ContainerAppsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, containerAppEnvelope) @@ -121,11 +123,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// options - ContainerAppsClientBeginDeleteOptions contains the optional parameters for the ContainerAppsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - options - ContainerAppsClientBeginDeleteOptions contains the optional parameters for the ContainerAppsClient.BeginDelete +// method. func (client *ContainerAppsClient) BeginDelete(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientBeginDeleteOptions) (*runtime.Poller[ContainerAppsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, containerAppName, options) @@ -140,7 +143,8 @@ 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 2022-06-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ContainerAppsClient) deleteOperation(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, containerAppName, options) if err != nil { @@ -176,7 +180,7 @@ func (client *ContainerAppsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,10 +188,11 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// options - ContainerAppsClientGetOptions contains the optional parameters for the ContainerAppsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - options - ContainerAppsClientGetOptions contains the optional parameters for the ContainerAppsClient.Get method. func (client *ContainerAppsClient) Get(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientGetOptions) (ContainerAppsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, containerAppName, options) if err != nil { @@ -223,7 +228,7 @@ func (client *ContainerAppsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,11 +245,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// options - ContainerAppsClientGetAuthTokenOptions contains the optional parameters for the ContainerAppsClient.GetAuthToken -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - options - ContainerAppsClientGetAuthTokenOptions contains the optional parameters for the ContainerAppsClient.GetAuthToken +// method. func (client *ContainerAppsClient) GetAuthToken(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientGetAuthTokenOptions) (ContainerAppsClientGetAuthTokenResponse, error) { req, err := client.getAuthTokenCreateRequest(ctx, resourceGroupName, containerAppName, options) if err != nil { @@ -280,7 +286,7 @@ func (client *ContainerAppsClient) getAuthTokenCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -296,10 +302,11 @@ func (client *ContainerAppsClient) getAuthTokenHandleResponse(resp *http.Respons } // NewListByResourceGroupPager - Get the Container Apps in a given resource group. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// options - ContainerAppsClientListByResourceGroupOptions contains the optional parameters for the ContainerAppsClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ContainerAppsClientListByResourceGroupOptions contains the optional parameters for the ContainerAppsClient.NewListByResourceGroupPager +// method. func (client *ContainerAppsClient) NewListByResourceGroupPager(resourceGroupName string, options *ContainerAppsClientListByResourceGroupOptions) *runtime.Pager[ContainerAppsClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[ContainerAppsClientListByResourceGroupResponse]{ More: func(page ContainerAppsClientListByResourceGroupResponse) bool { @@ -344,7 +351,7 @@ func (client *ContainerAppsClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -360,9 +367,10 @@ func (client *ContainerAppsClient) listByResourceGroupHandleResponse(resp *http. } // NewListBySubscriptionPager - Get the Container Apps in a given subscription. -// Generated from API version 2022-06-01-preview -// options - ContainerAppsClientListBySubscriptionOptions contains the optional parameters for the ContainerAppsClient.ListBySubscription -// method. +// +// Generated from API version 2022-11-01-preview +// - options - ContainerAppsClientListBySubscriptionOptions contains the optional parameters for the ContainerAppsClient.NewListBySubscriptionPager +// method. func (client *ContainerAppsClient) NewListBySubscriptionPager(options *ContainerAppsClientListBySubscriptionOptions) *runtime.Pager[ContainerAppsClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[ContainerAppsClientListBySubscriptionResponse]{ More: func(page ContainerAppsClientListBySubscriptionResponse) bool { @@ -403,7 +411,7 @@ func (client *ContainerAppsClient) listBySubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -420,11 +428,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// options - ContainerAppsClientListCustomHostNameAnalysisOptions contains the optional parameters for the ContainerAppsClient.ListCustomHostNameAnalysis -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - options - ContainerAppsClientListCustomHostNameAnalysisOptions contains the optional parameters for the ContainerAppsClient.ListCustomHostNameAnalysis +// method. func (client *ContainerAppsClient) ListCustomHostNameAnalysis(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientListCustomHostNameAnalysisOptions) (ContainerAppsClientListCustomHostNameAnalysisResponse, error) { req, err := client.listCustomHostNameAnalysisCreateRequest(ctx, resourceGroupName, containerAppName, options) if err != nil { @@ -463,7 +472,7 @@ func (client *ContainerAppsClient) listCustomHostNameAnalysisCreateRequest(ctx c if options != nil && options.CustomHostname != nil { reqQP.Set("customHostname", *options.CustomHostname) } - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -480,11 +489,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// options - ContainerAppsClientListSecretsOptions contains the optional parameters for the ContainerAppsClient.ListSecrets -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - options - ContainerAppsClientListSecretsOptions contains the optional parameters for the ContainerAppsClient.ListSecrets +// method. func (client *ContainerAppsClient) ListSecrets(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsClientListSecretsOptions) (ContainerAppsClientListSecretsResponse, error) { req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, containerAppName, options) if err != nil { @@ -520,7 +530,7 @@ func (client *ContainerAppsClient) listSecretsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -537,12 +547,13 @@ func (client *ContainerAppsClient) listSecretsHandleResponse(resp *http.Response // BeginUpdate - Patches a Container App using JSON Merge Patch // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// containerAppEnvelope - Properties of a Container App that need to be updated -// options - ContainerAppsClientBeginUpdateOptions contains the optional parameters for the ContainerAppsClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - containerAppEnvelope - Properties of a Container App that need to be updated +// - options - ContainerAppsClientBeginUpdateOptions contains the optional parameters for the ContainerAppsClient.BeginUpdate +// method. func (client *ContainerAppsClient) BeginUpdate(ctx context.Context, resourceGroupName string, containerAppName string, containerAppEnvelope ContainerApp, options *ContainerAppsClientBeginUpdateOptions) (*runtime.Poller[ContainerAppsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, containerAppName, containerAppEnvelope, options) @@ -557,7 +568,8 @@ 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 2022-06-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ContainerAppsClient) update(ctx context.Context, resourceGroupName string, containerAppName string, containerAppEnvelope ContainerApp, options *ContainerAppsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, containerAppName, containerAppEnvelope, options) if err != nil { @@ -567,7 +579,7 @@ func (client *ContainerAppsClient) update(ctx context.Context, resourceGroupName if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -593,7 +605,7 @@ func (client *ContainerAppsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, containerAppEnvelope) 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 03ea499ec6f8..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerapps_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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("rg", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "rg", "testcontainerApp0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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{ - 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"), - }}, - TargetPort: to.Ptr[int32](3000), - Traffic: []*armappcontainers.TrafficWeight{ - { - Label: to.Ptr("production"), - RevisionName: to.Ptr("testcontainerApp0-ab1234"), - Weight: to.Ptr[int32](100), - }}, - }, - MaxInactiveRevisions: to.Ptr[int32](10), - }, - EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - Template: &armappcontainers.Template{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerApp0"), - Image: to.Ptr("repo/testcontainerApp0:v1"), - Probes: []*armappcontainers.ContainerAppProbe{ - { - Type: to.Ptr(armappcontainers.TypeLiveness), - HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{ - Path: to.Ptr("/health"), - HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{ - { - Name: to.Ptr("Custom-Header"), - Value: to.Ptr("Awesome"), - }}, - Port: to.Ptr[int32](8080), - }, - InitialDelaySeconds: to.Ptr[int32](3), - PeriodSeconds: to.Ptr[int32](3), - }}, - }}, - InitContainers: []*armappcontainers.InitContainer{ - { - Name: to.Ptr("testinitcontainerApp0"), - Args: []*string{ - to.Ptr("-c"), - to.Ptr("while true; do echo hello; sleep 10;done")}, - Command: []*string{ - to.Ptr("/bin/sh")}, - Image: to.Ptr("repo/testcontainerApp0:v4"), - Resources: &armappcontainers.ContainerResources{ - CPU: to.Ptr[float64](0.2), - Memory: to.Ptr("100Mi"), - }, - }}, - Scale: &armappcontainers.Scale{ - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - Rules: []*armappcontainers.ScaleRule{ - { - Name: to.Ptr("httpscalingrule"), - Custom: &armappcontainers.CustomScaleRule{ - Type: to.Ptr("http"), - Metadata: map[string]*string{ - "concurrentRequests": to.Ptr("50"), - }, - }, - }}, - }, - }, - WorkloadProfileType: to.Ptr("GeneralPurpose"), - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, "rg", "testcontainerAppTcp", armappcontainers.ContainerApp{ - Location: to.Ptr("East US"), - Properties: &armappcontainers.ContainerAppProperties{ - Configuration: &armappcontainers.Configuration{ - Ingress: &armappcontainers.Ingress{ - ExposedPort: to.Ptr[int32](4000), - External: to.Ptr(true), - TargetPort: to.Ptr[int32](3000), - Traffic: []*armappcontainers.TrafficWeight{ - { - RevisionName: to.Ptr("testcontainerAppTcp-ab1234"), - Weight: to.Ptr[int32](100), - }}, - Transport: to.Ptr(armappcontainers.IngressTransportMethodTCP), - }, - }, - EnvironmentID: to.Ptr("/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube"), - Template: &armappcontainers.Template{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerAppTcp"), - Image: to.Ptr("repo/testcontainerAppTcp:v1"), - Probes: []*armappcontainers.ContainerAppProbe{ - { - Type: to.Ptr(armappcontainers.TypeLiveness), - InitialDelaySeconds: to.Ptr[int32](3), - PeriodSeconds: to.Ptr[int32](3), - TCPSocket: &armappcontainers.ContainerAppProbeTCPSocket{ - Port: to.Ptr[int32](8080), - }, - }}, - }}, - Scale: &armappcontainers.Scale{ - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - Rules: []*armappcontainers.ScaleRule{ - { - Name: to.Ptr("tcpscalingrule"), - TCP: &armappcontainers.TCPScaleRule{ - Metadata: map[string]*string{ - "concurrentConnections": to.Ptr("50"), - }, - }, - }}, - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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"), - }}, - 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), - }, - Template: &armappcontainers.Template{ - Containers: []*armappcontainers.Container{ - { - Name: to.Ptr("testcontainerApp0"), - Image: to.Ptr("repo/testcontainerApp0:v1"), - Probes: []*armappcontainers.ContainerAppProbe{ - { - Type: to.Ptr(armappcontainers.TypeLiveness), - HTTPGet: &armappcontainers.ContainerAppProbeHTTPGet{ - Path: to.Ptr("/health"), - HTTPHeaders: []*armappcontainers.ContainerAppProbeHTTPGetHTTPHeadersItem{ - { - Name: to.Ptr("Custom-Header"), - Value: to.Ptr("Awesome"), - }}, - Port: to.Ptr[int32](8080), - }, - InitialDelaySeconds: to.Ptr[int32](3), - PeriodSeconds: to.Ptr[int32](3), - }}, - }}, - InitContainers: []*armappcontainers.InitContainer{ - { - Name: to.Ptr("testinitcontainerApp0"), - Image: to.Ptr("repo/testcontainerApp0:v4"), - Resources: &armappcontainers.ContainerResources{ - CPU: to.Ptr[float64](0.2), - Memory: to.Ptr("100Mi"), - }, - }}, - Scale: &armappcontainers.Scale{ - MaxReplicas: to.Ptr[int32](5), - MinReplicas: to.Ptr[int32](1), - Rules: []*armappcontainers.ScaleRule{ - { - Name: to.Ptr("httpscalingrule"), - Custom: &armappcontainers.CustomScaleRule{ - Type: to.Ptr("http"), - Metadata: map[string]*string{ - "concurrentRequests": to.Ptr("50"), - }, - }, - }}, - }, - }, - }, - }, 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/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListCustomHostNameAnalysis(ctx, "rg", "testcontainerApp0", &armappcontainers.ContainerAppsClientListCustomHostNameAnalysisOptions{CustomHostname: to.Ptr("my.name.corp")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, "rg", "testcontainerApp0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsClient("651f8027-33e8-4ec4-97b4-f6e9f3dc8744", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAuthToken(ctx, "rg", "testcontainerApp0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client.go index d8c1fe12c0bf..14cb80d3fc8f 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client.go @@ -32,9 +32,9 @@ type ContainerAppsAuthConfigsClient struct { } // NewContainerAppsAuthConfigsClient creates a new instance of ContainerAppsAuthConfigsClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// authConfigName - Name of the Container App AuthConfig. -// authConfigEnvelope - Properties used to create a Container App AuthConfig -// options - ContainerAppsAuthConfigsClientCreateOrUpdateOptions contains the optional parameters for the ContainerAppsAuthConfigsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - authConfigName - Name of the Container App AuthConfig. +// - authConfigEnvelope - Properties used to create a Container App AuthConfig +// - options - ContainerAppsAuthConfigsClientCreateOrUpdateOptions contains the optional parameters for the ContainerAppsAuthConfigsClient.CreateOrUpdate +// method. func (client *ContainerAppsAuthConfigsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerAppName string, authConfigName string, authConfigEnvelope AuthConfig, options *ContainerAppsAuthConfigsClientCreateOrUpdateOptions) (ContainerAppsAuthConfigsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, containerAppName, authConfigName, authConfigEnvelope, options) if err != nil { @@ -103,7 +104,7 @@ func (client *ContainerAppsAuthConfigsClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, authConfigEnvelope) @@ -120,12 +121,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// authConfigName - Name of the Container App AuthConfig. -// options - ContainerAppsAuthConfigsClientDeleteOptions contains the optional parameters for the ContainerAppsAuthConfigsClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - authConfigName - Name of the Container App AuthConfig. +// - options - ContainerAppsAuthConfigsClientDeleteOptions contains the optional parameters for the ContainerAppsAuthConfigsClient.Delete +// method. func (client *ContainerAppsAuthConfigsClient) Delete(ctx context.Context, resourceGroupName string, containerAppName string, authConfigName string, options *ContainerAppsAuthConfigsClientDeleteOptions) (ContainerAppsAuthConfigsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, containerAppName, authConfigName, options) if err != nil { @@ -165,7 +167,7 @@ func (client *ContainerAppsAuthConfigsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,12 +175,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// authConfigName - Name of the Container App AuthConfig. -// options - ContainerAppsAuthConfigsClientGetOptions contains the optional parameters for the ContainerAppsAuthConfigsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - authConfigName - Name of the Container App AuthConfig. +// - options - ContainerAppsAuthConfigsClientGetOptions contains the optional parameters for the ContainerAppsAuthConfigsClient.Get +// method. func (client *ContainerAppsAuthConfigsClient) Get(ctx context.Context, resourceGroupName string, containerAppName string, authConfigName string, options *ContainerAppsAuthConfigsClientGetOptions) (ContainerAppsAuthConfigsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, containerAppName, authConfigName, options) if err != nil { @@ -218,7 +221,7 @@ func (client *ContainerAppsAuthConfigsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,11 +237,12 @@ func (client *ContainerAppsAuthConfigsClient) getHandleResponse(resp *http.Respo } // NewListByContainerAppPager - Get the Container App AuthConfigs in a given resource group. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// options - ContainerAppsAuthConfigsClientListByContainerAppOptions contains the optional parameters for the ContainerAppsAuthConfigsClient.ListByContainerApp -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - options - ContainerAppsAuthConfigsClientListByContainerAppOptions contains the optional parameters for the ContainerAppsAuthConfigsClient.NewListByContainerAppPager +// method. func (client *ContainerAppsAuthConfigsClient) NewListByContainerAppPager(resourceGroupName string, containerAppName string, options *ContainerAppsAuthConfigsClientListByContainerAppOptions) *runtime.Pager[ContainerAppsAuthConfigsClientListByContainerAppResponse] { return runtime.NewPager(runtime.PagingHandler[ContainerAppsAuthConfigsClientListByContainerAppResponse]{ More: func(page ContainerAppsAuthConfigsClientListByContainerAppResponse) bool { @@ -287,7 +291,7 @@ func (client *ContainerAppsAuthConfigsClient) listByContainerAppCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client_example_test.go deleted file mode 100644 index f76b6c84fecb..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsauthconfigs_client_example_test.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. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsAuthConfigsClient("651f8027-33e8-4ec4-97b4-f6e9f3dc8744", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByContainerAppPager("workerapps-rg-xj", "testcanadacentral", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsAuthConfigsClient("651f8027-33e8-4ec4-97b4-f6e9f3dc8744", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "workerapps-rg-xj", "testcanadacentral", "current", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsAuthConfigsClient("651f8027-33e8-4ec4-97b4-f6e9f3dc8744", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "workerapps-rg-xj", "testcanadacentral", "current", armappcontainers.AuthConfig{ - Properties: &armappcontainers.AuthConfigProperties{ - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsAuthConfigsClient("651f8027-33e8-4ec4-97b4-f6e9f3dc8744", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/containerappsdiagnostics_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go index 69c951267f6f..5b04879a2011 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client.go @@ -32,9 +32,9 @@ type ContainerAppsDiagnosticsClient struct { } // NewContainerAppsDiagnosticsClient creates a new instance of ContainerAppsDiagnosticsClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// detectorName - Name of the Container App Detector. -// options - ContainerAppsDiagnosticsClientGetDetectorOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.GetDetector -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - detectorName - Name of the Container App Detector. +// - options - ContainerAppsDiagnosticsClientGetDetectorOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.GetDetector +// method. func (client *ContainerAppsDiagnosticsClient) GetDetector(ctx context.Context, resourceGroupName string, containerAppName string, detectorName string, options *ContainerAppsDiagnosticsClientGetDetectorOptions) (ContainerAppsDiagnosticsClientGetDetectorResponse, error) { req, err := client.getDetectorCreateRequest(ctx, resourceGroupName, containerAppName, detectorName, options) if err != nil { @@ -102,7 +103,7 @@ func (client *ContainerAppsDiagnosticsClient) getDetectorCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,12 +120,13 @@ 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 2022-06-01-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. -// options - ContainerAppsDiagnosticsClientGetRevisionOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.GetRevision -// method. +// +// Generated from API version 2022-11-01-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. +// - options - ContainerAppsDiagnosticsClientGetRevisionOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.GetRevision +// method. func (client *ContainerAppsDiagnosticsClient) GetRevision(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, options *ContainerAppsDiagnosticsClientGetRevisionOptions) (ContainerAppsDiagnosticsClientGetRevisionResponse, error) { req, err := client.getRevisionCreateRequest(ctx, resourceGroupName, containerAppName, revisionName, options) if err != nil { @@ -164,7 +166,7 @@ func (client *ContainerAppsDiagnosticsClient) getRevisionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,11 +183,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// options - ContainerAppsDiagnosticsClientGetRootOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.GetRoot -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - options - ContainerAppsDiagnosticsClientGetRootOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.GetRoot +// method. func (client *ContainerAppsDiagnosticsClient) GetRoot(ctx context.Context, resourceGroupName string, containerAppName string, options *ContainerAppsDiagnosticsClientGetRootOptions) (ContainerAppsDiagnosticsClientGetRootResponse, error) { req, err := client.getRootCreateRequest(ctx, resourceGroupName, containerAppName, options) if err != nil { @@ -221,7 +224,7 @@ func (client *ContainerAppsDiagnosticsClient) getRootCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,11 +240,12 @@ func (client *ContainerAppsDiagnosticsClient) getRootHandleResponse(resp *http.R } // NewListDetectorsPager - Get the list of diagnostics for a given Container App. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App for which detector info is needed. -// options - ContainerAppsDiagnosticsClientListDetectorsOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.ListDetectors -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App for which detector info is needed. +// - options - ContainerAppsDiagnosticsClientListDetectorsOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.NewListDetectorsPager +// method. func (client *ContainerAppsDiagnosticsClient) NewListDetectorsPager(resourceGroupName string, containerAppName string, options *ContainerAppsDiagnosticsClientListDetectorsOptions) *runtime.Pager[ContainerAppsDiagnosticsClientListDetectorsResponse] { return runtime.NewPager(runtime.PagingHandler[ContainerAppsDiagnosticsClientListDetectorsResponse]{ More: func(page ContainerAppsDiagnosticsClientListDetectorsResponse) bool { @@ -290,7 +294,7 @@ func (client *ContainerAppsDiagnosticsClient) listDetectorsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,11 +310,12 @@ func (client *ContainerAppsDiagnosticsClient) listDetectorsHandleResponse(resp * } // NewListRevisionsPager - Get the Revisions for a given Container App. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App for which Revisions are needed. -// options - ContainerAppsDiagnosticsClientListRevisionsOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.ListRevisions -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App for which Revisions are needed. +// - options - ContainerAppsDiagnosticsClientListRevisionsOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.NewListRevisionsPager +// method. func (client *ContainerAppsDiagnosticsClient) NewListRevisionsPager(resourceGroupName string, containerAppName string, options *ContainerAppsDiagnosticsClientListRevisionsOptions) *runtime.Pager[ContainerAppsDiagnosticsClientListRevisionsResponse] { return runtime.NewPager(runtime.PagingHandler[ContainerAppsDiagnosticsClientListRevisionsResponse]{ More: func(page ContainerAppsDiagnosticsClientListRevisionsResponse) bool { @@ -359,7 +364,7 @@ func (client *ContainerAppsDiagnosticsClient) listRevisionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } 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 7c8bac5e314f..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsdiagnostics_client_example_test.go +++ /dev/null @@ -1,122 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsDiagnosticsClient("f07f3711-b45e-40fe-a941-4e6d93f851e6", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListDetectorsPager("mikono-workerapp-test-rg", "mikono-capp-stage1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsDiagnosticsClient("f07f3711-b45e-40fe-a941-4e6d93f851e6", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDetector(ctx, "mikono-workerapp-test-rg", "mikono-capp-stage1", "cappcontainerappnetworkIO", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsDiagnosticsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListRevisionsPager("rg", "testcontainerApp0", &armappcontainers.ContainerAppsDiagnosticsClientListRevisionsOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsDiagnosticsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetRevision(ctx, "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsDiagnosticsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetRoot(ctx, "rg", "testcontainerApp0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go index cfbb0a4c77ef..2e4c60149197 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client.go @@ -32,9 +32,9 @@ type ContainerAppsRevisionReplicasClient struct { } // NewContainerAppsRevisionReplicasClient creates a new instance of ContainerAppsRevisionReplicasClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ 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 2022-06-01-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. -// replicaName - Name of the Container App Revision Replica. -// options - ContainerAppsRevisionReplicasClientGetReplicaOptions contains the optional parameters for the ContainerAppsRevisionReplicasClient.GetReplica -// method. +// +// Generated from API version 2022-11-01-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. +// - replicaName - Name of the Container App Revision Replica. +// - options - ContainerAppsRevisionReplicasClientGetReplicaOptions contains the optional parameters for the ContainerAppsRevisionReplicasClient.GetReplica +// method. func (client *ContainerAppsRevisionReplicasClient) GetReplica(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, replicaName string, options *ContainerAppsRevisionReplicasClientGetReplicaOptions) (ContainerAppsRevisionReplicasClientGetReplicaResponse, error) { req, err := client.getReplicaCreateRequest(ctx, resourceGroupName, containerAppName, revisionName, replicaName, options) if err != nil { @@ -107,7 +108,7 @@ func (client *ContainerAppsRevisionReplicasClient) getReplicaCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,12 +125,13 @@ 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 2022-06-01-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. -// options - ContainerAppsRevisionReplicasClientListReplicasOptions contains the optional parameters for the ContainerAppsRevisionReplicasClient.ListReplicas -// method. +// +// Generated from API version 2022-11-01-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. +// - options - ContainerAppsRevisionReplicasClientListReplicasOptions contains the optional parameters for the ContainerAppsRevisionReplicasClient.ListReplicas +// method. func (client *ContainerAppsRevisionReplicasClient) ListReplicas(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, options *ContainerAppsRevisionReplicasClientListReplicasOptions) (ContainerAppsRevisionReplicasClientListReplicasResponse, error) { req, err := client.listReplicasCreateRequest(ctx, resourceGroupName, containerAppName, revisionName, options) if err != nil { @@ -169,7 +171,7 @@ func (client *ContainerAppsRevisionReplicasClient) listReplicasCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_client_example_test.go deleted file mode 100644 index e096a104c2cc..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisionreplicas_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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsRevisionReplicasClient("651f8027-33e8-4ec4-97b4-f6e9f3dc8744", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsRevisionReplicasClient("651f8027-33e8-4ec4-97b4-f6e9f3dc8744", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListReplicas(ctx, "workerapps-rg-xj", "myapp", "myapp--0wlqy09", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client.go index 53f109b8a3c8..2f25d1716b9b 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client.go @@ -32,9 +32,9 @@ type ContainerAppsRevisionsClient struct { } // NewContainerAppsRevisionsClient creates a new instance of ContainerAppsRevisionsClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ 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 2022-06-01-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. -// options - ContainerAppsRevisionsClientActivateRevisionOptions contains the optional parameters for the ContainerAppsRevisionsClient.ActivateRevision -// method. +// +// Generated from API version 2022-11-01-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. +// - options - ContainerAppsRevisionsClientActivateRevisionOptions contains the optional parameters for the ContainerAppsRevisionsClient.ActivateRevision +// method. func (client *ContainerAppsRevisionsClient) ActivateRevision(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, options *ContainerAppsRevisionsClientActivateRevisionOptions) (ContainerAppsRevisionsClientActivateRevisionResponse, error) { req, err := client.activateRevisionCreateRequest(ctx, resourceGroupName, containerAppName, revisionName, options) if err != nil { @@ -102,7 +103,7 @@ func (client *ContainerAppsRevisionsClient) activateRevisionCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,12 +111,13 @@ 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 2022-06-01-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. -// options - ContainerAppsRevisionsClientDeactivateRevisionOptions contains the optional parameters for the ContainerAppsRevisionsClient.DeactivateRevision -// method. +// +// Generated from API version 2022-11-01-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. +// - options - ContainerAppsRevisionsClientDeactivateRevisionOptions contains the optional parameters for the ContainerAppsRevisionsClient.DeactivateRevision +// method. func (client *ContainerAppsRevisionsClient) DeactivateRevision(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, options *ContainerAppsRevisionsClientDeactivateRevisionOptions) (ContainerAppsRevisionsClientDeactivateRevisionResponse, error) { req, err := client.deactivateRevisionCreateRequest(ctx, resourceGroupName, containerAppName, revisionName, options) if err != nil { @@ -155,7 +157,7 @@ func (client *ContainerAppsRevisionsClient) deactivateRevisionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -163,12 +165,13 @@ 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 2022-06-01-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. -// options - ContainerAppsRevisionsClientGetRevisionOptions contains the optional parameters for the ContainerAppsRevisionsClient.GetRevision -// method. +// +// Generated from API version 2022-11-01-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. +// - options - ContainerAppsRevisionsClientGetRevisionOptions contains the optional parameters for the ContainerAppsRevisionsClient.GetRevision +// method. func (client *ContainerAppsRevisionsClient) GetRevision(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, options *ContainerAppsRevisionsClientGetRevisionOptions) (ContainerAppsRevisionsClientGetRevisionResponse, error) { req, err := client.getRevisionCreateRequest(ctx, resourceGroupName, containerAppName, revisionName, options) if err != nil { @@ -208,7 +211,7 @@ func (client *ContainerAppsRevisionsClient) getRevisionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,11 +227,12 @@ func (client *ContainerAppsRevisionsClient) getRevisionHandleResponse(resp *http } // NewListRevisionsPager - Get the Revisions for a given Container App. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App for which Revisions are needed. -// options - ContainerAppsRevisionsClientListRevisionsOptions contains the optional parameters for the ContainerAppsRevisionsClient.ListRevisions -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App for which Revisions are needed. +// - options - ContainerAppsRevisionsClientListRevisionsOptions contains the optional parameters for the ContainerAppsRevisionsClient.NewListRevisionsPager +// method. func (client *ContainerAppsRevisionsClient) NewListRevisionsPager(resourceGroupName string, containerAppName string, options *ContainerAppsRevisionsClientListRevisionsOptions) *runtime.Pager[ContainerAppsRevisionsClientListRevisionsResponse] { return runtime.NewPager(runtime.PagingHandler[ContainerAppsRevisionsClientListRevisionsResponse]{ More: func(page ContainerAppsRevisionsClientListRevisionsResponse) bool { @@ -277,7 +281,7 @@ func (client *ContainerAppsRevisionsClient) listRevisionsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -297,12 +301,13 @@ 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 2022-06-01-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. -// options - ContainerAppsRevisionsClientRestartRevisionOptions contains the optional parameters for the ContainerAppsRevisionsClient.RestartRevision -// method. +// +// Generated from API version 2022-11-01-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. +// - options - ContainerAppsRevisionsClientRestartRevisionOptions contains the optional parameters for the ContainerAppsRevisionsClient.RestartRevision +// method. func (client *ContainerAppsRevisionsClient) RestartRevision(ctx context.Context, resourceGroupName string, containerAppName string, revisionName string, options *ContainerAppsRevisionsClientRestartRevisionOptions) (ContainerAppsRevisionsClientRestartRevisionResponse, error) { req, err := client.restartRevisionCreateRequest(ctx, resourceGroupName, containerAppName, revisionName, options) if err != nil { @@ -342,7 +347,7 @@ func (client *ContainerAppsRevisionsClient) restartRevisionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_client_example_test.go deleted file mode 100644 index e1c003467df2..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappsrevisions_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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsRevisionsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListRevisionsPager("rg", "testcontainerApp0", &armappcontainers.ContainerAppsRevisionsClientListRevisionsOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsRevisionsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetRevision(ctx, "rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsRevisionsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsRevisionsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsRevisionsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RestartRevision(ctx, "rg", "testStaticSite0", "testcontainerApp0-pjxhsye", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go index 1401bee93ed2..919e574681a9 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client.go @@ -32,9 +32,9 @@ type ContainerAppsSourceControlsClient struct { } // NewContainerAppsSourceControlsClient creates a new instance of ContainerAppsSourceControlsClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// sourceControlName - Name of the Container App SourceControl. -// sourceControlEnvelope - Properties used to create a Container App SourceControl -// options - ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerAppsSourceControlsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - sourceControlName - Name of the Container App SourceControl. +// - sourceControlEnvelope - Properties used to create a Container App SourceControl +// - options - ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerAppsSourceControlsClient.BeginCreateOrUpdate +// method. func (client *ContainerAppsSourceControlsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, sourceControlEnvelope SourceControl, options *ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ContainerAppsSourceControlsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope, options) @@ -78,7 +79,8 @@ 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 2022-06-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ContainerAppsSourceControlsClient) createOrUpdate(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, sourceControlEnvelope SourceControl, options *ContainerAppsSourceControlsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, containerAppName, sourceControlName, sourceControlEnvelope, options) if err != nil { @@ -118,7 +120,7 @@ func (client *ContainerAppsSourceControlsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, sourceControlEnvelope) @@ -126,12 +128,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// sourceControlName - Name of the Container App SourceControl. -// options - ContainerAppsSourceControlsClientBeginDeleteOptions contains the optional parameters for the ContainerAppsSourceControlsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - sourceControlName - Name of the Container App SourceControl. +// - options - ContainerAppsSourceControlsClientBeginDeleteOptions contains the optional parameters for the ContainerAppsSourceControlsClient.BeginDelete +// method. func (client *ContainerAppsSourceControlsClient) BeginDelete(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, options *ContainerAppsSourceControlsClientBeginDeleteOptions) (*runtime.Poller[ContainerAppsSourceControlsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, containerAppName, sourceControlName, options) @@ -146,7 +149,8 @@ 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 2022-06-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ContainerAppsSourceControlsClient) deleteOperation(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, options *ContainerAppsSourceControlsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, containerAppName, sourceControlName, options) if err != nil { @@ -186,7 +190,7 @@ func (client *ContainerAppsSourceControlsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,12 +198,13 @@ func (client *ContainerAppsSourceControlsClient) deleteCreateRequest(ctx context // Get - Get a SourceControl of a Container App. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// sourceControlName - Name of the Container App SourceControl. -// options - ContainerAppsSourceControlsClientGetOptions contains the optional parameters for the ContainerAppsSourceControlsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - sourceControlName - Name of the Container App SourceControl. +// - options - ContainerAppsSourceControlsClientGetOptions contains the optional parameters for the ContainerAppsSourceControlsClient.Get +// method. func (client *ContainerAppsSourceControlsClient) Get(ctx context.Context, resourceGroupName string, containerAppName string, sourceControlName string, options *ContainerAppsSourceControlsClientGetOptions) (ContainerAppsSourceControlsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, containerAppName, sourceControlName, options) if err != nil { @@ -239,7 +244,7 @@ func (client *ContainerAppsSourceControlsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,11 +260,12 @@ func (client *ContainerAppsSourceControlsClient) getHandleResponse(resp *http.Re } // NewListByContainerAppPager - Get the Container App SourceControls in a given resource group. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// containerAppName - Name of the Container App. -// options - ContainerAppsSourceControlsClientListByContainerAppOptions contains the optional parameters for the ContainerAppsSourceControlsClient.ListByContainerApp -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - containerAppName - Name of the Container App. +// - options - ContainerAppsSourceControlsClientListByContainerAppOptions contains the optional parameters for the ContainerAppsSourceControlsClient.NewListByContainerAppPager +// method. func (client *ContainerAppsSourceControlsClient) NewListByContainerAppPager(resourceGroupName string, containerAppName string, options *ContainerAppsSourceControlsClientListByContainerAppOptions) *runtime.Pager[ContainerAppsSourceControlsClientListByContainerAppResponse] { return runtime.NewPager(runtime.PagingHandler[ContainerAppsSourceControlsClientListByContainerAppResponse]{ More: func(page ContainerAppsSourceControlsClientListByContainerAppResponse) bool { @@ -308,7 +314,7 @@ func (client *ContainerAppsSourceControlsClient) listByContainerAppCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client_example_test.go deleted file mode 100644 index c30072fb1b0e..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/containerappssourcecontrols_client_example_test.go +++ /dev/null @@ -1,124 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsSourceControlsClient("651f8027-33e8-4ec4-97b4-f6e9f3dc8744", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByContainerAppPager("workerapps-rg-xj", "testcanadacentral", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsSourceControlsClient("651f8027-33e8-4ec4-97b4-f6e9f3dc8744", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "workerapps-rg-xj", "testcanadacentral", "current", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsSourceControlsClient("651f8027-33e8-4ec4-97b4-f6e9f3dc8744", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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(""), - TenantID: to.Ptr(""), - }, - ContextPath: to.Ptr("./"), - Image: to.Ptr("image/tag"), - RegistryInfo: &armappcontainers.RegistryInfo{ - RegistryPassword: to.Ptr(""), - RegistryURL: to.Ptr("xwang971reg.azurecr.io"), - RegistryUserName: to.Ptr("xwang971reg"), - }, - }, - RepoURL: to.Ptr("https://github.com/xwang971/ghatest"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewContainerAppsSourceControlsClient("651f8027-33e8-4ec4-97b4-f6e9f3dc8744", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "workerapps-rg-xj", "testcanadacentral", "current", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client.go index b05ccc54055c..febc44de7f4f 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client.go @@ -32,9 +32,9 @@ type DaprComponentsClient struct { } // NewDaprComponentsClient creates a new instance of DaprComponentsClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ 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 2022-06-01-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. -// daprComponentEnvelope - Configuration details of the Dapr Component. -// options - DaprComponentsClientCreateOrUpdateOptions contains the optional parameters for the DaprComponentsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-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. +// - daprComponentEnvelope - Configuration details of the Dapr Component. +// - options - DaprComponentsClientCreateOrUpdateOptions contains the optional parameters for the DaprComponentsClient.CreateOrUpdate +// method. func (client *DaprComponentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, componentName string, daprComponentEnvelope DaprComponent, options *DaprComponentsClientCreateOrUpdateOptions) (DaprComponentsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, environmentName, componentName, daprComponentEnvelope, options) if err != nil { @@ -103,7 +104,7 @@ func (client *DaprComponentsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, daprComponentEnvelope) @@ -120,11 +121,12 @@ 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 2022-06-01-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 - DaprComponentsClientDeleteOptions contains the optional parameters for the DaprComponentsClient.Delete method. +// +// Generated from API version 2022-11-01-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 - DaprComponentsClientDeleteOptions contains the optional parameters for the DaprComponentsClient.Delete method. func (client *DaprComponentsClient) Delete(ctx context.Context, resourceGroupName string, environmentName string, componentName string, options *DaprComponentsClientDeleteOptions) (DaprComponentsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, environmentName, componentName, options) if err != nil { @@ -164,7 +166,7 @@ func (client *DaprComponentsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,11 +174,12 @@ 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 2022-06-01-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 - DaprComponentsClientGetOptions contains the optional parameters for the DaprComponentsClient.Get method. +// +// Generated from API version 2022-11-01-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 - DaprComponentsClientGetOptions contains the optional parameters for the DaprComponentsClient.Get method. func (client *DaprComponentsClient) Get(ctx context.Context, resourceGroupName string, environmentName string, componentName string, options *DaprComponentsClientGetOptions) (DaprComponentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, environmentName, componentName, options) if err != nil { @@ -216,7 +219,7 @@ func (client *DaprComponentsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,10 +235,11 @@ func (client *DaprComponentsClient) getHandleResponse(resp *http.Response) (Dapr } // NewListPager - Get the Dapr Components for a managed environment. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Managed Environment. -// options - DaprComponentsClientListOptions contains the optional parameters for the DaprComponentsClient.List method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - options - DaprComponentsClientListOptions contains the optional parameters for the DaprComponentsClient.NewListPager method. func (client *DaprComponentsClient) NewListPager(resourceGroupName string, environmentName string, options *DaprComponentsClientListOptions) *runtime.Pager[DaprComponentsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DaprComponentsClientListResponse]{ More: func(page DaprComponentsClientListResponse) bool { @@ -284,7 +288,7 @@ func (client *DaprComponentsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,12 +305,13 @@ 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 2022-06-01-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 - DaprComponentsClientListSecretsOptions contains the optional parameters for the DaprComponentsClient.ListSecrets -// method. +// +// Generated from API version 2022-11-01-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 - DaprComponentsClientListSecretsOptions contains the optional parameters for the DaprComponentsClient.ListSecrets +// method. func (client *DaprComponentsClient) ListSecrets(ctx context.Context, resourceGroupName string, environmentName string, componentName string, options *DaprComponentsClientListSecretsOptions) (DaprComponentsClientListSecretsResponse, error) { req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, environmentName, componentName, options) if err != nil { @@ -346,7 +351,7 @@ func (client *DaprComponentsClient) listSecretsCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client_example_test.go deleted file mode 100644 index 648b6f3676fa..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/daprcomponents_client_example_test.go +++ /dev/null @@ -1,214 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewDaprComponentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("examplerg", "myenvironment", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewDaprComponentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "myenvironment", "reddog", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewDaprComponentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "myenvironment", "reddog", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewDaprComponentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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"), - Version: to.Ptr("v1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewDaprComponentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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"), - }}, - Version: to.Ptr("v1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewDaprComponentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewDaprComponentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, "examplerg", "myenvironment", "reddog", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/go.mod b/sdk/resourcemanager/appcontainers/armappcontainers/go.mod index bb4da4b408a1..e27a571f825e 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/go.mod +++ b/sdk/resourcemanager/appcontainers/armappcontainers/go.mod @@ -2,20 +2,12 @@ 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.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/go.sum b/sdk/resourcemanager/appcontainers/armappcontainers/go.sum index 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/go.sum +++ b/sdk/resourcemanager/appcontainers/armappcontainers/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/job_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/job_client.go new file mode 100644 index 000000000000..17ea940cc386 --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/job_client.go @@ -0,0 +1,476 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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" +) + +// JobClient contains the methods for the Job group. +// Don't use this type directly, use NewJobClient() instead. +type JobClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewJobClient creates a new instance of JobClient with the specified values. +// - 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 NewJobClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &JobClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or Update a Container Apps Job. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - jobName - Name of the Container Apps Job. +// - jobEnvelope - Properties used to create a container apps job +// - options - JobClientBeginCreateOrUpdateOptions contains the optional parameters for the JobClient.BeginCreateOrUpdate method. +func (client *JobClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope Job, options *JobClientBeginCreateOrUpdateOptions) (*runtime.Poller[JobClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, jobName, jobEnvelope, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[JobClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[JobClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create or Update a Container Apps Job. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *JobClient) createOrUpdate(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope Job, options *JobClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, jobName, jobEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *JobClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope Job, options *JobClientBeginCreateOrUpdateOptions) (*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") + } + 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.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, jobEnvelope) +} + +// BeginDelete - Delete a Container Apps Job. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - jobName - Name of the Container Apps Job. +// - options - JobClientBeginDeleteOptions contains the optional parameters for the JobClient.BeginDelete method. +func (client *JobClient) BeginDelete(ctx context.Context, resourceGroupName string, jobName string, options *JobClientBeginDeleteOptions) (*runtime.Poller[JobClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, jobName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[JobClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[JobClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete a Container Apps Job. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *JobClient) deleteOperation(ctx context.Context, resourceGroupName string, jobName string, options *JobClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, jobName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *JobClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobClientBeginDeleteOptions) (*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") + } + 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.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginExecutions - Get a Container Apps Job's executions +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - jobName - Name of the Container Apps Job. +// - options - JobClientBeginExecutionsOptions contains the optional parameters for the JobClient.BeginExecutions method. +func (client *JobClient) BeginExecutions(ctx context.Context, resourceGroupName string, jobName string, options *JobClientBeginExecutionsOptions) (*runtime.Poller[*runtime.Pager[JobClientExecutionsResponse]], error) { + pager := runtime.NewPager(runtime.PagingHandler[JobClientExecutionsResponse]{ + More: func(page JobClientExecutionsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *JobClientExecutionsResponse) (JobClientExecutionsResponse, error) { + req, err := runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + if err != nil { + return JobClientExecutionsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return JobClientExecutionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return JobClientExecutionsResponse{}, runtime.NewResponseError(resp) + } + return client.executionsHandleResponse(resp) + }, + }) + if options == nil || options.ResumeToken == "" { + resp, err := client.executions(ctx, resourceGroupName, jobName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[*runtime.Pager[JobClientExecutionsResponse]]{ + FinalStateVia: runtime.FinalStateViaLocation, + Response: &pager, + }) + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.pl, &runtime.NewPollerFromResumeTokenOptions[*runtime.Pager[JobClientExecutionsResponse]]{ + Response: &pager, + }) + } +} + +// Executions - Get a Container Apps Job's executions +// +// Generated from API version 2022-11-01-preview +func (client *JobClient) executions(ctx context.Context, resourceGroupName string, jobName string, options *JobClientBeginExecutionsOptions) (*http.Response, error) { + req, err := client.executionsCreateRequest(ctx, resourceGroupName, jobName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// executionsCreateRequest creates the Executions request. +func (client *JobClient) executionsCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobClientBeginExecutionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions" + 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.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// executionsHandleResponse handles the Executions response. +func (client *JobClient) executionsHandleResponse(resp *http.Response) (JobClientExecutionsResponse, error) { + result := JobClientExecutionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ContainerAppJobExecutions); err != nil { + return JobClientExecutionsResponse{}, err + } + return result, nil +} + +// Get - Get the properties of a Container Apps Job. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - jobName - Name of the Container Apps Job. +// - options - JobClientGetOptions contains the optional parameters for the JobClient.Get method. +func (client *JobClient) Get(ctx context.Context, resourceGroupName string, jobName string, options *JobClientGetOptions) (JobClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, jobName, options) + if err != nil { + return JobClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return JobClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return JobClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *JobClient) getCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *JobClientGetOptions) (*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") + } + 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.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *JobClient) getHandleResponse(resp *http.Response) (JobClientGetResponse, error) { + result := JobClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Job); err != nil { + return JobClientGetResponse{}, err + } + return result, nil +} + +// BeginRun - Runs a Container Apps Job +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - jobName - Name of the Container Apps Job. +// - templateParam - Properties used to start a job instance. +// - options - JobClientBeginRunOptions contains the optional parameters for the JobClient.BeginRun method. +func (client *JobClient) BeginRun(ctx context.Context, resourceGroupName string, jobName string, templateParam JobExecutionTemplate, options *JobClientBeginRunOptions) (*runtime.Poller[JobClientRunResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.run(ctx, resourceGroupName, jobName, templateParam, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[JobClientRunResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[JobClientRunResponse](options.ResumeToken, client.pl, nil) + } +} + +// Run - Runs a Container Apps Job +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *JobClient) run(ctx context.Context, resourceGroupName string, jobName string, templateParam JobExecutionTemplate, options *JobClientBeginRunOptions) (*http.Response, error) { + req, err := client.runCreateRequest(ctx, resourceGroupName, jobName, templateParam, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// runCreateRequest creates the Run request. +func (client *JobClient) runCreateRequest(ctx context.Context, resourceGroupName string, jobName string, templateParam JobExecutionTemplate, options *JobClientBeginRunOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/start" + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, templateParam) +} + +// BeginUpdate - Patches a Container Apps Job using JSON Merge Patch +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - jobName - Name of the Container Apps Job. +// - jobEnvelope - Properties used to create a container apps job +// - options - JobClientBeginUpdateOptions contains the optional parameters for the JobClient.BeginUpdate method. +func (client *JobClient) BeginUpdate(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope JobPatchProperties, options *JobClientBeginUpdateOptions) (*runtime.Poller[JobClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, jobName, jobEnvelope, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[JobClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[JobClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Patches a Container Apps Job using JSON Merge Patch +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *JobClient) update(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope JobPatchProperties, options *JobClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, jobName, jobEnvelope, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *JobClient) updateCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobEnvelope JobPatchProperties, options *JobClientBeginUpdateOptions) (*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") + } + 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.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, jobEnvelope) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client.go new file mode 100644 index 000000000000..6280e6065207 --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/jobs_client.go @@ -0,0 +1,377 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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. +// Don't use this type directly, use NewJobsClient() instead. +type JobsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewJobsClient creates a new instance of JobsClient with the specified values. +// - 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &JobsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListByResourceGroupPager - Get the Container Apps Jobs in a given resource group. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - JobsClientListByResourceGroupOptions contains the optional parameters for the JobsClient.NewListByResourceGroupPager +// method. +func (client *JobsClient) NewListByResourceGroupPager(resourceGroupName string, options *JobsClientListByResourceGroupOptions) *runtime.Pager[JobsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[JobsClientListByResourceGroupResponse]{ + More: func(page JobsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *JobsClientListByResourceGroupResponse) (JobsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return JobsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return JobsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return JobsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *JobsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *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") + } + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *JobsClient) listByResourceGroupHandleResponse(resp *http.Response) (JobsClientListByResourceGroupResponse, error) { + result := JobsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.JobsCollection); err != nil { + return JobsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Get the Container Apps Jobs in a given subscription. +// +// Generated from API version 2022-11-01-preview +// - options - JobsClientListBySubscriptionOptions contains the optional parameters for the JobsClient.NewListBySubscriptionPager +// method. +func (client *JobsClient) NewListBySubscriptionPager(options *JobsClientListBySubscriptionOptions) *runtime.Pager[JobsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[JobsClientListBySubscriptionResponse]{ + More: func(page JobsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *JobsClientListBySubscriptionResponse) (JobsClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return JobsClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return JobsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return JobsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *JobsClient) listBySubscriptionCreateRequest(ctx context.Context, options *JobsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.App/jobs" + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *JobsClient) listBySubscriptionHandleResponse(resp *http.Response) (JobsClientListBySubscriptionResponse, error) { + result := JobsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.JobsCollection); err != nil { + return JobsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// ListSecrets - List secrets for a container apps job +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - jobName - Name of the Container Apps Job. +// - options - JobsClientListSecretsOptions contains the optional parameters for the JobsClient.ListSecrets method. +func (client *JobsClient) ListSecrets(ctx context.Context, resourceGroupName string, jobName string, options *JobsClientListSecretsOptions) (JobsClientListSecretsResponse, error) { + req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, jobName, options) + if err != nil { + return JobsClientListSecretsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return JobsClientListSecretsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return JobsClientListSecretsResponse{}, runtime.NewResponseError(resp) + } + return client.listSecretsHandleResponse(resp) +} + +// listSecretsCreateRequest creates the ListSecrets request. +func (client *JobsClient) listSecretsCreateRequest(ctx context.Context, resourceGroupName string, jobName string, options *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") + } + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSecretsHandleResponse handles the ListSecrets response. +func (client *JobsClient) listSecretsHandleResponse(resp *http.Response) (JobsClientListSecretsResponse, error) { + result := JobsClientListSecretsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.JobSecretsCollection); err != nil { + return JobsClientListSecretsResponse{}, err + } + return result, nil +} + +// BeginStopExecution - Terminates execution of a running container apps job +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - jobName - Name of the Container Apps Job. +// - jobExecutionName - Job execution name. +// - options - JobsClientBeginStopExecutionOptions contains the optional parameters for the JobsClient.BeginStopExecution method. +func (client *JobsClient) BeginStopExecution(ctx context.Context, resourceGroupName string, jobName string, jobExecutionName string, options *JobsClientBeginStopExecutionOptions) (*runtime.Poller[JobsClientStopExecutionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stopExecution(ctx, resourceGroupName, jobName, jobExecutionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[JobsClientStopExecutionResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[JobsClientStopExecutionResponse](options.ResumeToken, client.pl, nil) + } +} + +// StopExecution - Terminates execution of a running container apps job +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *JobsClient) stopExecution(ctx context.Context, resourceGroupName string, jobName string, jobExecutionName string, options *JobsClientBeginStopExecutionOptions) (*http.Response, error) { + req, err := client.stopExecutionCreateRequest(ctx, resourceGroupName, jobName, jobExecutionName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopExecutionCreateRequest creates the StopExecution request. +func (client *JobsClient) stopExecutionCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobExecutionName string, options *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") + } + 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)) + if jobExecutionName == "" { + return nil, errors.New("parameter jobExecutionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{jobExecutionName}", url.PathEscape(jobExecutionName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStopMultipleExecutions - Terminates execution of a running container apps job +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - jobName - Name of the Container Apps Job. +// - jobExecutionName - List of all job executions that should be stopped. +// - options - JobsClientBeginStopMultipleExecutionsOptions contains the optional parameters for the JobsClient.BeginStopMultipleExecutions +// method. +func (client *JobsClient) BeginStopMultipleExecutions(ctx context.Context, resourceGroupName string, jobName string, jobExecutionName JobExecutionNamesCollection, options *JobsClientBeginStopMultipleExecutionsOptions) (*runtime.Poller[JobsClientStopMultipleExecutionsResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stopMultipleExecutions(ctx, resourceGroupName, jobName, jobExecutionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[JobsClientStopMultipleExecutionsResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[JobsClientStopMultipleExecutionsResponse](options.ResumeToken, client.pl, nil) + } +} + +// StopMultipleExecutions - Terminates execution of a running container apps job +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *JobsClient) stopMultipleExecutions(ctx context.Context, resourceGroupName string, jobName string, jobExecutionName JobExecutionNamesCollection, options *JobsClientBeginStopMultipleExecutionsOptions) (*http.Response, error) { + req, err := client.stopMultipleExecutionsCreateRequest(ctx, resourceGroupName, jobName, jobExecutionName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopMultipleExecutionsCreateRequest creates the StopMultipleExecutions request. +func (client *JobsClient) stopMultipleExecutionsCreateRequest(ctx context.Context, resourceGroupName string, jobName string, jobExecutionName JobExecutionNamesCollection, options *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") + } + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, jobExecutionName) +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go new file mode 100644 index 000000000000..243d72f61442 --- /dev/null +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedcertificates_client.go @@ -0,0 +1,381 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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. +// Don't use this type directly, use NewManagedCertificatesClient() instead. +type ManagedCertificatesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedCertificatesClient creates a new instance of ManagedCertificatesClient with the specified values. +// - 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedCertificatesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or Update a Managed Certificate. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - managedCertificateName - Name of the Managed Certificate. +// - options - ManagedCertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedCertificatesClient.BeginCreateOrUpdate +// method. +func (client *ManagedCertificatesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, options *ManagedCertificatesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedCertificatesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, environmentName, managedCertificateName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ManagedCertificatesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ManagedCertificatesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create or Update a Managed Certificate. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedCertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, options *ManagedCertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, environmentName, managedCertificateName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedCertificatesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, options *ManagedCertificatesClientBeginCreateOrUpdateOptions) (*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") + } + 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 managedCertificateName == "" { + return nil, errors.New("parameter managedCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedCertificateName}", url.PathEscape(managedCertificateName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.ManagedCertificateEnvelope != nil { + return req, runtime.MarshalAsJSON(req, *options.ManagedCertificateEnvelope) + } + return req, nil +} + +// Delete - Deletes the specified Managed Certificate. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - managedCertificateName - Name of the Managed Certificate. +// - options - ManagedCertificatesClientDeleteOptions contains the optional parameters for the ManagedCertificatesClient.Delete +// method. +func (client *ManagedCertificatesClient) Delete(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, options *ManagedCertificatesClientDeleteOptions) (ManagedCertificatesClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, environmentName, managedCertificateName, options) + if err != nil { + return ManagedCertificatesClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedCertificatesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ManagedCertificatesClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ManagedCertificatesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ManagedCertificatesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, options *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") + } + 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 managedCertificateName == "" { + return nil, errors.New("parameter managedCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedCertificateName}", url.PathEscape(managedCertificateName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the specified Managed Certificate. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - managedCertificateName - Name of the Managed Certificate. +// - options - ManagedCertificatesClientGetOptions contains the optional parameters for the ManagedCertificatesClient.Get method. +func (client *ManagedCertificatesClient) Get(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, options *ManagedCertificatesClientGetOptions) (ManagedCertificatesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, environmentName, managedCertificateName, options) + if err != nil { + return ManagedCertificatesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedCertificatesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedCertificatesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedCertificatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, options *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") + } + 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 managedCertificateName == "" { + return nil, errors.New("parameter managedCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedCertificateName}", url.PathEscape(managedCertificateName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedCertificatesClient) getHandleResponse(resp *http.Response) (ManagedCertificatesClientGetResponse, error) { + result := ManagedCertificatesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedCertificate); err != nil { + return ManagedCertificatesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Get the Managed Certificates in a given managed environment. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - options - ManagedCertificatesClientListOptions contains the optional parameters for the ManagedCertificatesClient.NewListPager +// method. +func (client *ManagedCertificatesClient) NewListPager(resourceGroupName string, environmentName string, options *ManagedCertificatesClientListOptions) *runtime.Pager[ManagedCertificatesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedCertificatesClientListResponse]{ + More: func(page ManagedCertificatesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedCertificatesClientListResponse) (ManagedCertificatesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, environmentName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedCertificatesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedCertificatesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedCertificatesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ManagedCertificatesClient) listCreateRequest(ctx context.Context, resourceGroupName string, environmentName string, options *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") + } + 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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ManagedCertificatesClient) listHandleResponse(resp *http.Response) (ManagedCertificatesClientListResponse, error) { + result := ManagedCertificatesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedCertificateCollection); err != nil { + return ManagedCertificatesClientListResponse{}, err + } + return result, nil +} + +// 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 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - managedCertificateName - Name of the Managed Certificate. +// - managedCertificateEnvelope - Properties of a managed certificate that need to be updated +// - options - ManagedCertificatesClientUpdateOptions contains the optional parameters for the ManagedCertificatesClient.Update +// method. +func (client *ManagedCertificatesClient) Update(ctx context.Context, resourceGroupName string, environmentName string, managedCertificateName string, managedCertificateEnvelope ManagedCertificatePatch, options *ManagedCertificatesClientUpdateOptions) (ManagedCertificatesClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, environmentName, managedCertificateName, managedCertificateEnvelope, options) + if err != nil { + return ManagedCertificatesClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedCertificatesClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedCertificatesClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// 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) { + 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") + } + 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 managedCertificateName == "" { + return nil, errors.New("parameter managedCertificateName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedCertificateName}", url.PathEscape(managedCertificateName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, managedCertificateEnvelope) +} + +// updateHandleResponse handles the Update response. +func (client *ManagedCertificatesClient) updateHandleResponse(resp *http.Response) (ManagedCertificatesClientUpdateResponse, error) { + result := ManagedCertificatesClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedCertificate); err != nil { + return ManagedCertificatesClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client.go index de370b489033..96ad9604b7e5 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client.go @@ -32,9 +32,9 @@ type ManagedEnvironmentDiagnosticsClient struct { } // NewManagedEnvironmentDiagnosticsClient creates a new instance of ManagedEnvironmentDiagnosticsClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Environment. -// detectorName - Name of the Managed Environment detector. -// options - ManagedEnvironmentDiagnosticsClientGetDetectorOptions contains the optional parameters for the ManagedEnvironmentDiagnosticsClient.GetDetector -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Environment. +// - detectorName - Name of the Managed Environment detector. +// - options - ManagedEnvironmentDiagnosticsClientGetDetectorOptions contains the optional parameters for the ManagedEnvironmentDiagnosticsClient.GetDetector +// method. func (client *ManagedEnvironmentDiagnosticsClient) GetDetector(ctx context.Context, resourceGroupName string, environmentName string, detectorName string, options *ManagedEnvironmentDiagnosticsClientGetDetectorOptions) (ManagedEnvironmentDiagnosticsClientGetDetectorResponse, error) { req, err := client.getDetectorCreateRequest(ctx, resourceGroupName, environmentName, detectorName, options) if err != nil { @@ -102,7 +103,7 @@ func (client *ManagedEnvironmentDiagnosticsClient) getDetectorCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,11 +120,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Environment. -// options - ManagedEnvironmentDiagnosticsClientListDetectorsOptions contains the optional parameters for the ManagedEnvironmentDiagnosticsClient.ListDetectors -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Environment. +// - options - ManagedEnvironmentDiagnosticsClientListDetectorsOptions contains the optional parameters for the ManagedEnvironmentDiagnosticsClient.ListDetectors +// method. func (client *ManagedEnvironmentDiagnosticsClient) ListDetectors(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentDiagnosticsClientListDetectorsOptions) (ManagedEnvironmentDiagnosticsClientListDetectorsResponse, error) { req, err := client.listDetectorsCreateRequest(ctx, resourceGroupName, environmentName, options) if err != nil { @@ -159,7 +161,7 @@ func (client *ManagedEnvironmentDiagnosticsClient) listDetectorsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_client_example_test.go deleted file mode 100644 index f5b9502714d6..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentdiagnostics_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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewManagedEnvironmentDiagnosticsClient("f07f3711-b45e-40fe-a941-4e6d93f851e6", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListDetectors(ctx, "mikono-workerapp-test-rg", "mikonokubeenv", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewManagedEnvironmentDiagnosticsClient("f07f3711-b45e-40fe-a941-4e6d93f851e6", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDetector(ctx, "mikono-workerapp-test-rg", "mikonokubeenv", "ManagedEnvAvailabilityMetrics", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go index 07b6763269eb..1fffefb086d8 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client.go @@ -32,9 +32,9 @@ type ManagedEnvironmentsClient struct { } // NewManagedEnvironmentsClient creates a new instance of ManagedEnvironmentsClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Environment. -// environmentEnvelope - Configuration details of the Environment. -// options - ManagedEnvironmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedEnvironmentsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Environment. +// - environmentEnvelope - Configuration details of the Environment. +// - options - ManagedEnvironmentsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedEnvironmentsClient.BeginCreateOrUpdate +// method. func (client *ManagedEnvironmentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, environmentEnvelope ManagedEnvironment, options *ManagedEnvironmentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedEnvironmentsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, environmentName, environmentEnvelope, options) @@ -77,7 +78,8 @@ 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 2022-06-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedEnvironmentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, environmentEnvelope ManagedEnvironment, options *ManagedEnvironmentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, environmentName, environmentEnvelope, options) if err != nil { @@ -113,7 +115,7 @@ func (client *ManagedEnvironmentsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, environmentEnvelope) @@ -121,11 +123,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Environment. -// options - ManagedEnvironmentsClientBeginDeleteOptions contains the optional parameters for the ManagedEnvironmentsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Environment. +// - options - ManagedEnvironmentsClientBeginDeleteOptions contains the optional parameters for the ManagedEnvironmentsClient.BeginDelete +// method. func (client *ManagedEnvironmentsClient) BeginDelete(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsClientBeginDeleteOptions) (*runtime.Poller[ManagedEnvironmentsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, environmentName, options) @@ -140,7 +143,8 @@ 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 2022-06-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedEnvironmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, environmentName, options) if err != nil { @@ -176,7 +180,7 @@ func (client *ManagedEnvironmentsClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,10 +188,11 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Environment. -// options - ManagedEnvironmentsClientGetOptions contains the optional parameters for the ManagedEnvironmentsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Environment. +// - options - ManagedEnvironmentsClientGetOptions contains the optional parameters for the ManagedEnvironmentsClient.Get method. func (client *ManagedEnvironmentsClient) Get(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsClientGetOptions) (ManagedEnvironmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, environmentName, options) if err != nil { @@ -223,7 +228,7 @@ func (client *ManagedEnvironmentsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,11 +245,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Managed Environment. -// options - ManagedEnvironmentsClientGetAuthTokenOptions contains the optional parameters for the ManagedEnvironmentsClient.GetAuthToken -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - options - ManagedEnvironmentsClientGetAuthTokenOptions contains the optional parameters for the ManagedEnvironmentsClient.GetAuthToken +// method. func (client *ManagedEnvironmentsClient) GetAuthToken(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsClientGetAuthTokenOptions) (ManagedEnvironmentsClientGetAuthTokenResponse, error) { req, err := client.getAuthTokenCreateRequest(ctx, resourceGroupName, environmentName, options) if err != nil { @@ -280,7 +286,7 @@ func (client *ManagedEnvironmentsClient) getAuthTokenCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -296,10 +302,11 @@ func (client *ManagedEnvironmentsClient) getAuthTokenHandleResponse(resp *http.R } // NewListByResourceGroupPager - Get all the Managed Environments in a resource group. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// options - ManagedEnvironmentsClientListByResourceGroupOptions contains the optional parameters for the ManagedEnvironmentsClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ManagedEnvironmentsClientListByResourceGroupOptions contains the optional parameters for the ManagedEnvironmentsClient.NewListByResourceGroupPager +// method. func (client *ManagedEnvironmentsClient) NewListByResourceGroupPager(resourceGroupName string, options *ManagedEnvironmentsClientListByResourceGroupOptions) *runtime.Pager[ManagedEnvironmentsClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedEnvironmentsClientListByResourceGroupResponse]{ More: func(page ManagedEnvironmentsClientListByResourceGroupResponse) bool { @@ -344,7 +351,7 @@ func (client *ManagedEnvironmentsClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -360,9 +367,10 @@ func (client *ManagedEnvironmentsClient) listByResourceGroupHandleResponse(resp } // NewListBySubscriptionPager - Get all Managed Environments for a subscription. -// Generated from API version 2022-06-01-preview -// options - ManagedEnvironmentsClientListBySubscriptionOptions contains the optional parameters for the ManagedEnvironmentsClient.ListBySubscription -// method. +// +// Generated from API version 2022-11-01-preview +// - options - ManagedEnvironmentsClientListBySubscriptionOptions contains the optional parameters for the ManagedEnvironmentsClient.NewListBySubscriptionPager +// method. func (client *ManagedEnvironmentsClient) NewListBySubscriptionPager(options *ManagedEnvironmentsClientListBySubscriptionOptions) *runtime.Pager[ManagedEnvironmentsClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedEnvironmentsClientListBySubscriptionResponse]{ More: func(page ManagedEnvironmentsClientListBySubscriptionResponse) bool { @@ -403,7 +411,7 @@ func (client *ManagedEnvironmentsClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -418,12 +426,13 @@ func (client *ManagedEnvironmentsClient) listBySubscriptionHandleResponse(resp * return result, nil } -// NewListWorkloadProfileStatesPager - Get all workload Profile States for a Premium Managed Environment. -// Generated from API version 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Managed Environment. -// options - ManagedEnvironmentsClientListWorkloadProfileStatesOptions contains the optional parameters for the ManagedEnvironmentsClient.ListWorkloadProfileStates -// method. +// NewListWorkloadProfileStatesPager - Get all workload Profile States for a Managed Environment. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - options - ManagedEnvironmentsClientListWorkloadProfileStatesOptions contains the optional parameters for the ManagedEnvironmentsClient.NewListWorkloadProfileStatesPager +// method. func (client *ManagedEnvironmentsClient) NewListWorkloadProfileStatesPager(resourceGroupName string, environmentName string, options *ManagedEnvironmentsClientListWorkloadProfileStatesOptions) *runtime.Pager[ManagedEnvironmentsClientListWorkloadProfileStatesResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedEnvironmentsClientListWorkloadProfileStatesResponse]{ More: func(page ManagedEnvironmentsClientListWorkloadProfileStatesResponse) bool { @@ -472,7 +481,7 @@ func (client *ManagedEnvironmentsClient) listWorkloadProfileStatesCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -489,12 +498,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Environment. -// environmentEnvelope - Configuration details of the Environment. -// options - ManagedEnvironmentsClientBeginUpdateOptions contains the optional parameters for the ManagedEnvironmentsClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Environment. +// - environmentEnvelope - Configuration details of the Environment. +// - options - ManagedEnvironmentsClientBeginUpdateOptions contains the optional parameters for the ManagedEnvironmentsClient.BeginUpdate +// method. func (client *ManagedEnvironmentsClient) BeginUpdate(ctx context.Context, resourceGroupName string, environmentName string, environmentEnvelope ManagedEnvironment, options *ManagedEnvironmentsClientBeginUpdateOptions) (*runtime.Poller[ManagedEnvironmentsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, environmentName, environmentEnvelope, options) @@ -509,7 +519,8 @@ 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 2022-06-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedEnvironmentsClient) update(ctx context.Context, resourceGroupName string, environmentName string, environmentEnvelope ManagedEnvironment, options *ManagedEnvironmentsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, environmentName, environmentEnvelope, options) if err != nil { @@ -519,7 +530,7 @@ func (client *ManagedEnvironmentsClient) update(ctx context.Context, resourceGro if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -545,7 +556,7 @@ func (client *ManagedEnvironmentsClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, environmentEnvelope) 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 902596f7b849..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironments_client_example_test.go +++ /dev/null @@ -1,241 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewManagedEnvironmentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewManagedEnvironmentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("examplerg", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewManagedEnvironmentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "jlaw-demo1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json -func ExampleManagedEnvironmentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappcontainers.NewManagedEnvironmentsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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: []byte("private key password"), - CertificateValue: []byte("PFX-or-PEM-blob"), - DNSSuffix: to.Ptr("www.my-name.com"), - }, - DaprAIConnectionString: to.Ptr("InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/"), - VnetConfiguration: &armappcontainers.VnetConfiguration{ - OutboundSettings: &armappcontainers.ManagedEnvironmentOutboundSettings{ - OutBoundType: to.Ptr(armappcontainers.ManagedEnvironmentOutBoundTypeUserDefinedRouting), - VirtualNetworkApplianceIP: to.Ptr("192.168.1.20"), - }, - }, - WorkloadProfiles: []*armappcontainers.WorkloadProfile{ - { - MaximumCount: to.Ptr[int32](12), - MinimumCount: to.Ptr[int32](3), - WorkloadProfileType: to.Ptr("GeneralPurpose"), - }, - { - MaximumCount: to.Ptr[int32](6), - MinimumCount: to.Ptr[int32](3), - WorkloadProfileType: to.Ptr("MemoryOptimized"), - }, - { - MaximumCount: to.Ptr[int32](6), - MinimumCount: to.Ptr[int32](3), - WorkloadProfileType: to.Ptr("ComputeOptimized"), - }}, - ZoneRedundant: to.Ptr(true), - }, - SKU: &armappcontainers.EnvironmentSKUProperties{ - Name: to.Ptr(armappcontainers.SKUNamePremium), - }, - }, 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewManagedEnvironmentsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewManagedEnvironmentsClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - _, 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/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewManagedEnvironmentsClient("651f8027-33e8-4ec4-97b4-f6e9f3dc8744", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAuthToken(ctx, "rg", "testenv", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewManagedEnvironmentsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListWorkloadProfileStatesPager("examplerg", "jlaw-demo1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client.go index 280319efc630..e2949336fa2c 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client.go @@ -32,9 +32,9 @@ type ManagedEnvironmentsDiagnosticsClient struct { } // NewManagedEnvironmentsDiagnosticsClient creates a new instance of ManagedEnvironmentsDiagnosticsClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Environment. -// options - ManagedEnvironmentsDiagnosticsClientGetRootOptions contains the optional parameters for the ManagedEnvironmentsDiagnosticsClient.GetRoot -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Environment. +// - options - ManagedEnvironmentsDiagnosticsClientGetRootOptions contains the optional parameters for the ManagedEnvironmentsDiagnosticsClient.GetRoot +// method. func (client *ManagedEnvironmentsDiagnosticsClient) GetRoot(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsDiagnosticsClientGetRootOptions) (ManagedEnvironmentsDiagnosticsClientGetRootResponse, error) { req, err := client.getRootCreateRequest(ctx, resourceGroupName, environmentName, options) if err != nil { @@ -97,7 +98,7 @@ func (client *ManagedEnvironmentsDiagnosticsClient) getRootCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client_example_test.go deleted file mode 100644 index c1a6e8fa70b2..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsdiagnostics_client_example_test.go +++ /dev/null @@ -1,36 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewManagedEnvironmentsDiagnosticsClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetRoot(ctx, "examplerg", "jlaw-demo1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client.go index ac3c2746387f..41a2c560b32d 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client.go @@ -32,9 +32,9 @@ type ManagedEnvironmentsStoragesClient struct { } // NewManagedEnvironmentsStoragesClient creates a new instance of ManagedEnvironmentsStoragesClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Environment. -// storageName - Name of the storage. -// storageEnvelope - Configuration details of storage. -// options - ManagedEnvironmentsStoragesClientCreateOrUpdateOptions contains the optional parameters for the ManagedEnvironmentsStoragesClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Environment. +// - storageName - Name of the storage. +// - storageEnvelope - Configuration details of storage. +// - options - ManagedEnvironmentsStoragesClientCreateOrUpdateOptions contains the optional parameters for the ManagedEnvironmentsStoragesClient.CreateOrUpdate +// method. func (client *ManagedEnvironmentsStoragesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, environmentName string, storageName string, storageEnvelope ManagedEnvironmentStorage, options *ManagedEnvironmentsStoragesClientCreateOrUpdateOptions) (ManagedEnvironmentsStoragesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, environmentName, storageName, storageEnvelope, options) if err != nil { @@ -103,7 +104,7 @@ func (client *ManagedEnvironmentsStoragesClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, storageEnvelope) @@ -120,12 +121,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Environment. -// storageName - Name of the storage. -// options - ManagedEnvironmentsStoragesClientDeleteOptions contains the optional parameters for the ManagedEnvironmentsStoragesClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Environment. +// - storageName - Name of the storage. +// - options - ManagedEnvironmentsStoragesClientDeleteOptions contains the optional parameters for the ManagedEnvironmentsStoragesClient.Delete +// method. func (client *ManagedEnvironmentsStoragesClient) Delete(ctx context.Context, resourceGroupName string, environmentName string, storageName string, options *ManagedEnvironmentsStoragesClientDeleteOptions) (ManagedEnvironmentsStoragesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, environmentName, storageName, options) if err != nil { @@ -165,7 +167,7 @@ func (client *ManagedEnvironmentsStoragesClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,12 +175,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Environment. -// storageName - Name of the storage. -// options - ManagedEnvironmentsStoragesClientGetOptions contains the optional parameters for the ManagedEnvironmentsStoragesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Environment. +// - storageName - Name of the storage. +// - options - ManagedEnvironmentsStoragesClientGetOptions contains the optional parameters for the ManagedEnvironmentsStoragesClient.Get +// method. func (client *ManagedEnvironmentsStoragesClient) Get(ctx context.Context, resourceGroupName string, environmentName string, storageName string, options *ManagedEnvironmentsStoragesClientGetOptions) (ManagedEnvironmentsStoragesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, environmentName, storageName, options) if err != nil { @@ -218,7 +221,7 @@ func (client *ManagedEnvironmentsStoragesClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,11 +238,12 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Environment. -// options - ManagedEnvironmentsStoragesClientListOptions contains the optional parameters for the ManagedEnvironmentsStoragesClient.List -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Environment. +// - options - ManagedEnvironmentsStoragesClientListOptions contains the optional parameters for the ManagedEnvironmentsStoragesClient.List +// method. func (client *ManagedEnvironmentsStoragesClient) List(ctx context.Context, resourceGroupName string, environmentName string, options *ManagedEnvironmentsStoragesClientListOptions) (ManagedEnvironmentsStoragesClientListResponse, error) { req, err := client.listCreateRequest(ctx, resourceGroupName, environmentName, options) if err != nil { @@ -275,7 +279,7 @@ func (client *ManagedEnvironmentsStoragesClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client_example_test.go deleted file mode 100644 index 4769bce150a3..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/managedenvironmentsstorages_client_example_test.go +++ /dev/null @@ -1,101 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewManagedEnvironmentsStoragesClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "examplerg", "managedEnv", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentsStorages_Get.json -func ExampleManagedEnvironmentsStoragesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappcontainers.NewManagedEnvironmentsStoragesClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "examplerg", "managedEnv", "jlaw-demo1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json -func ExampleManagedEnvironmentsStoragesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappcontainers.NewManagedEnvironmentsStoragesClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewManagedEnvironmentsStoragesClient("8efdecc5-919e-44eb-b179-915dca89ebf9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/models.go b/sdk/resourcemanager/appcontainers/armappcontainers/models.go index cefee0401795..9227ef1432f2 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/models.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/models.go @@ -131,7 +131,7 @@ type AvailableOperations struct { Value []*OperationDetail `json:"value,omitempty"` } -// AvailableWorkloadProfile - A premium workload profile. +// AvailableWorkloadProfile - A workload profile with specific hardware configure to run container apps. type AvailableWorkloadProfile struct { // Region of the workload profile. Location *string `json:"location,omitempty"` @@ -157,8 +157,8 @@ type AvailableWorkloadProfileProperties struct { // indicates whether the profile is default for the location. Applicability *Applicability `json:"applicability,omitempty"` - // Used to map workload profile types to billing meter. - BillingMeterCategory *Category `json:"billingMeterCategory,omitempty"` + // Used to categorize workload profiles. + Category *string `json:"category,omitempty"` // Number of cores in CPU. Cores *int32 `json:"cores,omitempty"` @@ -170,7 +170,7 @@ type AvailableWorkloadProfileProperties struct { MemoryGiB *int32 `json:"memoryGiB,omitempty"` } -// AvailableWorkloadProfilesClientGetOptions contains the optional parameters for the AvailableWorkloadProfilesClient.Get +// AvailableWorkloadProfilesClientGetOptions contains the optional parameters for the AvailableWorkloadProfilesClient.NewGetPager // method. type AvailableWorkloadProfilesClientGetOptions struct { // placeholder for future optional parameters @@ -328,7 +328,7 @@ type BaseContainer struct { VolumeMounts []*VolumeMount `json:"volumeMounts,omitempty"` } -// BillingMeter - A premium billing meter. +// BillingMeter - Billing meter. type BillingMeter struct { // Region for the billing meter. Location *string `json:"location,omitempty"` @@ -349,7 +349,7 @@ type BillingMeter struct { Type *string `json:"type,omitempty" azure:"ro"` } -// BillingMeterCollection - Collection of premium workload billing meters. +// BillingMeterCollection - Collection of billing meters. type BillingMeterCollection struct { // REQUIRED; Collection of billing meters. Value []*BillingMeter `json:"value,omitempty"` @@ -357,8 +357,8 @@ type BillingMeterCollection struct { // BillingMeterProperties - Revision resource specific properties type BillingMeterProperties struct { - // Used to map workload profile types to billing meter. - Category *Category `json:"category,omitempty"` + // Used to categorize billing meters. + Category *string `json:"category,omitempty"` // The everyday name of the billing meter. DisplayName *string `json:"displayName,omitempty"` @@ -463,7 +463,7 @@ type CertificatesClientGetOptions struct { // placeholder for future optional parameters } -// CertificatesClientListOptions contains the optional parameters for the CertificatesClient.List method. +// CertificatesClientListOptions contains the optional parameters for the CertificatesClient.NewListPager method. type CertificatesClientListOptions struct { // placeholder for future optional parameters } @@ -632,7 +632,7 @@ type ConnectedEnvironmentsCertificatesClientGetOptions struct { // placeholder for future optional parameters } -// ConnectedEnvironmentsCertificatesClientListOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.List +// ConnectedEnvironmentsCertificatesClientListOptions contains the optional parameters for the ConnectedEnvironmentsCertificatesClient.NewListPager // method. type ConnectedEnvironmentsCertificatesClientListOptions struct { // placeholder for future optional parameters @@ -669,13 +669,13 @@ type ConnectedEnvironmentsClientGetOptions struct { // placeholder for future optional parameters } -// ConnectedEnvironmentsClientListByResourceGroupOptions contains the optional parameters for the ConnectedEnvironmentsClient.ListByResourceGroup +// ConnectedEnvironmentsClientListByResourceGroupOptions contains the optional parameters for the ConnectedEnvironmentsClient.NewListByResourceGroupPager // method. type ConnectedEnvironmentsClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// ConnectedEnvironmentsClientListBySubscriptionOptions contains the optional parameters for the ConnectedEnvironmentsClient.ListBySubscription +// ConnectedEnvironmentsClientListBySubscriptionOptions contains the optional parameters for the ConnectedEnvironmentsClient.NewListBySubscriptionPager // method. type ConnectedEnvironmentsClientListBySubscriptionOptions struct { // placeholder for future optional parameters @@ -704,7 +704,7 @@ type ConnectedEnvironmentsDaprComponentsClientGetOptions struct { // placeholder for future optional parameters } -// ConnectedEnvironmentsDaprComponentsClientListOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.List +// ConnectedEnvironmentsDaprComponentsClientListOptions contains the optional parameters for the ConnectedEnvironmentsDaprComponentsClient.NewListPager // method. type ConnectedEnvironmentsDaprComponentsClientListOptions struct { // placeholder for future optional parameters @@ -779,6 +779,11 @@ type ContainerApp struct { // in code. Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // 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. + ManagedBy *string `json:"managedBy,omitempty"` + // ContainerApp resource specific properties Properties *ContainerAppProperties `json:"properties,omitempty"` @@ -840,6 +845,15 @@ type ContainerAppCollection struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } +// ContainerAppJobExecutions - Container App executions collection ARM resource. +type ContainerAppJobExecutions struct { + // REQUIRED; Collection of resources. + Value []*JobExecution `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + // ContainerAppProbe - Probe describes a health check to be performed against a container to determine whether it is alive // or ready to receive traffic. type ContainerAppProbe struct { @@ -942,6 +956,9 @@ type ContainerAppProperties struct { // READ-ONLY; The endpoint of the eventstream of the container app. EventStreamEndpoint *string `json:"eventStreamEndpoint,omitempty" azure:"ro"` + // READ-ONLY; Name of the latest ready revision of the Container App. + LatestReadyRevisionName *string `json:"latestReadyRevisionName,omitempty" azure:"ro"` + // READ-ONLY; Fully Qualified Domain Name of the latest revision of the Container App. LatestRevisionFqdn *string `json:"latestRevisionFqdn,omitempty" azure:"ro"` @@ -949,7 +966,7 @@ type ContainerAppProperties struct { LatestRevisionName *string `json:"latestRevisionName,omitempty" azure:"ro"` // READ-ONLY; Outbound IP Addresses for container app. - OutboundIPAddresses []*string `json:"outboundIPAddresses,omitempty" azure:"ro"` + OutboundIPAddresses []*string `json:"outboundIpAddresses,omitempty" azure:"ro"` // READ-ONLY; Provisioning state of the Container App. ProvisioningState *ContainerAppProvisioningState `json:"provisioningState,omitempty" azure:"ro"` @@ -957,6 +974,12 @@ type ContainerAppProperties struct { // ContainerAppSecret - Container App Secret. type ContainerAppSecret struct { + // READ-ONLY; Resource ID of a managed identity to authenticate with Azure Key Vault, or System to use a system-assigned identity. + Identity *string `json:"identity,omitempty" azure:"ro"` + + // READ-ONLY; Azure Key Vault URL pointing to the secret referenced by the container app. + KeyVaultURL *string `json:"keyVaultUrl,omitempty" azure:"ro"` + // READ-ONLY; Secret Name. Name *string `json:"name,omitempty" azure:"ro"` @@ -981,7 +1004,7 @@ type ContainerAppsAuthConfigsClientGetOptions struct { // placeholder for future optional parameters } -// ContainerAppsAuthConfigsClientListByContainerAppOptions contains the optional parameters for the ContainerAppsAuthConfigsClient.ListByContainerApp +// ContainerAppsAuthConfigsClientListByContainerAppOptions contains the optional parameters for the ContainerAppsAuthConfigsClient.NewListByContainerAppPager // method. type ContainerAppsAuthConfigsClientListByContainerAppOptions struct { // placeholder for future optional parameters @@ -1016,13 +1039,13 @@ type ContainerAppsClientGetOptions struct { // placeholder for future optional parameters } -// ContainerAppsClientListByResourceGroupOptions contains the optional parameters for the ContainerAppsClient.ListByResourceGroup +// ContainerAppsClientListByResourceGroupOptions contains the optional parameters for the ContainerAppsClient.NewListByResourceGroupPager // method. type ContainerAppsClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// ContainerAppsClientListBySubscriptionOptions contains the optional parameters for the ContainerAppsClient.ListBySubscription +// ContainerAppsClientListBySubscriptionOptions contains the optional parameters for the ContainerAppsClient.NewListBySubscriptionPager // method. type ContainerAppsClientListBySubscriptionOptions struct { // placeholder for future optional parameters @@ -1058,13 +1081,13 @@ type ContainerAppsDiagnosticsClientGetRootOptions struct { // placeholder for future optional parameters } -// ContainerAppsDiagnosticsClientListDetectorsOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.ListDetectors +// ContainerAppsDiagnosticsClientListDetectorsOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.NewListDetectorsPager // method. type ContainerAppsDiagnosticsClientListDetectorsOptions struct { // placeholder for future optional parameters } -// ContainerAppsDiagnosticsClientListRevisionsOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.ListRevisions +// ContainerAppsDiagnosticsClientListRevisionsOptions contains the optional parameters for the ContainerAppsDiagnosticsClient.NewListRevisionsPager // method. type ContainerAppsDiagnosticsClientListRevisionsOptions struct { // The filter to apply on the operation. @@ -1101,7 +1124,7 @@ type ContainerAppsRevisionsClientGetRevisionOptions struct { // placeholder for future optional parameters } -// ContainerAppsRevisionsClientListRevisionsOptions contains the optional parameters for the ContainerAppsRevisionsClient.ListRevisions +// ContainerAppsRevisionsClientListRevisionsOptions contains the optional parameters for the ContainerAppsRevisionsClient.NewListRevisionsPager // method. type ContainerAppsRevisionsClientListRevisionsOptions struct { // The filter to apply on the operation. @@ -1134,7 +1157,7 @@ type ContainerAppsSourceControlsClientGetOptions struct { // placeholder for future optional parameters } -// ContainerAppsSourceControlsClientListByContainerAppOptions contains the optional parameters for the ContainerAppsSourceControlsClient.ListByContainerApp +// ContainerAppsSourceControlsClientListByContainerAppOptions contains the optional parameters for the ContainerAppsSourceControlsClient.NewListByContainerAppPager // method. type ContainerAppsSourceControlsClientListByContainerAppOptions struct { // placeholder for future optional parameters @@ -1161,22 +1184,43 @@ type CookieExpiration struct { TimeToExpiration *string `json:"timeToExpiration,omitempty"` } +// CorsPolicy - Cross-Origin-Resource-Sharing policy +type CorsPolicy struct { + // REQUIRED; Specifies the content for the access-control-allow-origins header + AllowedOrigins []*string `json:"allowedOrigins,omitempty"` + + // Specifies whether the resource allows credentials + AllowCredentials *bool `json:"allowCredentials,omitempty"` + + // Specifies the content for the access-control-allow-headers header + AllowedHeaders []*string `json:"allowedHeaders,omitempty"` + + // Specifies the content for the access-control-allow-methods header + AllowedMethods []*string `json:"allowedMethods,omitempty"` + + // Specifies the content for the access-control-expose-headers header + ExposeHeaders []*string `json:"exposeHeaders,omitempty"` + + // Specifies the content for the access-control-max-age header + MaxAge *int32 `json:"maxAge,omitempty"` +} + // CustomDomain - Custom Domain of a Container App type CustomDomain struct { - // REQUIRED; Resource Id of the Certificate to be bound to this hostname. Must exist in the Managed Environment. - CertificateID *string `json:"certificateId,omitempty"` - // REQUIRED; Hostname. Name *string `json:"name,omitempty"` // Custom Domain binding type. BindingType *BindingType `json:"bindingType,omitempty"` + + // Resource Id of the Certificate to be bound to this hostname. Must exist in the Managed Environment. + CertificateID *string `json:"certificateId,omitempty"` } // CustomDomainConfiguration - Configuration properties for apps environment custom domain type CustomDomainConfiguration struct { // Certificate password - CertificatePassword []byte `json:"certificatePassword,omitempty"` + CertificatePassword *string `json:"certificatePassword,omitempty"` // PFX or PEM blob CertificateValue []byte `json:"certificateValue,omitempty"` @@ -1376,7 +1420,7 @@ type DaprComponentsClientGetOptions struct { // placeholder for future optional parameters } -// DaprComponentsClientListOptions contains the optional parameters for the DaprComponentsClient.List method. +// DaprComponentsClientListOptions contains the optional parameters for the DaprComponentsClient.NewListPager method. type DaprComponentsClientListOptions struct { // placeholder for future optional parameters } @@ -1395,6 +1439,12 @@ type DaprComponentsCollection struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } +// DaprConfiguration - Configuration properties Dapr component +type DaprConfiguration struct { + // READ-ONLY; The version of Dapr + Version *string `json:"version,omitempty" azure:"ro"` +} + // DaprMetadata - Dapr component metadata. type DaprMetadata struct { // Metadata property name. @@ -1419,7 +1469,7 @@ type DaprSecret struct { // DaprSecretsCollection - Dapr component Secrets Collection for ListSecrets Action. type DaprSecretsCollection struct { // REQUIRED; Collection of secrets used by a Dapr component - Value []*Secret `json:"value,omitempty"` + Value []*DaprSecret `json:"value,omitempty"` } // DefaultAuthorizationPolicy - The configuration settings of the Azure Active Directory default authorization policy. @@ -1503,7 +1553,7 @@ type DiagnosticDataTableResponseObject struct { Columns []*DiagnosticDataTableResponseColumn `json:"columns,omitempty"` // Rows in the table - Rows []interface{} `json:"rows,omitempty"` + Rows []any `json:"rows,omitempty"` // Table name TableName *string `json:"tableName,omitempty"` @@ -1656,12 +1706,6 @@ type EnvironmentAuthTokenProperties struct { Token *string `json:"token,omitempty" azure:"ro"` } -// EnvironmentSKUProperties - Managed Environment resource SKU properties. -type EnvironmentSKUProperties struct { - // REQUIRED; Name of the Sku. - Name *SKUName `json:"name,omitempty"` -} - // EnvironmentVar - Container App container environment variable. type EnvironmentVar struct { // Environment variable name. @@ -1677,7 +1721,7 @@ type EnvironmentVar struct { // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty" azure:"ro"` + Info any `json:"info,omitempty" azure:"ro"` // READ-ONLY; The additional info type. Type *string `json:"type,omitempty" azure:"ro"` @@ -1890,6 +1934,14 @@ type Ingress struct { // connections AllowInsecure *bool `json:"allowInsecure,omitempty"` + // 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. + ClientCertificateMode *IngressClientCertificateMode `json:"clientCertificateMode,omitempty"` + + // CORS policy for container app + CorsPolicy *CorsPolicy `json:"corsPolicy,omitempty"` + // custom domain bindings for Container Apps' hostnames. CustomDomains []*CustomDomain `json:"customDomains,omitempty"` @@ -1902,6 +1954,9 @@ type Ingress struct { // Rules to restrict incoming IP address. IPSecurityRestrictions []*IPSecurityRestrictionRule `json:"ipSecurityRestrictions,omitempty"` + // Sticky Sessions for Single Revision Mode + StickySessions *IngressStickySessions `json:"stickySessions,omitempty"` + // Target Port in containers for traffic from ingress TargetPort *int32 `json:"targetPort,omitempty"` @@ -1915,6 +1970,12 @@ type Ingress struct { Fqdn *string `json:"fqdn,omitempty" azure:"ro"` } +// IngressStickySessions - Sticky Sessions for Single Revision Mode +type IngressStickySessions struct { + // Sticky Session Affinity + Affinity *Affinity `json:"affinity,omitempty"` +} + // InitContainer - Container App init container definition type InitContainer struct { // Container start command arguments. @@ -1939,6 +2000,294 @@ type InitContainer struct { VolumeMounts []*VolumeMount `json:"volumeMounts,omitempty"` } +// Job - Container App Job +type Job struct { + // REQUIRED; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // The complex type of the extended location. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + + // 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 `json:"identity,omitempty"` + + // ContainerApp resource specific properties. + Properties *JobProperties `json:"properties,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// JobClientBeginCreateOrUpdateOptions contains the optional parameters for the JobClient.BeginCreateOrUpdate method. +type JobClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobClientBeginDeleteOptions contains the optional parameters for the JobClient.BeginDelete method. +type JobClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobClientBeginExecutionsOptions contains the optional parameters for the JobClient.BeginExecutions method. +type JobClientBeginExecutionsOptions struct { + // The filter to apply on the operation. + Filter *string + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobClientBeginRunOptions contains the optional parameters for the JobClient.BeginRun method. +type JobClientBeginRunOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobClientBeginUpdateOptions contains the optional parameters for the JobClient.BeginUpdate method. +type JobClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// JobClientGetOptions contains the optional parameters for the JobClient.Get method. +type JobClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobConfiguration - Non versioned Container Apps Job configuration properties +type JobConfiguration struct { + // REQUIRED; Maximum number of seconds a replica is allowed to run. + ReplicaTimeout *int32 `json:"replicaTimeout,omitempty"` + + // REQUIRED; Trigger type of the job + TriggerType *TriggerType `json:"triggerType,omitempty"` + + // Manual trigger configuration for a single execution job. Properties replicaCompletionCount and parallelism would be set + // to 1 by default + ManualTriggerConfig *JobConfigurationManualTriggerConfig `json:"manualTriggerConfig,omitempty"` + + // Collection of private container registry credentials used by a Container apps job + Registries []*RegistryCredentials `json:"registries,omitempty"` + + // Maximum number of retries before failing the job. + ReplicaRetryLimit *int32 `json:"replicaRetryLimit,omitempty"` + + // Cron formatted repeating trigger schedule ("* * * * *") for cronjobs. Properties completions and parallelism would be set + // to 1 by default + ScheduleTriggerConfig *JobConfigurationScheduleTriggerConfig `json:"scheduleTriggerConfig,omitempty"` + + // Collection of secrets used by a Container app + Secrets []*Secret `json:"secrets,omitempty"` +} + +// JobConfigurationManualTriggerConfig - Manual trigger configuration for a single execution job. Properties replicaCompletionCount +// and parallelism would be set to 1 by default +type JobConfigurationManualTriggerConfig struct { + // Number of parallel replicas of a job that can run at a given time. + Parallelism *int32 `json:"parallelism,omitempty"` + + // Minimum number of successful replica completions before overall job completion. + ReplicaCompletionCount *int32 `json:"replicaCompletionCount,omitempty"` +} + +// JobConfigurationScheduleTriggerConfig - Cron formatted repeating trigger schedule ("* * * * *") for cronjobs. Properties +// completions and parallelism would be set to 1 by default +type JobConfigurationScheduleTriggerConfig struct { + // REQUIRED; Cron formatted repeating schedule ("* * * * *") of a Cron Job. + CronExpression *string `json:"cronExpression,omitempty"` + + // Number of parallel replicas of a job that can run at a given time. + Parallelism *int32 `json:"parallelism,omitempty"` + + // Minimum number of successful replica completions before overall job completion. + ReplicaCompletionCount *int32 `json:"replicaCompletionCount,omitempty"` +} + +// JobExecution - Container Apps Jobs execution. +type JobExecution struct { + // Job execution start time. + EndTime *time.Time `json:"endTime,omitempty"` + + // Job execution Id. + ID *string `json:"id,omitempty"` + + // Job execution Name. + Name *string `json:"name,omitempty"` + + // Job execution start time. + StartTime *time.Time `json:"startTime,omitempty"` + + // Job's execution container. + Template *JobExecutionTemplate `json:"template,omitempty"` + + // Job Type. + Type *string `json:"type,omitempty"` + + // READ-ONLY; Current running State of the job + Status *JobExecutionRunningState `json:"status,omitempty" azure:"ro"` +} + +// JobExecutionBase - Container App's Job execution name. +type JobExecutionBase struct { + // Job execution Id. + ID *string `json:"id,omitempty"` + + // Job execution name. + Name *string `json:"name,omitempty"` +} + +// JobExecutionContainer - Container Apps Jobs execution container definition. +type JobExecutionContainer struct { + // Container start command arguments. + Args []*string `json:"args,omitempty"` + + // Container start command. + Command []*string `json:"command,omitempty"` + + // Container environment variables. + Env []*EnvironmentVar `json:"env,omitempty"` + + // Container image tag. + Image *string `json:"image,omitempty"` + + // Custom container name. + Name *string `json:"name,omitempty"` + + // Container resource requirements. + Resources *ContainerResources `json:"resources,omitempty"` +} + +// JobExecutionNamesCollection - Container App executions names list. +type JobExecutionNamesCollection struct { + // REQUIRED; Collection of resources. + Value []*JobExecutionBase `json:"value,omitempty"` +} + +// JobExecutionTemplate - Job's execution template, containing container configuration for a job's execution +type JobExecutionTemplate struct { + // List of container definitions for the Container Apps Job. + Containers []*JobExecutionContainer `json:"containers,omitempty"` + + // List of specialized containers that run before job containers. + InitContainers []*JobExecutionContainer `json:"initContainers,omitempty"` +} + +// JobPatchProperties - ContainerApp resource specific properties. +type JobPatchProperties struct { + // 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 `json:"identity,omitempty"` + Properties *JobPatchPropertiesProperties `json:"properties,omitempty"` +} + +type JobPatchPropertiesProperties struct { + // Container Apps Job configuration properties. + Configuration *JobConfiguration `json:"configuration,omitempty"` + + // Resource ID of environment. + EnvironmentID *string `json:"environmentId,omitempty"` + + // The endpoint of the eventstream of the container apps job. + EventStreamEndpoint *string `json:"eventStreamEndpoint,omitempty"` + + // Outbound IP Addresses of a container apps job. + OutboundIPAddresses []*string `json:"outboundIpAddresses,omitempty"` + + // Container Apps job definition. + Template *JobTemplate `json:"template,omitempty"` +} + +// JobProperties - ContainerApp resource specific properties. +type JobProperties struct { + // Container Apps Job configuration properties. + Configuration *JobConfiguration `json:"configuration,omitempty"` + + // Resource ID of environment. + EnvironmentID *string `json:"environmentId,omitempty"` + + // Container Apps job definition. + Template *JobTemplate `json:"template,omitempty"` + + // READ-ONLY; The endpoint of the eventstream of the container apps job. + EventStreamEndpoint *string `json:"eventStreamEndpoint,omitempty" azure:"ro"` + + // READ-ONLY; Outbound IP Addresses of a container apps job. + OutboundIPAddresses []*string `json:"outboundIpAddresses,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of the Container Apps Job. + ProvisioningState *JobProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// JobSecretsCollection - Container Apps Job Secrets Collection ARM resource. +type JobSecretsCollection struct { + // REQUIRED; Collection of resources. + Value []*Secret `json:"value,omitempty"` +} + +// JobTemplate - Container Apps Job versioned application definition. Defines the desired state of an immutable revision. +// Any changes to this section Will result in a new revision being created +type JobTemplate struct { + // List of container definitions for the Container App. + Containers []*Container `json:"containers,omitempty"` + + // List of specialized containers that run before app containers. + InitContainers []*InitContainer `json:"initContainers,omitempty"` + + // List of volume definitions for the Container App. + Volumes []*Volume `json:"volumes,omitempty"` +} + +// JobsClientBeginStopExecutionOptions contains the optional parameters for the JobsClient.BeginStopExecution method. +type JobsClientBeginStopExecutionOptions struct { + // Resumes the LRO 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 +} + +// JobsClientListByResourceGroupOptions contains the optional parameters for the JobsClient.NewListByResourceGroupPager method. +type JobsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// JobsClientListBySubscriptionOptions contains the optional parameters for the JobsClient.NewListBySubscriptionPager method. +type JobsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// JobsClientListSecretsOptions contains the optional parameters for the JobsClient.ListSecrets method. +type JobsClientListSecretsOptions struct { + // placeholder for future optional parameters +} + +// JobsCollection - Container Apps Jobs collection ARM resource. +type JobsCollection struct { + // REQUIRED; Collection of resources. + Value []*Job `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + // JwtClaimChecks - The configuration settings of the checks that should be made while validating the JWT Claims. type JwtClaimChecks struct { // The list of the allowed client applications. @@ -1948,6 +2297,12 @@ type JwtClaimChecks struct { AllowedGroups []*string `json:"allowedGroups,omitempty"` } +// KedaConfiguration - Configuration properties Keda component +type KedaConfiguration struct { + // READ-ONLY; The version of Keda + Version *string `json:"version,omitempty" azure:"ro"` +} + // LogAnalyticsConfiguration - Log analytics configuration type LogAnalyticsConfiguration struct { // Log analytics customer id @@ -1989,17 +2344,103 @@ type LoginScopes struct { Scopes []*string `json:"scopes,omitempty"` } +// 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 + Location *string `json:"location,omitempty"` + + // Certificate resource specific properties + Properties *ManagedCertificateProperties `json:"properties,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedCertificateCollection - Collection of Managed Certificates. +type ManagedCertificateCollection struct { + // REQUIRED; Collection of resources. + Value []*ManagedCertificate `json:"value,omitempty"` + + // READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// ManagedCertificatePatch - A managed certificate to update +type ManagedCertificatePatch struct { + // Application-specific metadata in the form of key-value pairs. + Tags map[string]*string `json:"tags,omitempty"` +} + +// ManagedCertificateProperties - Certificate resource specific properties +type ManagedCertificateProperties struct { + // Selected type of domain control validation for managed certificates. + DomainControlValidation *ManagedCertificateDomainControlValidation `json:"domainControlValidation,omitempty"` + + // Subject name of the certificate. + SubjectName *string `json:"subjectName,omitempty"` + + // READ-ONLY; Any error occurred during the certificate provision. + Error *string `json:"error,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of the certificate. + ProvisioningState *CertificateProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; A TXT token used for DNS TXT domain control validation when issuing this type of managed certificates. + ValidationToken *string `json:"validationToken,omitempty" azure:"ro"` +} + +// 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. + ResumeToken string +} + +// ManagedCertificatesClientDeleteOptions contains the optional parameters for the ManagedCertificatesClient.Delete method. +type ManagedCertificatesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ManagedCertificatesClientGetOptions contains the optional parameters for the ManagedCertificatesClient.Get method. +type ManagedCertificatesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedCertificatesClientListOptions contains the optional parameters for the ManagedCertificatesClient.NewListPager method. +type ManagedCertificatesClientListOptions struct { + // placeholder for future optional parameters +} + +// ManagedCertificatesClientUpdateOptions contains the optional parameters for the ManagedCertificatesClient.Update method. +type ManagedCertificatesClientUpdateOptions struct { + // placeholder for future optional parameters +} + // ManagedEnvironment - An environment for hosting container apps type ManagedEnvironment struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` + // Kind of the Environment. + Kind *string `json:"kind,omitempty"` + // Managed environment resource specific properties Properties *ManagedEnvironmentProperties `json:"properties,omitempty"` - // SKU properties of the Environment. - SKU *EnvironmentSKUProperties `json:"sku,omitempty"` - // Resource tags. Tags map[string]*string `json:"tags,omitempty"` @@ -2028,15 +2469,6 @@ type ManagedEnvironmentDiagnosticsClientListDetectorsOptions struct { // placeholder for future optional parameters } -// ManagedEnvironmentOutboundSettings - Configuration used to control the Environment Egress outbound traffic -type ManagedEnvironmentOutboundSettings struct { - // Outbound type for the cluster - OutBoundType *ManagedEnvironmentOutBoundType `json:"outBoundType,omitempty"` - - // Virtual Appliance IP used as the Egress controller for the Environment - VirtualNetworkApplianceIP *string `json:"virtualNetworkApplianceIp,omitempty"` -} - // ManagedEnvironmentProperties - Managed environment resource specific properties type ManagedEnvironmentProperties struct { // Cluster configuration which enables the log daemon to export app logs to a destination. Currently only "log-analytics" @@ -2052,6 +2484,17 @@ type ManagedEnvironmentProperties struct { // Azure Monitor instrumentation key used by Dapr to export Service to Service communication telemetry DaprAIInstrumentationKey *string `json:"daprAIInstrumentationKey,omitempty"` + // The configuration of Dapr component. + DaprConfiguration *DaprConfiguration `json:"daprConfiguration,omitempty"` + + // Name of the platform-managed resource group created for the Managed Environment to host infrastructure resources. If a + // subnet ID is provided, this resource group will be created in the same + // subscription as the subnet. + InfrastructureResourceGroup *string `json:"infrastructureResourceGroup,omitempty"` + + // The configuration of Keda component. + KedaConfiguration *KedaConfiguration `json:"kedaConfiguration,omitempty"` + // Vnet configuration for the environment VnetConfiguration *VnetConfiguration `json:"vnetConfiguration,omitempty"` @@ -2139,19 +2582,19 @@ type ManagedEnvironmentsClientGetOptions struct { // placeholder for future optional parameters } -// ManagedEnvironmentsClientListByResourceGroupOptions contains the optional parameters for the ManagedEnvironmentsClient.ListByResourceGroup +// ManagedEnvironmentsClientListByResourceGroupOptions contains the optional parameters for the ManagedEnvironmentsClient.NewListByResourceGroupPager // method. type ManagedEnvironmentsClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// ManagedEnvironmentsClientListBySubscriptionOptions contains the optional parameters for the ManagedEnvironmentsClient.ListBySubscription +// ManagedEnvironmentsClientListBySubscriptionOptions contains the optional parameters for the ManagedEnvironmentsClient.NewListBySubscriptionPager // method. type ManagedEnvironmentsClientListBySubscriptionOptions struct { // placeholder for future optional parameters } -// ManagedEnvironmentsClientListWorkloadProfileStatesOptions contains the optional parameters for the ManagedEnvironmentsClient.ListWorkloadProfileStates +// ManagedEnvironmentsClientListWorkloadProfileStatesOptions contains the optional parameters for the ManagedEnvironmentsClient.NewListWorkloadProfileStatesPager // method. type ManagedEnvironmentsClientListWorkloadProfileStatesOptions struct { // placeholder for future optional parameters @@ -2309,7 +2752,7 @@ type OperationDisplay struct { Resource *string `json:"resource,omitempty"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -2544,6 +2987,12 @@ type ScaleRuleAuth struct { // 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. + Identity *string `json:"identity,omitempty"` + + // Azure Key Vault URL pointing to the secret referenced by the container app. + KeyVaultURL *string `json:"keyVaultUrl,omitempty"` + // Secret Name. Name *string `json:"name,omitempty"` @@ -2551,6 +3000,15 @@ type Secret struct { Value *string `json:"value,omitempty"` } +// SecretVolumeItem - Secret to be added to volume. +type SecretVolumeItem struct { + // Path to project secret to. If no path is provided, path defaults to name of secret listed in secretRef. + Path *string `json:"path,omitempty"` + + // Name of the Container App secret from which to pull the secret value. + SecretRef *string `json:"secretRef,omitempty"` +} + // SecretsCollection - Container App Secrets Collection ARM resource. type SecretsCollection struct { // REQUIRED; Collection of resources. @@ -2719,29 +3177,19 @@ type VnetConfiguration struct { // CIDR notation IP range assigned to the Docker bridge, network. Must not overlap with any other provided IP ranges. DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` - // Resource ID of a subnet for infrastructure components. This subnet must be in the same VNET as the subnet defined in runtimeSubnetId. - // Must not overlap with any other provided IP ranges. + // Resource ID of a subnet for infrastructure components. Must not overlap with any other provided IP ranges. InfrastructureSubnetID *string `json:"infrastructureSubnetId,omitempty"` // Boolean indicating the environment only has an internal load balancer. These environments do not have a public static IP - // resource. They must provide runtimeSubnetId and infrastructureSubnetId if - // enabling this property + // resource. They must provide infrastructureSubnetId if enabling this property Internal *bool `json:"internal,omitempty"` - // Configuration used to control the Environment Egress outbound traffic - OutboundSettings *ManagedEnvironmentOutboundSettings `json:"outboundSettings,omitempty"` - // IP range in CIDR notation that can be reserved for environment infrastructure IP addresses. Must not overlap with any other // provided IP ranges. PlatformReservedCidr *string `json:"platformReservedCidr,omitempty"` // An IP address from the IP range defined by platformReservedCidr that will be reserved for the internal DNS server. PlatformReservedDNSIP *string `json:"platformReservedDnsIP,omitempty"` - - // Resource ID of a subnet that Container App containers are injected into. This subnet must be in the same VNET as the subnet - // defined in infrastructureSubnetId. Must not overlap with any other provided - // IP ranges. - RuntimeSubnetID *string `json:"runtimeSubnetId,omitempty"` } // Volume definitions for the Container App. @@ -2749,7 +3197,10 @@ type Volume struct { // Volume name. Name *string `json:"name,omitempty"` - // Name of storage resource. No need to provide for EmptyDir. + // List of secrets to be added in volume. If no secrets are provided, all secrets in collection will be added to volume. + Secrets []*SecretVolumeItem `json:"secrets,omitempty"` + + // Name of storage resource. No need to provide for EmptyDir and Secret. StorageName *string `json:"storageName,omitempty"` // Storage type for the volume. If not provided, use EmptyDir. @@ -2777,7 +3228,7 @@ type WorkloadProfile struct { WorkloadProfileType *string `json:"workloadProfileType,omitempty"` } -// WorkloadProfileStates - Collection of all the workload Profile States for a Premium Managed Environment.. +// WorkloadProfileStates - Collection of all the workload Profile States for a Managed Environment.. type WorkloadProfileStates struct { // Workload Profile resource specific properties. Properties *WorkloadProfileStatesProperties `json:"properties,omitempty"` diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go b/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go index 49e829f2e10f..5d1547119388 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/models_serde.go @@ -19,7 +19,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type AllowedAudiencesValidation. func (a AllowedAudiencesValidation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowedAudiences", a.AllowedAudiences) return json.Marshal(objectMap) } @@ -46,7 +46,7 @@ func (a *AllowedAudiencesValidation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AllowedPrincipals. func (a AllowedPrincipals) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "groups", a.Groups) populate(objectMap, "identities", a.Identities) return json.Marshal(objectMap) @@ -77,7 +77,7 @@ func (a *AllowedPrincipals) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AppLogsConfiguration. func (a AppLogsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "destination", a.Destination) populate(objectMap, "logAnalyticsConfiguration", a.LogAnalyticsConfiguration) return json.Marshal(objectMap) @@ -108,7 +108,7 @@ func (a *AppLogsConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AppRegistration. func (a AppRegistration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appId", a.AppID) populate(objectMap, "appSecretSettingName", a.AppSecretSettingName) return json.Marshal(objectMap) @@ -139,7 +139,7 @@ func (a *AppRegistration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Apple. func (a Apple) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", a.Enabled) populate(objectMap, "login", a.Login) populate(objectMap, "registration", a.Registration) @@ -174,7 +174,7 @@ func (a *Apple) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AppleRegistration. func (a AppleRegistration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", a.ClientID) populate(objectMap, "clientSecretSettingName", a.ClientSecretSettingName) return json.Marshal(objectMap) @@ -205,7 +205,7 @@ func (a *AppleRegistration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AuthConfig. func (a AuthConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -248,7 +248,7 @@ func (a *AuthConfig) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AuthConfigCollection. func (a AuthConfigCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -279,7 +279,7 @@ func (a *AuthConfigCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AuthConfigProperties. func (a AuthConfigProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "globalValidation", a.GlobalValidation) populate(objectMap, "httpSettings", a.HTTPSettings) populate(objectMap, "identityProviders", a.IdentityProviders) @@ -322,7 +322,7 @@ func (a *AuthConfigProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AuthPlatform. func (a AuthPlatform) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", a.Enabled) populate(objectMap, "runtimeVersion", a.RuntimeVersion) return json.Marshal(objectMap) @@ -353,7 +353,7 @@ func (a *AuthPlatform) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AvailableOperations. func (a AvailableOperations) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -384,7 +384,7 @@ func (a *AvailableOperations) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AvailableWorkloadProfile. func (a AvailableWorkloadProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "location", a.Location) populate(objectMap, "name", a.Name) @@ -431,9 +431,9 @@ func (a *AvailableWorkloadProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AvailableWorkloadProfileProperties. func (a AvailableWorkloadProfileProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "applicability", a.Applicability) - populate(objectMap, "billingMeterCategory", a.BillingMeterCategory) + populate(objectMap, "category", a.Category) populate(objectMap, "cores", a.Cores) populate(objectMap, "displayName", a.DisplayName) populate(objectMap, "memoryGiB", a.MemoryGiB) @@ -452,8 +452,8 @@ func (a *AvailableWorkloadProfileProperties) UnmarshalJSON(data []byte) error { case "applicability": err = unpopulate(val, "Applicability", &a.Applicability) delete(rawMsg, key) - case "billingMeterCategory": - err = unpopulate(val, "BillingMeterCategory", &a.BillingMeterCategory) + case "category": + err = unpopulate(val, "Category", &a.Category) delete(rawMsg, key) case "cores": err = unpopulate(val, "Cores", &a.Cores) @@ -474,7 +474,7 @@ func (a *AvailableWorkloadProfileProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AvailableWorkloadProfilesCollection. func (a AvailableWorkloadProfilesCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -505,7 +505,7 @@ func (a *AvailableWorkloadProfilesCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureActiveDirectory. func (a AzureActiveDirectory) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", a.Enabled) populate(objectMap, "isAutoProvisioned", a.IsAutoProvisioned) populate(objectMap, "login", a.Login) @@ -548,7 +548,7 @@ func (a *AzureActiveDirectory) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureActiveDirectoryLogin. func (a AzureActiveDirectoryLogin) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "disableWWWAuthenticate", a.DisableWWWAuthenticate) populate(objectMap, "loginParameters", a.LoginParameters) return json.Marshal(objectMap) @@ -579,7 +579,7 @@ func (a *AzureActiveDirectoryLogin) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureActiveDirectoryRegistration. func (a AzureActiveDirectoryRegistration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", a.ClientID) populate(objectMap, "clientSecretCertificateIssuer", a.ClientSecretCertificateIssuer) populate(objectMap, "clientSecretCertificateSubjectAlternativeName", a.ClientSecretCertificateSubjectAlternativeName) @@ -626,7 +626,7 @@ func (a *AzureActiveDirectoryRegistration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureActiveDirectoryValidation. func (a AzureActiveDirectoryValidation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowedAudiences", a.AllowedAudiences) populate(objectMap, "defaultAuthorizationPolicy", a.DefaultAuthorizationPolicy) populate(objectMap, "jwtClaimChecks", a.JwtClaimChecks) @@ -661,7 +661,7 @@ func (a *AzureActiveDirectoryValidation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureCredentials. func (a AzureCredentials) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", a.ClientID) populate(objectMap, "clientSecret", a.ClientSecret) populate(objectMap, "subscriptionId", a.SubscriptionID) @@ -700,7 +700,7 @@ func (a *AzureCredentials) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureFileProperties. func (a AzureFileProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "accessMode", a.AccessMode) populate(objectMap, "accountKey", a.AccountKey) populate(objectMap, "accountName", a.AccountName) @@ -739,7 +739,7 @@ func (a *AzureFileProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureStaticWebApps. func (a AzureStaticWebApps) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", a.Enabled) populate(objectMap, "registration", a.Registration) return json.Marshal(objectMap) @@ -770,7 +770,7 @@ func (a *AzureStaticWebApps) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureStaticWebAppsRegistration. func (a AzureStaticWebAppsRegistration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", a.ClientID) return json.Marshal(objectMap) } @@ -797,7 +797,7 @@ func (a *AzureStaticWebAppsRegistration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BaseContainer. func (b BaseContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "args", b.Args) populate(objectMap, "command", b.Command) populate(objectMap, "env", b.Env) @@ -848,7 +848,7 @@ func (b *BaseContainer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BillingMeter. func (b BillingMeter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", b.ID) populate(objectMap, "location", b.Location) populate(objectMap, "name", b.Name) @@ -895,7 +895,7 @@ func (b *BillingMeter) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BillingMeterCollection. func (b BillingMeterCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", b.Value) return json.Marshal(objectMap) } @@ -922,7 +922,7 @@ func (b *BillingMeterCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BillingMeterProperties. func (b BillingMeterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "category", b.Category) populate(objectMap, "displayName", b.DisplayName) populate(objectMap, "meterType", b.MeterType) @@ -957,7 +957,7 @@ func (b *BillingMeterProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Certificate. func (c Certificate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) @@ -1008,7 +1008,7 @@ func (c *Certificate) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CertificateCollection. func (c CertificateCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -1039,7 +1039,7 @@ func (c *CertificateCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CertificatePatch. func (c CertificatePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "tags", c.Tags) return json.Marshal(objectMap) } @@ -1066,7 +1066,7 @@ func (c *CertificatePatch) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CertificateProperties. func (c CertificateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "expirationDate", c.ExpirationDate) populateTimeRFC3339(objectMap, "issueDate", c.IssueDate) populate(objectMap, "issuer", c.Issuer) @@ -1133,7 +1133,7 @@ func (c *CertificateProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", c.Name) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) @@ -1164,7 +1164,7 @@ func (c *CheckNameAvailabilityRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResponse. func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "message", c.Message) populate(objectMap, "nameAvailable", c.NameAvailable) populate(objectMap, "reason", c.Reason) @@ -1199,7 +1199,7 @@ func (c *CheckNameAvailabilityResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ClientRegistration. func (c ClientRegistration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", c.ClientID) populate(objectMap, "clientSecretSettingName", c.ClientSecretSettingName) return json.Marshal(objectMap) @@ -1230,7 +1230,7 @@ func (c *ClientRegistration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Configuration. func (c Configuration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "activeRevisionsMode", c.ActiveRevisionsMode) populate(objectMap, "dapr", c.Dapr) populate(objectMap, "ingress", c.Ingress) @@ -1277,7 +1277,7 @@ func (c *Configuration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironment. func (c ConnectedEnvironment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "extendedLocation", c.ExtendedLocation) populate(objectMap, "id", c.ID) populate(objectMap, "location", c.Location) @@ -1332,7 +1332,7 @@ func (c *ConnectedEnvironment) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentCollection. func (c ConnectedEnvironmentCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -1363,7 +1363,7 @@ func (c *ConnectedEnvironmentCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentProperties. func (c ConnectedEnvironmentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "customDomainConfiguration", c.CustomDomainConfiguration) populate(objectMap, "daprAIConnectionString", c.DaprAIConnectionString) populate(objectMap, "defaultDomain", c.DefaultDomain) @@ -1410,7 +1410,7 @@ func (c *ConnectedEnvironmentProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentStorage. func (c ConnectedEnvironmentStorage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -1453,7 +1453,7 @@ func (c *ConnectedEnvironmentStorage) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentStorageProperties. func (c ConnectedEnvironmentStorageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "azureFile", c.AzureFile) return json.Marshal(objectMap) } @@ -1480,7 +1480,7 @@ func (c *ConnectedEnvironmentStorageProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ConnectedEnvironmentStoragesCollection. func (c ConnectedEnvironmentStoragesCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } @@ -1507,7 +1507,7 @@ func (c *ConnectedEnvironmentStoragesCollection) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type Container. func (c Container) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "args", c.Args) populate(objectMap, "command", c.Command) populate(objectMap, "env", c.Env) @@ -1562,11 +1562,12 @@ func (c *Container) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContainerApp. func (c ContainerApp) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) 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) @@ -1596,6 +1597,9 @@ func (c *ContainerApp) UnmarshalJSON(data []byte) error { case "location": err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &c.ManagedBy) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) @@ -1621,7 +1625,7 @@ func (c *ContainerApp) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContainerAppAuthToken. func (c ContainerAppAuthToken) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) @@ -1672,7 +1676,7 @@ func (c *ContainerAppAuthToken) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContainerAppAuthTokenProperties. func (c ContainerAppAuthTokenProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "expires", c.Expires) populate(objectMap, "token", c.Token) return json.Marshal(objectMap) @@ -1703,7 +1707,7 @@ func (c *ContainerAppAuthTokenProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContainerAppCollection. func (c ContainerAppCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -1732,9 +1736,40 @@ func (c *ContainerAppCollection) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ContainerAppJobExecutions. +func (c ContainerAppJobExecutions) 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 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ContainerAppProbe. func (c ContainerAppProbe) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "failureThreshold", c.FailureThreshold) populate(objectMap, "httpGet", c.HTTPGet) populate(objectMap, "initialDelaySeconds", c.InitialDelaySeconds) @@ -1793,7 +1828,7 @@ func (c *ContainerAppProbe) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContainerAppProbeHTTPGet. func (c ContainerAppProbeHTTPGet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "httpHeaders", c.HTTPHeaders) populate(objectMap, "host", c.Host) populate(objectMap, "path", c.Path) @@ -1836,7 +1871,7 @@ func (c *ContainerAppProbeHTTPGet) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContainerAppProbeHTTPGetHTTPHeadersItem. func (c ContainerAppProbeHTTPGetHTTPHeadersItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", c.Name) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -1867,7 +1902,7 @@ func (c *ContainerAppProbeHTTPGetHTTPHeadersItem) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type ContainerAppProbeTCPSocket. func (c ContainerAppProbeTCPSocket) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "host", c.Host) populate(objectMap, "port", c.Port) return json.Marshal(objectMap) @@ -1898,15 +1933,16 @@ func (c *ContainerAppProbeTCPSocket) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContainerAppProperties. func (c ContainerAppProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) 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, "outboundIpAddresses", c.OutboundIPAddresses) populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "template", c.Template) populate(objectMap, "workloadProfileType", c.WorkloadProfileType) @@ -1934,6 +1970,9 @@ func (c *ContainerAppProperties) UnmarshalJSON(data []byte) error { case "eventStreamEndpoint": err = unpopulate(val, "EventStreamEndpoint", &c.EventStreamEndpoint) delete(rawMsg, key) + case "latestReadyRevisionName": + err = unpopulate(val, "LatestReadyRevisionName", &c.LatestReadyRevisionName) + delete(rawMsg, key) case "latestRevisionFqdn": err = unpopulate(val, "LatestRevisionFqdn", &c.LatestRevisionFqdn) delete(rawMsg, key) @@ -1943,7 +1982,7 @@ func (c *ContainerAppProperties) UnmarshalJSON(data []byte) error { case "managedEnvironmentId": err = unpopulate(val, "ManagedEnvironmentID", &c.ManagedEnvironmentID) delete(rawMsg, key) - case "outboundIPAddresses": + case "outboundIpAddresses": err = unpopulate(val, "OutboundIPAddresses", &c.OutboundIPAddresses) delete(rawMsg, key) case "provisioningState": @@ -1965,7 +2004,9 @@ func (c *ContainerAppProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContainerAppSecret. func (c ContainerAppSecret) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + 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) return json.Marshal(objectMap) @@ -1980,6 +2021,12 @@ 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) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) @@ -1996,7 +2043,7 @@ func (c *ContainerAppSecret) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContainerResources. func (c ContainerResources) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cpu", c.CPU) populate(objectMap, "ephemeralStorage", c.EphemeralStorage) populate(objectMap, "memory", c.Memory) @@ -2031,7 +2078,7 @@ func (c *ContainerResources) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CookieExpiration. func (c CookieExpiration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "convention", c.Convention) populate(objectMap, "timeToExpiration", c.TimeToExpiration) return json.Marshal(objectMap) @@ -2060,9 +2107,56 @@ func (c *CookieExpiration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CorsPolicy. +func (c CorsPolicy) 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) + return json.Marshal(objectMap) +} + +// 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) + } + 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) + delete(rawMsg, key) + case "maxAge": + err = unpopulate(val, "MaxAge", &c.MaxAge) + 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 CustomDomain. func (c CustomDomain) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bindingType", c.BindingType) populate(objectMap, "certificateId", c.CertificateID) populate(objectMap, "name", c.Name) @@ -2097,8 +2191,8 @@ func (c *CustomDomain) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CustomDomainConfiguration. func (c CustomDomainConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateByteArray(objectMap, "certificatePassword", c.CertificatePassword, runtime.Base64StdFormat) + objectMap := make(map[string]any) + populate(objectMap, "certificatePassword", c.CertificatePassword) populateByteArray(objectMap, "certificateValue", c.CertificateValue, runtime.Base64StdFormat) populate(objectMap, "customDomainVerificationId", c.CustomDomainVerificationID) populate(objectMap, "dnsSuffix", c.DNSSuffix) @@ -2118,7 +2212,7 @@ func (c *CustomDomainConfiguration) UnmarshalJSON(data []byte) error { var err error switch key { case "certificatePassword": - err = runtime.DecodeByteArray(string(val), &c.CertificatePassword, runtime.Base64StdFormat) + err = unpopulate(val, "CertificatePassword", &c.CertificatePassword) delete(rawMsg, key) case "certificateValue": err = runtime.DecodeByteArray(string(val), &c.CertificateValue, runtime.Base64StdFormat) @@ -2148,7 +2242,7 @@ func (c *CustomDomainConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CustomHostnameAnalysisResult. func (c CustomHostnameAnalysisResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "aRecords", c.ARecords) populate(objectMap, "alternateCNameRecords", c.AlternateCNameRecords) populate(objectMap, "alternateTxtRecords", c.AlternateTxtRecords) @@ -2219,7 +2313,7 @@ func (c *CustomHostnameAnalysisResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo. func (c CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", c.Code) populate(objectMap, "details", c.Details) populate(objectMap, "message", c.Message) @@ -2258,7 +2352,7 @@ func (c *CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo) Unmars // MarshalJSON implements the json.Marshaller interface for type CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem. func (c CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", c.Code) populate(objectMap, "message", c.Message) populate(objectMap, "target", c.Target) @@ -2293,7 +2387,7 @@ func (c *CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsI // MarshalJSON implements the json.Marshaller interface for type CustomOpenIDConnectProvider. func (c CustomOpenIDConnectProvider) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", c.Enabled) populate(objectMap, "login", c.Login) populate(objectMap, "registration", c.Registration) @@ -2328,7 +2422,7 @@ func (c *CustomOpenIDConnectProvider) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CustomScaleRule. func (c CustomScaleRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "auth", c.Auth) populate(objectMap, "metadata", c.Metadata) populate(objectMap, "type", c.Type) @@ -2363,7 +2457,7 @@ func (c *CustomScaleRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Dapr. func (d Dapr) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "appId", d.AppID) populate(objectMap, "appPort", d.AppPort) populate(objectMap, "appProtocol", d.AppProtocol) @@ -2418,7 +2512,7 @@ func (d *Dapr) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprComponent. func (d DaprComponent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) @@ -2461,7 +2555,7 @@ func (d *DaprComponent) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprComponentProperties. func (d DaprComponentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "componentType", d.ComponentType) populate(objectMap, "ignoreErrors", d.IgnoreErrors) populate(objectMap, "initTimeout", d.InitTimeout) @@ -2516,7 +2610,7 @@ func (d *DaprComponentProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprComponentsCollection. func (d DaprComponentsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) @@ -2545,9 +2639,36 @@ func (d *DaprComponentsCollection) UnmarshalJSON(data []byte) error { 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]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", d.Name) populate(objectMap, "secretRef", d.SecretRef) populate(objectMap, "value", d.Value) @@ -2582,7 +2703,7 @@ func (d *DaprMetadata) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprSecret. func (d DaprSecret) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", d.Name) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) @@ -2613,7 +2734,7 @@ func (d *DaprSecret) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DaprSecretsCollection. func (d DaprSecretsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } @@ -2640,7 +2761,7 @@ func (d *DaprSecretsCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefaultAuthorizationPolicy. func (d DefaultAuthorizationPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowedApplications", d.AllowedApplications) populate(objectMap, "allowedPrincipals", d.AllowedPrincipals) return json.Marshal(objectMap) @@ -2671,7 +2792,7 @@ func (d *DefaultAuthorizationPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefaultErrorResponse. func (d DefaultErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", d.Error) return json.Marshal(objectMap) } @@ -2698,7 +2819,7 @@ func (d *DefaultErrorResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefaultErrorResponseError. func (d DefaultErrorResponseError) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", d.Code) populate(objectMap, "details", d.Details) populate(objectMap, "innererror", d.Innererror) @@ -2741,7 +2862,7 @@ func (d *DefaultErrorResponseError) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefaultErrorResponseErrorDetailsItem. func (d DefaultErrorResponseErrorDetailsItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", d.Code) populate(objectMap, "message", d.Message) populate(objectMap, "target", d.Target) @@ -2776,7 +2897,7 @@ func (d *DefaultErrorResponseErrorDetailsItem) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type DiagnosticDataProviderMetadata. func (d DiagnosticDataProviderMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "propertyBag", d.PropertyBag) populate(objectMap, "providerName", d.ProviderName) return json.Marshal(objectMap) @@ -2807,7 +2928,7 @@ func (d *DiagnosticDataProviderMetadata) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiagnosticDataProviderMetadataPropertyBagItem. func (d DiagnosticDataProviderMetadataPropertyBagItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", d.Name) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) @@ -2838,7 +2959,7 @@ func (d *DiagnosticDataProviderMetadataPropertyBagItem) UnmarshalJSON(data []byt // MarshalJSON implements the json.Marshaller interface for type DiagnosticDataTableResponseColumn. func (d DiagnosticDataTableResponseColumn) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "columnName", d.ColumnName) populate(objectMap, "columnType", d.ColumnType) populate(objectMap, "dataType", d.DataType) @@ -2873,7 +2994,7 @@ func (d *DiagnosticDataTableResponseColumn) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiagnosticDataTableResponseObject. func (d DiagnosticDataTableResponseObject) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "columns", d.Columns) populate(objectMap, "rows", d.Rows) populate(objectMap, "tableName", d.TableName) @@ -2908,7 +3029,7 @@ func (d *DiagnosticDataTableResponseObject) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiagnosticRendering. func (d DiagnosticRendering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", d.Description) populate(objectMap, "isVisible", d.IsVisible) populate(objectMap, "title", d.Title) @@ -2947,7 +3068,7 @@ func (d *DiagnosticRendering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiagnosticSupportTopic. func (d DiagnosticSupportTopic) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "pesId", d.PesID) return json.Marshal(objectMap) @@ -2978,7 +3099,7 @@ func (d *DiagnosticSupportTopic) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Diagnostics. func (d Diagnostics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) @@ -3021,7 +3142,7 @@ func (d *Diagnostics) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiagnosticsCollection. func (d DiagnosticsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) @@ -3052,7 +3173,7 @@ func (d *DiagnosticsCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiagnosticsDataAPIResponse. func (d DiagnosticsDataAPIResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "renderingProperties", d.RenderingProperties) populate(objectMap, "table", d.Table) return json.Marshal(objectMap) @@ -3083,7 +3204,7 @@ func (d *DiagnosticsDataAPIResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiagnosticsDefinition. func (d DiagnosticsDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "analysisTypes", d.AnalysisTypes) populate(objectMap, "author", d.Author) populate(objectMap, "category", d.Category) @@ -3142,7 +3263,7 @@ func (d *DiagnosticsDefinition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiagnosticsProperties. func (d DiagnosticsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dataProviderMetadata", d.DataProviderMetadata) populate(objectMap, "dataset", d.Dataset) populate(objectMap, "metadata", d.Metadata) @@ -3181,7 +3302,7 @@ func (d *DiagnosticsProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiagnosticsStatus. func (d DiagnosticsStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "message", d.Message) populate(objectMap, "statusId", d.StatusID) return json.Marshal(objectMap) @@ -3212,7 +3333,7 @@ func (d *DiagnosticsStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EnvironmentAuthToken. func (e EnvironmentAuthToken) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", e.ID) populate(objectMap, "location", e.Location) populate(objectMap, "name", e.Name) @@ -3263,7 +3384,7 @@ func (e *EnvironmentAuthToken) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EnvironmentAuthTokenProperties. func (e EnvironmentAuthTokenProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "expires", e.Expires) populate(objectMap, "token", e.Token) return json.Marshal(objectMap) @@ -3292,36 +3413,9 @@ func (e *EnvironmentAuthTokenProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type EnvironmentSKUProperties. -func (e EnvironmentSKUProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", e.Name) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentSKUProperties. -func (e *EnvironmentSKUProperties) UnmarshalJSON(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) - } - 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]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", e.Name) populate(objectMap, "secretRef", e.SecretRef) populate(objectMap, "value", e.Value) @@ -3356,7 +3450,7 @@ func (e *EnvironmentVar) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "info", &e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) @@ -3387,7 +3481,7 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorDetail. func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalInfo", e.AdditionalInfo) populate(objectMap, "code", e.Code) populate(objectMap, "details", e.Details) @@ -3430,7 +3524,7 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } @@ -3457,7 +3551,7 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ExtendedLocation. func (e ExtendedLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", e.Name) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) @@ -3488,7 +3582,7 @@ func (e *ExtendedLocation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Facebook. func (f Facebook) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", f.Enabled) populate(objectMap, "graphApiVersion", f.GraphAPIVersion) populate(objectMap, "login", f.Login) @@ -3527,7 +3621,7 @@ func (f *Facebook) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ForwardProxy. func (f ForwardProxy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "convention", f.Convention) populate(objectMap, "customHostHeaderName", f.CustomHostHeaderName) populate(objectMap, "customProtoHeaderName", f.CustomProtoHeaderName) @@ -3562,7 +3656,7 @@ func (f *ForwardProxy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GitHub. func (g GitHub) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", g.Enabled) populate(objectMap, "login", g.Login) populate(objectMap, "registration", g.Registration) @@ -3597,7 +3691,7 @@ func (g *GitHub) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GithubActionConfiguration. func (g GithubActionConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "azureCredentials", g.AzureCredentials) populate(objectMap, "contextPath", g.ContextPath) populate(objectMap, "image", g.Image) @@ -3652,7 +3746,7 @@ func (g *GithubActionConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GlobalValidation. func (g GlobalValidation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "excludedPaths", g.ExcludedPaths) populate(objectMap, "redirectToProvider", g.RedirectToProvider) populate(objectMap, "unauthenticatedClientAction", g.UnauthenticatedClientAction) @@ -3687,7 +3781,7 @@ func (g *GlobalValidation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Google. func (g Google) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", g.Enabled) populate(objectMap, "login", g.Login) populate(objectMap, "registration", g.Registration) @@ -3726,7 +3820,7 @@ func (g *Google) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HTTPScaleRule. func (h HTTPScaleRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "auth", h.Auth) populate(objectMap, "metadata", h.Metadata) return json.Marshal(objectMap) @@ -3757,7 +3851,7 @@ func (h *HTTPScaleRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HTTPSettings. func (h HTTPSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "forwardProxy", h.ForwardProxy) populate(objectMap, "requireHttps", h.RequireHTTPS) populate(objectMap, "routes", h.Routes) @@ -3792,7 +3886,7 @@ func (h *HTTPSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HTTPSettingsRoutes. func (h HTTPSettingsRoutes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "apiPrefix", h.APIPrefix) return json.Marshal(objectMap) } @@ -3819,7 +3913,7 @@ func (h *HTTPSettingsRoutes) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IPSecurityRestrictionRule. func (i IPSecurityRestrictionRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "action", i.Action) populate(objectMap, "description", i.Description) populate(objectMap, "ipAddressRange", i.IPAddressRange) @@ -3858,7 +3952,7 @@ func (i *IPSecurityRestrictionRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IdentityProviders. func (i IdentityProviders) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "apple", i.Apple) populate(objectMap, "azureActiveDirectory", i.AzureActiveDirectory) populate(objectMap, "azureStaticWebApps", i.AzureStaticWebApps) @@ -3913,13 +4007,16 @@ func (i *IdentityProviders) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Ingress. func (i Ingress) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) 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) @@ -3938,6 +4035,12 @@ func (i *Ingress) UnmarshalJSON(data []byte) error { 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) @@ -3953,6 +4056,9 @@ func (i *Ingress) UnmarshalJSON(data []byte) error { 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) @@ -3970,9 +4076,36 @@ func (i *Ingress) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type IngressStickySessions. +func (i IngressStickySessions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "affinity", i.Affinity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IngressStickySessions. +func (i *IngressStickySessions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "affinity": + err = unpopulate(val, "Affinity", &i.Affinity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type InitContainer. func (i InitContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "args", i.Args) populate(objectMap, "command", i.Command) populate(objectMap, "env", i.Env) @@ -4021,16 +4154,23 @@ func (i *InitContainer) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type JwtClaimChecks. -func (j JwtClaimChecks) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowedClientApplications", j.AllowedClientApplications) - populate(objectMap, "allowedGroups", j.AllowedGroups) +// MarshalJSON implements the json.Marshaller interface for type Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "extendedLocation", j.ExtendedLocation) + populate(objectMap, "id", j.ID) + populate(objectMap, "identity", j.Identity) + populate(objectMap, "location", j.Location) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "systemData", j.SystemData) + populate(objectMap, "tags", j.Tags) + populate(objectMap, "type", j.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JwtClaimChecks. -func (j *JwtClaimChecks) 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", j, err) @@ -4038,11 +4178,32 @@ 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 "extendedLocation": + err = unpopulate(val, "ExtendedLocation", &j.ExtendedLocation) delete(rawMsg, key) - case "allowedGroups": - err = unpopulate(val, "AllowedGroups", &j.AllowedGroups) + 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 { @@ -4052,174 +4213,746 @@ func (j *JwtClaimChecks) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsConfiguration. -func (l LogAnalyticsConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customerId", l.CustomerID) - populate(objectMap, "sharedKey", l.SharedKey) +// MarshalJSON implements the json.Marshaller interface for type JobConfiguration. +func (j JobConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 LogAnalyticsConfiguration. -func (l *LogAnalyticsConfiguration) 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 "customerId": - err = unpopulate(val, "CustomerID", &l.CustomerID) + case "manualTriggerConfig": + err = unpopulate(val, "ManualTriggerConfig", &j.ManualTriggerConfig) delete(rawMsg, key) - case "sharedKey": - err = unpopulate(val, "SharedKey", &l.SharedKey) + 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 Login. -func (l Login) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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) +// MarshalJSON implements the json.Marshaller interface for type JobConfigurationManualTriggerConfig. +func (j JobConfigurationManualTriggerConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "parallelism", j.Parallelism) + populate(objectMap, "replicaCompletionCount", j.ReplicaCompletionCount) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Login. -func (l *Login) 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 "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) + case "parallelism": + err = unpopulate(val, "Parallelism", &j.Parallelism) delete(rawMsg, key) - case "routes": - err = unpopulate(val, "Routes", &l.Routes) + 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 LoginRoutes. -func (l LoginRoutes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "logoutEndpoint", l.LogoutEndpoint) +// MarshalJSON implements the json.Marshaller interface for type JobConfigurationScheduleTriggerConfig. +func (j JobConfigurationScheduleTriggerConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cronExpression", j.CronExpression) + populate(objectMap, "parallelism", j.Parallelism) + populate(objectMap, "replicaCompletionCount", j.ReplicaCompletionCount) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LoginRoutes. -func (l *LoginRoutes) 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 "logoutEndpoint": - err = unpopulate(val, "LogoutEndpoint", &l.LogoutEndpoint) + case "cronExpression": + err = unpopulate(val, "CronExpression", &j.CronExpression) + delete(rawMsg, key) + case "parallelism": + err = unpopulate(val, "Parallelism", &j.Parallelism) + delete(rawMsg, key) + case "replicaCompletionCount": + err = unpopulate(val, "ReplicaCompletionCount", &j.ReplicaCompletionCount) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", 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) { - objectMap := make(map[string]interface{}) - populate(objectMap, "scopes", l.Scopes) +// MarshalJSON implements the json.Marshaller interface for type JobExecution. +func (j JobExecution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "endTime", j.EndTime) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "status", j.Status) + populate(objectMap, "template", j.Template) + populate(objectMap, "type", j.Type) 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 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 "scopes": - err = unpopulate(val, "Scopes", &l.Scopes) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &j.Status) + delete(rawMsg, key) + case "template": + err = unpopulate(val, "Template", &j.Template) + delete(rawMsg, key) + 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 ManagedEnvironment. -func (m ManagedEnvironment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "sku", m.SKU) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) +// MarshalJSON implements the json.Marshaller interface for type JobExecutionBase. +func (j JobExecutionBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedEnvironment. -func (m *ManagedEnvironment) 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", 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) + err = unpopulate(val, "ID", &j.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 "sku": - err = unpopulate(val, "SKU", &m.SKU) + err = unpopulate(val, "Name", &j.Name) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobExecutionContainer. +func (j JobExecutionContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "args", j.Args) + populate(objectMap, "command", j.Command) + populate(objectMap, "env", j.Env) + populate(objectMap, "image", j.Image) + populate(objectMap, "name", j.Name) + populate(objectMap, "resources", j.Resources) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionContainer. +func (j *JobExecutionContainer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "args": + err = unpopulate(val, "Args", &j.Args) + delete(rawMsg, key) + case "command": + err = unpopulate(val, "Command", &j.Command) + delete(rawMsg, key) + case "env": + err = unpopulate(val, "Env", &j.Env) + delete(rawMsg, key) + case "image": + err = unpopulate(val, "Image", &j.Image) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "resources": + err = unpopulate(val, "Resources", &j.Resources) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobExecutionNamesCollection. +func (j JobExecutionNamesCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionNamesCollection. +func (j *JobExecutionNamesCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobExecutionTemplate. +func (j JobExecutionTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containers", j.Containers) + populate(objectMap, "initContainers", j.InitContainers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionTemplate. +func (j *JobExecutionTemplate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "containers": + err = unpopulate(val, "Containers", &j.Containers) + delete(rawMsg, key) + case "initContainers": + err = unpopulate(val, "InitContainers", &j.InitContainers) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobPatchProperties. +func (j JobPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identity", j.Identity) + populate(objectMap, "properties", j.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobPatchProperties. +func (j *JobPatchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &j.Identity) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobPatchPropertiesProperties. +func (j JobPatchPropertiesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configuration", j.Configuration) + populate(objectMap, "environmentId", j.EnvironmentID) + populate(objectMap, "eventStreamEndpoint", j.EventStreamEndpoint) + populate(objectMap, "outboundIpAddresses", j.OutboundIPAddresses) + populate(objectMap, "template", j.Template) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobPatchPropertiesProperties. +func (j *JobPatchPropertiesProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configuration": + err = unpopulate(val, "Configuration", &j.Configuration) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &j.EnvironmentID) + delete(rawMsg, key) + case "eventStreamEndpoint": + err = unpopulate(val, "EventStreamEndpoint", &j.EventStreamEndpoint) + delete(rawMsg, key) + case "outboundIpAddresses": + err = unpopulate(val, "OutboundIPAddresses", &j.OutboundIPAddresses) + delete(rawMsg, key) + case "template": + err = unpopulate(val, "Template", &j.Template) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobProperties. +func (j JobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configuration", j.Configuration) + populate(objectMap, "environmentId", j.EnvironmentID) + populate(objectMap, "eventStreamEndpoint", j.EventStreamEndpoint) + populate(objectMap, "outboundIpAddresses", j.OutboundIPAddresses) + populate(objectMap, "provisioningState", j.ProvisioningState) + populate(objectMap, "template", j.Template) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobProperties. +func (j *JobProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configuration": + err = unpopulate(val, "Configuration", &j.Configuration) + delete(rawMsg, key) + case "environmentId": + err = unpopulate(val, "EnvironmentID", &j.EnvironmentID) + delete(rawMsg, key) + case "eventStreamEndpoint": + err = unpopulate(val, "EventStreamEndpoint", &j.EventStreamEndpoint) + delete(rawMsg, key) + case "outboundIpAddresses": + err = unpopulate(val, "OutboundIPAddresses", &j.OutboundIPAddresses) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &j.ProvisioningState) + delete(rawMsg, key) + case "template": + err = unpopulate(val, "Template", &j.Template) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobSecretsCollection. +func (j JobSecretsCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobSecretsCollection. +func (j *JobSecretsCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobTemplate. +func (j JobTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containers", j.Containers) + populate(objectMap, "initContainers", j.InitContainers) + populate(objectMap, "volumes", j.Volumes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobTemplate. +func (j *JobTemplate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "containers": + err = unpopulate(val, "Containers", &j.Containers) + delete(rawMsg, key) + case "initContainers": + err = unpopulate(val, "InitContainers", &j.InitContainers) + delete(rawMsg, key) + case "volumes": + err = unpopulate(val, "Volumes", &j.Volumes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobsCollection. +func (j JobsCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobsCollection. +func (j *JobsCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JwtClaimChecks. +func (j JwtClaimChecks) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedClientApplications", j.AllowedClientApplications) + populate(objectMap, "allowedGroups", j.AllowedGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JwtClaimChecks. +func (j *JwtClaimChecks) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedClientApplications": + err = unpopulate(val, "AllowedClientApplications", &j.AllowedClientApplications) + delete(rawMsg, key) + case "allowedGroups": + err = unpopulate(val, "AllowedGroups", &j.AllowedGroups) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KedaConfiguration. +func (k KedaConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "version", k.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KedaConfiguration. +func (k *KedaConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "version": + err = unpopulate(val, "Version", &k.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsConfiguration. +func (l LogAnalyticsConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customerId", l.CustomerID) + populate(objectMap, "sharedKey", l.SharedKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsConfiguration. +func (l *LogAnalyticsConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customerId": + err = unpopulate(val, "CustomerID", &l.CustomerID) + delete(rawMsg, key) + case "sharedKey": + err = unpopulate(val, "SharedKey", &l.SharedKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Login. +func (l Login) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedExternalRedirectUrls", l.AllowedExternalRedirectUrls) + populate(objectMap, "cookieExpiration", l.CookieExpiration) + populate(objectMap, "nonce", l.Nonce) + populate(objectMap, "preserveUrlFragmentsForLogins", l.PreserveURLFragmentsForLogins) + populate(objectMap, "routes", l.Routes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Login. +func (l *Login) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowedExternalRedirectUrls": + err = unpopulate(val, "AllowedExternalRedirectUrls", &l.AllowedExternalRedirectUrls) + delete(rawMsg, key) + case "cookieExpiration": + err = unpopulate(val, "CookieExpiration", &l.CookieExpiration) + delete(rawMsg, key) + case "nonce": + err = unpopulate(val, "Nonce", &l.Nonce) + delete(rawMsg, key) + case "preserveUrlFragmentsForLogins": + err = unpopulate(val, "PreserveURLFragmentsForLogins", &l.PreserveURLFragmentsForLogins) + delete(rawMsg, key) + case "routes": + err = unpopulate(val, "Routes", &l.Routes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LoginRoutes. +func (l LoginRoutes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "logoutEndpoint", l.LogoutEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoginRoutes. +func (l *LoginRoutes) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "logoutEndpoint": + err = unpopulate(val, "LogoutEndpoint", &l.LogoutEndpoint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LoginScopes. +func (l LoginScopes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "scopes", l.Scopes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoginScopes. +func (l *LoginScopes) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "scopes": + err = unpopulate(val, "Scopes", &l.Scopes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedCertificate. +func (m ManagedCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificate. +func (m *ManagedCertificate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &m.Tags) @@ -4235,16 +4968,123 @@ func (m *ManagedEnvironment) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentOutboundSettings. -func (m ManagedEnvironmentOutboundSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "outBoundType", m.OutBoundType) - populate(objectMap, "virtualNetworkApplianceIp", m.VirtualNetworkApplianceIP) +// MarshalJSON implements the json.Marshaller interface for type ManagedCertificateCollection. +func (m ManagedCertificateCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificateCollection. +func (m *ManagedCertificateCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedCertificatePatch. +func (m ManagedCertificatePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificatePatch. +func (m *ManagedCertificatePatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedCertificateProperties. +func (m ManagedCertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "domainControlValidation", m.DomainControlValidation) + populate(objectMap, "error", m.Error) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "subjectName", m.SubjectName) + populate(objectMap, "validationToken", m.ValidationToken) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedCertificateProperties. +func (m *ManagedCertificateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "domainControlValidation": + err = unpopulate(val, "DomainControlValidation", &m.DomainControlValidation) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &m.Error) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "subjectName": + err = unpopulate(val, "SubjectName", &m.SubjectName) + delete(rawMsg, key) + case "validationToken": + err = unpopulate(val, "ValidationToken", &m.ValidationToken) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedEnvironment. +func (m ManagedEnvironment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "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 ManagedEnvironmentOutboundSettings. -func (m *ManagedEnvironmentOutboundSettings) 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", m, err) @@ -4252,11 +5092,29 @@ func (m *ManagedEnvironmentOutboundSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "outBoundType": - err = unpopulate(val, "OutBoundType", &m.OutBoundType) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) delete(rawMsg, key) - case "virtualNetworkApplianceIp": - err = unpopulate(val, "VirtualNetworkApplianceIP", &m.VirtualNetworkApplianceIP) + 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 { @@ -4268,14 +5126,17 @@ func (m *ManagedEnvironmentOutboundSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentProperties. func (m ManagedEnvironmentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) 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, "provisioningState", m.ProvisioningState) populate(objectMap, "staticIp", m.StaticIP) populate(objectMap, "vnetConfiguration", m.VnetConfiguration) @@ -4305,6 +5166,9 @@ func (m *ManagedEnvironmentProperties) UnmarshalJSON(data []byte) error { 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) @@ -4314,6 +5178,12 @@ func (m *ManagedEnvironmentProperties) UnmarshalJSON(data []byte) error { 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 "provisioningState": err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) delete(rawMsg, key) @@ -4339,7 +5209,7 @@ func (m *ManagedEnvironmentProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentStorage. func (m ManagedEnvironmentStorage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) @@ -4382,7 +5252,7 @@ func (m *ManagedEnvironmentStorage) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentStorageProperties. func (m ManagedEnvironmentStorageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "azureFile", m.AzureFile) return json.Marshal(objectMap) } @@ -4409,7 +5279,7 @@ func (m *ManagedEnvironmentStorageProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentStoragesCollection. func (m ManagedEnvironmentStoragesCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } @@ -4436,7 +5306,7 @@ func (m *ManagedEnvironmentStoragesCollection) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ManagedEnvironmentsCollection. func (m ManagedEnvironmentsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", m.NextLink) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) @@ -4467,7 +5337,7 @@ func (m *ManagedEnvironmentsCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "principalId", m.PrincipalID) populate(objectMap, "tenantId", m.TenantID) populate(objectMap, "type", m.Type) @@ -4506,7 +5376,7 @@ func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Nonce. func (n Nonce) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nonceExpirationInterval", n.NonceExpirationInterval) populate(objectMap, "validateNonce", n.ValidateNonce) return json.Marshal(objectMap) @@ -4537,7 +5407,7 @@ func (n *Nonce) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OpenIDConnectClientCredential. func (o OpenIDConnectClientCredential) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientSecretSettingName", o.ClientSecretSettingName) objectMap["method"] = "ClientSecretPost" return json.Marshal(objectMap) @@ -4568,7 +5438,7 @@ func (o *OpenIDConnectClientCredential) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OpenIDConnectConfig. func (o OpenIDConnectConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "authorizationEndpoint", o.AuthorizationEndpoint) populate(objectMap, "certificationUri", o.CertificationURI) populate(objectMap, "issuer", o.Issuer) @@ -4611,7 +5481,7 @@ func (o *OpenIDConnectConfig) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OpenIDConnectLogin. func (o OpenIDConnectLogin) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nameClaimType", o.NameClaimType) populate(objectMap, "scopes", o.Scopes) return json.Marshal(objectMap) @@ -4642,7 +5512,7 @@ func (o *OpenIDConnectLogin) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OpenIDConnectRegistration. func (o OpenIDConnectRegistration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientCredential", o.ClientCredential) populate(objectMap, "clientId", o.ClientID) populate(objectMap, "openIdConnectConfiguration", o.OpenIDConnectConfiguration) @@ -4677,7 +5547,7 @@ func (o *OpenIDConnectRegistration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDetail. func (o OperationDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "display", o.Display) populate(objectMap, "isDataAction", o.IsDataAction) populate(objectMap, "name", o.Name) @@ -4716,7 +5586,7 @@ func (o *OperationDetail) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -4755,7 +5625,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProxyResource. func (p ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "systemData", p.SystemData) @@ -4794,7 +5664,7 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type QueueScaleRule. func (q QueueScaleRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "auth", q.Auth) populate(objectMap, "queueLength", q.QueueLength) populate(objectMap, "queueName", q.QueueName) @@ -4829,7 +5699,7 @@ func (q *QueueScaleRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RegistryCredentials. func (r RegistryCredentials) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "identity", r.Identity) populate(objectMap, "passwordSecretRef", r.PasswordSecretRef) populate(objectMap, "server", r.Server) @@ -4868,7 +5738,7 @@ func (r *RegistryCredentials) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RegistryInfo. func (r RegistryInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "registryPassword", r.RegistryPassword) populate(objectMap, "registryUrl", r.RegistryURL) populate(objectMap, "registryUserName", r.RegistryUserName) @@ -4903,7 +5773,7 @@ func (r *RegistryInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Replica. func (r Replica) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "properties", r.Properties) @@ -4946,7 +5816,7 @@ func (r *Replica) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ReplicaCollection. func (r ReplicaCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } @@ -4973,7 +5843,7 @@ func (r *ReplicaCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ReplicaContainer. func (r ReplicaContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "containerId", r.ContainerID) populate(objectMap, "execEndpoint", r.ExecEndpoint) populate(objectMap, "logStreamEndpoint", r.LogStreamEndpoint) @@ -5024,7 +5894,7 @@ func (r *ReplicaContainer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ReplicaProperties. func (r ReplicaProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "containers", r.Containers) populateTimeRFC3339(objectMap, "createdTime", r.CreatedTime) return json.Marshal(objectMap) @@ -5055,7 +5925,7 @@ func (r *ReplicaProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "systemData", r.SystemData) @@ -5094,7 +5964,7 @@ func (r *Resource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Revision. func (r Revision) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "properties", r.Properties) @@ -5137,7 +6007,7 @@ func (r *Revision) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RevisionCollection. func (r RevisionCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", r.NextLink) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) @@ -5168,7 +6038,7 @@ func (r *RevisionCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RevisionProperties. func (r RevisionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "active", r.Active) populateTimeRFC3339(objectMap, "createdTime", r.CreatedTime) populate(objectMap, "fqdn", r.Fqdn) @@ -5231,7 +6101,7 @@ func (r *RevisionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Scale. func (s Scale) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "maxReplicas", s.MaxReplicas) populate(objectMap, "minReplicas", s.MinReplicas) populate(objectMap, "rules", s.Rules) @@ -5266,7 +6136,7 @@ func (s *Scale) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScaleRule. func (s ScaleRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "azureQueue", s.AzureQueue) populate(objectMap, "custom", s.Custom) populate(objectMap, "http", s.HTTP) @@ -5309,7 +6179,7 @@ func (s *ScaleRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScaleRuleAuth. func (s ScaleRuleAuth) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "secretRef", s.SecretRef) populate(objectMap, "triggerParameter", s.TriggerParameter) return json.Marshal(objectMap) @@ -5340,7 +6210,9 @@ func (s *ScaleRuleAuth) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Secret. func (s Secret) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "keyVaultUrl", s.KeyVaultURL) populate(objectMap, "name", s.Name) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -5355,6 +6227,12 @@ func (s *Secret) 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 "keyVaultUrl": + err = unpopulate(val, "KeyVaultURL", &s.KeyVaultURL) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) @@ -5369,9 +6247,40 @@ func (s *Secret) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SecretVolumeItem. +func (s SecretVolumeItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "path", s.Path) + populate(objectMap, "secretRef", s.SecretRef) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretVolumeItem. +func (s *SecretVolumeItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "path": + err = unpopulate(val, "Path", &s.Path) + delete(rawMsg, key) + case "secretRef": + err = unpopulate(val, "SecretRef", &s.SecretRef) + 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 SecretsCollection. func (s SecretsCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -5398,7 +6307,7 @@ func (s *SecretsCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SourceControl. func (s SourceControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -5441,7 +6350,7 @@ func (s *SourceControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SourceControlCollection. func (s SourceControlCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -5472,7 +6381,7 @@ func (s *SourceControlCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SourceControlProperties. func (s SourceControlProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "branch", s.Branch) populate(objectMap, "githubActionConfiguration", s.GithubActionConfiguration) populate(objectMap, "operationState", s.OperationState) @@ -5511,7 +6420,7 @@ func (s *SourceControlProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -5558,7 +6467,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TCPScaleRule. func (t TCPScaleRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "auth", t.Auth) populate(objectMap, "metadata", t.Metadata) return json.Marshal(objectMap) @@ -5589,7 +6498,7 @@ func (t *TCPScaleRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Template. func (t Template) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "containers", t.Containers) populate(objectMap, "initContainers", t.InitContainers) populate(objectMap, "revisionSuffix", t.RevisionSuffix) @@ -5632,7 +6541,7 @@ func (t *Template) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) @@ -5679,7 +6588,7 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrafficWeight. func (t TrafficWeight) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "label", t.Label) populate(objectMap, "latestRevision", t.LatestRevision) populate(objectMap, "revisionName", t.RevisionName) @@ -5718,7 +6627,7 @@ func (t *TrafficWeight) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Twitter. func (t Twitter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", t.Enabled) populate(objectMap, "registration", t.Registration) return json.Marshal(objectMap) @@ -5749,7 +6658,7 @@ func (t *Twitter) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TwitterRegistration. func (t TwitterRegistration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "consumerKey", t.ConsumerKey) populate(objectMap, "consumerSecretSettingName", t.ConsumerSecretSettingName) return json.Marshal(objectMap) @@ -5780,7 +6689,7 @@ func (t *TwitterRegistration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "clientId", u.ClientID) populate(objectMap, "principalId", u.PrincipalID) return json.Marshal(objectMap) @@ -5811,14 +6720,12 @@ func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VnetConfiguration. func (v VnetConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dockerBridgeCidr", v.DockerBridgeCidr) populate(objectMap, "infrastructureSubnetId", v.InfrastructureSubnetID) populate(objectMap, "internal", v.Internal) - populate(objectMap, "outboundSettings", v.OutboundSettings) populate(objectMap, "platformReservedCidr", v.PlatformReservedCidr) populate(objectMap, "platformReservedDnsIP", v.PlatformReservedDNSIP) - populate(objectMap, "runtimeSubnetId", v.RuntimeSubnetID) return json.Marshal(objectMap) } @@ -5840,18 +6747,12 @@ func (v *VnetConfiguration) UnmarshalJSON(data []byte) error { case "internal": err = unpopulate(val, "Internal", &v.Internal) delete(rawMsg, key) - case "outboundSettings": - err = unpopulate(val, "OutboundSettings", &v.OutboundSettings) - delete(rawMsg, key) case "platformReservedCidr": err = unpopulate(val, "PlatformReservedCidr", &v.PlatformReservedCidr) delete(rawMsg, key) case "platformReservedDnsIP": err = unpopulate(val, "PlatformReservedDNSIP", &v.PlatformReservedDNSIP) delete(rawMsg, key) - case "runtimeSubnetId": - err = unpopulate(val, "RuntimeSubnetID", &v.RuntimeSubnetID) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -5862,8 +6763,9 @@ func (v *VnetConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Volume. func (v Volume) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", v.Name) + populate(objectMap, "secrets", v.Secrets) populate(objectMap, "storageName", v.StorageName) populate(objectMap, "storageType", v.StorageType) return json.Marshal(objectMap) @@ -5881,6 +6783,9 @@ func (v *Volume) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &v.Name) delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &v.Secrets) + delete(rawMsg, key) case "storageName": err = unpopulate(val, "StorageName", &v.StorageName) delete(rawMsg, key) @@ -5897,7 +6802,7 @@ func (v *Volume) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumeMount. func (v VolumeMount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "mountPath", v.MountPath) populate(objectMap, "volumeName", v.VolumeName) return json.Marshal(objectMap) @@ -5928,7 +6833,7 @@ func (v *VolumeMount) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WorkloadProfile. func (w WorkloadProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "maximumCount", w.MaximumCount) populate(objectMap, "minimumCount", w.MinimumCount) populate(objectMap, "workloadProfileType", w.WorkloadProfileType) @@ -5963,7 +6868,7 @@ func (w *WorkloadProfile) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WorkloadProfileStates. func (w WorkloadProfileStates) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) @@ -6006,7 +6911,7 @@ func (w *WorkloadProfileStates) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WorkloadProfileStatesCollection. func (w WorkloadProfileStatesCollection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", w.NextLink) populate(objectMap, "value", w.Value) return json.Marshal(objectMap) @@ -6037,7 +6942,7 @@ func (w *WorkloadProfileStatesCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WorkloadProfileStatesProperties. func (w WorkloadProfileStatesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "currentCount", w.CurrentCount) populate(objectMap, "maximumCount", w.MaximumCount) populate(objectMap, "minimumCount", w.MinimumCount) @@ -6070,7 +6975,7 @@ func (w *WorkloadProfileStatesProperties) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -6080,7 +6985,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { +func populateByteArray(m map[string]any, k string, b []byte, f runtime.Base64Encoding) { if azcore.IsNullValue(b) { m[k] = nil } else if len(b) == 0 { @@ -6090,7 +6995,7 @@ func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.B } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go index b14a8d704fe9..b849d5c62b0e 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client.go @@ -32,9 +32,9 @@ type NamespacesClient struct { } // NewNamespacesClient creates a new instance of NamespacesClient with the specified values. -// 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ 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 2022-06-01-preview -// resourceGroupName - The name of the resource group. The name is case insensitive. -// environmentName - Name of the Managed Environment. -// checkNameAvailabilityRequest - The check name availability request. -// options - NamespacesClientCheckNameAvailabilityOptions contains the optional parameters for the NamespacesClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - environmentName - Name of the Managed Environment. +// - checkNameAvailabilityRequest - The check name availability request. +// - options - NamespacesClientCheckNameAvailabilityOptions contains the optional parameters for the NamespacesClient.CheckNameAvailability +// method. func (client *NamespacesClient) CheckNameAvailability(ctx context.Context, resourceGroupName string, environmentName string, checkNameAvailabilityRequest CheckNameAvailabilityRequest, options *NamespacesClientCheckNameAvailabilityOptions) (NamespacesClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, resourceGroupName, environmentName, checkNameAvailabilityRequest, options) if err != nil { @@ -98,7 +99,7 @@ func (client *NamespacesClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, checkNameAvailabilityRequest) 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 f147cbfb8cf2..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/namespaces_client_example_test.go +++ /dev/null @@ -1,62 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewNamespacesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewNamespacesClient("34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/operations_client.go b/sdk/resourcemanager/appcontainers/armappcontainers/operations_client.go index ff1968782fe9..2a97c551ddb2 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/operations_client.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/operations_client.go @@ -28,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -50,8 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available RP operations. -// Generated from API version 2022-06-01-preview -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2022-11-01-preview +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -88,7 +89,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-06-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/operations_client_example_test.go b/sdk/resourcemanager/appcontainers/armappcontainers/operations_client_example_test.go deleted file mode 100644 index f8aeee11e073..000000000000 --- a/sdk/resourcemanager/appcontainers/armappcontainers/operations_client_example_test.go +++ /dev/null @@ -1,41 +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. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/app/resource-manager/Microsoft.App/preview/2022-06-01-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() - client, err := armappcontainers.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/response_types.go b/sdk/resourcemanager/appcontainers/armappcontainers/response_types.go index f21fd2d51b84..629bb7693bde 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/response_types.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/response_types.go @@ -9,7 +9,7 @@ package armappcontainers -// AvailableWorkloadProfilesClientGetResponse contains the response from method AvailableWorkloadProfilesClient.Get. +// AvailableWorkloadProfilesClientGetResponse contains the response from method AvailableWorkloadProfilesClient.NewGetPager. type AvailableWorkloadProfilesClientGetResponse struct { AvailableWorkloadProfilesCollection } @@ -34,7 +34,7 @@ type CertificatesClientGetResponse struct { Certificate } -// CertificatesClientListResponse contains the response from method CertificatesClient.List. +// CertificatesClientListResponse contains the response from method CertificatesClient.NewListPager. type CertificatesClientListResponse struct { CertificateCollection } @@ -59,7 +59,7 @@ type ConnectedEnvironmentsCertificatesClientGetResponse struct { Certificate } -// ConnectedEnvironmentsCertificatesClientListResponse contains the response from method ConnectedEnvironmentsCertificatesClient.List. +// ConnectedEnvironmentsCertificatesClientListResponse contains the response from method ConnectedEnvironmentsCertificatesClient.NewListPager. type ConnectedEnvironmentsCertificatesClientListResponse struct { CertificateCollection } @@ -74,12 +74,12 @@ type ConnectedEnvironmentsClientCheckNameAvailabilityResponse struct { CheckNameAvailabilityResponse } -// ConnectedEnvironmentsClientCreateOrUpdateResponse contains the response from method ConnectedEnvironmentsClient.CreateOrUpdate. +// ConnectedEnvironmentsClientCreateOrUpdateResponse contains the response from method ConnectedEnvironmentsClient.BeginCreateOrUpdate. type ConnectedEnvironmentsClientCreateOrUpdateResponse struct { ConnectedEnvironment } -// ConnectedEnvironmentsClientDeleteResponse contains the response from method ConnectedEnvironmentsClient.Delete. +// ConnectedEnvironmentsClientDeleteResponse contains the response from method ConnectedEnvironmentsClient.BeginDelete. type ConnectedEnvironmentsClientDeleteResponse struct { // placeholder for future response values } @@ -89,12 +89,12 @@ type ConnectedEnvironmentsClientGetResponse struct { ConnectedEnvironment } -// ConnectedEnvironmentsClientListByResourceGroupResponse contains the response from method ConnectedEnvironmentsClient.ListByResourceGroup. +// ConnectedEnvironmentsClientListByResourceGroupResponse contains the response from method ConnectedEnvironmentsClient.NewListByResourceGroupPager. type ConnectedEnvironmentsClientListByResourceGroupResponse struct { ConnectedEnvironmentCollection } -// ConnectedEnvironmentsClientListBySubscriptionResponse contains the response from method ConnectedEnvironmentsClient.ListBySubscription. +// ConnectedEnvironmentsClientListBySubscriptionResponse contains the response from method ConnectedEnvironmentsClient.NewListBySubscriptionPager. type ConnectedEnvironmentsClientListBySubscriptionResponse struct { ConnectedEnvironmentCollection } @@ -119,7 +119,7 @@ type ConnectedEnvironmentsDaprComponentsClientGetResponse struct { DaprComponent } -// ConnectedEnvironmentsDaprComponentsClientListResponse contains the response from method ConnectedEnvironmentsDaprComponentsClient.List. +// ConnectedEnvironmentsDaprComponentsClientListResponse contains the response from method ConnectedEnvironmentsDaprComponentsClient.NewListPager. type ConnectedEnvironmentsDaprComponentsClientListResponse struct { DaprComponentsCollection } @@ -164,17 +164,17 @@ type ContainerAppsAuthConfigsClientGetResponse struct { AuthConfig } -// ContainerAppsAuthConfigsClientListByContainerAppResponse contains the response from method ContainerAppsAuthConfigsClient.ListByContainerApp. +// ContainerAppsAuthConfigsClientListByContainerAppResponse contains the response from method ContainerAppsAuthConfigsClient.NewListByContainerAppPager. type ContainerAppsAuthConfigsClientListByContainerAppResponse struct { AuthConfigCollection } -// ContainerAppsClientCreateOrUpdateResponse contains the response from method ContainerAppsClient.CreateOrUpdate. +// ContainerAppsClientCreateOrUpdateResponse contains the response from method ContainerAppsClient.BeginCreateOrUpdate. type ContainerAppsClientCreateOrUpdateResponse struct { ContainerApp } -// ContainerAppsClientDeleteResponse contains the response from method ContainerAppsClient.Delete. +// ContainerAppsClientDeleteResponse contains the response from method ContainerAppsClient.BeginDelete. type ContainerAppsClientDeleteResponse struct { // placeholder for future response values } @@ -189,12 +189,12 @@ type ContainerAppsClientGetResponse struct { ContainerApp } -// ContainerAppsClientListByResourceGroupResponse contains the response from method ContainerAppsClient.ListByResourceGroup. +// ContainerAppsClientListByResourceGroupResponse contains the response from method ContainerAppsClient.NewListByResourceGroupPager. type ContainerAppsClientListByResourceGroupResponse struct { ContainerAppCollection } -// ContainerAppsClientListBySubscriptionResponse contains the response from method ContainerAppsClient.ListBySubscription. +// ContainerAppsClientListBySubscriptionResponse contains the response from method ContainerAppsClient.NewListBySubscriptionPager. type ContainerAppsClientListBySubscriptionResponse struct { ContainerAppCollection } @@ -209,9 +209,9 @@ type ContainerAppsClientListSecretsResponse struct { SecretsCollection } -// ContainerAppsClientUpdateResponse contains the response from method ContainerAppsClient.Update. +// ContainerAppsClientUpdateResponse contains the response from method ContainerAppsClient.BeginUpdate. type ContainerAppsClientUpdateResponse struct { - // placeholder for future response values + ContainerApp } // ContainerAppsDiagnosticsClientGetDetectorResponse contains the response from method ContainerAppsDiagnosticsClient.GetDetector. @@ -229,12 +229,12 @@ type ContainerAppsDiagnosticsClientGetRootResponse struct { ContainerApp } -// ContainerAppsDiagnosticsClientListDetectorsResponse contains the response from method ContainerAppsDiagnosticsClient.ListDetectors. +// ContainerAppsDiagnosticsClientListDetectorsResponse contains the response from method ContainerAppsDiagnosticsClient.NewListDetectorsPager. type ContainerAppsDiagnosticsClientListDetectorsResponse struct { DiagnosticsCollection } -// ContainerAppsDiagnosticsClientListRevisionsResponse contains the response from method ContainerAppsDiagnosticsClient.ListRevisions. +// ContainerAppsDiagnosticsClientListRevisionsResponse contains the response from method ContainerAppsDiagnosticsClient.NewListRevisionsPager. type ContainerAppsDiagnosticsClientListRevisionsResponse struct { RevisionCollection } @@ -264,7 +264,7 @@ type ContainerAppsRevisionsClientGetRevisionResponse struct { Revision } -// ContainerAppsRevisionsClientListRevisionsResponse contains the response from method ContainerAppsRevisionsClient.ListRevisions. +// ContainerAppsRevisionsClientListRevisionsResponse contains the response from method ContainerAppsRevisionsClient.NewListRevisionsPager. type ContainerAppsRevisionsClientListRevisionsResponse struct { RevisionCollection } @@ -274,12 +274,12 @@ type ContainerAppsRevisionsClientRestartRevisionResponse struct { // placeholder for future response values } -// ContainerAppsSourceControlsClientCreateOrUpdateResponse contains the response from method ContainerAppsSourceControlsClient.CreateOrUpdate. +// ContainerAppsSourceControlsClientCreateOrUpdateResponse contains the response from method ContainerAppsSourceControlsClient.BeginCreateOrUpdate. type ContainerAppsSourceControlsClientCreateOrUpdateResponse struct { SourceControl } -// ContainerAppsSourceControlsClientDeleteResponse contains the response from method ContainerAppsSourceControlsClient.Delete. +// ContainerAppsSourceControlsClientDeleteResponse contains the response from method ContainerAppsSourceControlsClient.BeginDelete. type ContainerAppsSourceControlsClientDeleteResponse struct { // placeholder for future response values } @@ -289,7 +289,7 @@ type ContainerAppsSourceControlsClientGetResponse struct { SourceControl } -// ContainerAppsSourceControlsClientListByContainerAppResponse contains the response from method ContainerAppsSourceControlsClient.ListByContainerApp. +// ContainerAppsSourceControlsClientListByContainerAppResponse contains the response from method ContainerAppsSourceControlsClient.NewListByContainerAppPager. type ContainerAppsSourceControlsClientListByContainerAppResponse struct { SourceControlCollection } @@ -309,7 +309,7 @@ type DaprComponentsClientGetResponse struct { DaprComponent } -// DaprComponentsClientListResponse contains the response from method DaprComponentsClient.List. +// DaprComponentsClientListResponse contains the response from method DaprComponentsClient.NewListPager. type DaprComponentsClientListResponse struct { DaprComponentsCollection } @@ -319,6 +319,86 @@ type DaprComponentsClientListSecretsResponse struct { DaprSecretsCollection } +// JobClientCreateOrUpdateResponse contains the response from method JobClient.BeginCreateOrUpdate. +type JobClientCreateOrUpdateResponse struct { + Job +} + +// JobClientDeleteResponse contains the response from method JobClient.BeginDelete. +type JobClientDeleteResponse struct { + // placeholder for future response values +} + +// JobClientExecutionsResponse contains the response from method JobClient.BeginExecutions. +type JobClientExecutionsResponse struct { + ContainerAppJobExecutions +} + +// JobClientGetResponse contains the response from method JobClient.Get. +type JobClientGetResponse struct { + Job +} + +// JobClientRunResponse contains the response from method JobClient.BeginRun. +type JobClientRunResponse struct { + JobExecutionBase +} + +// JobClientUpdateResponse contains the response from method JobClient.BeginUpdate. +type JobClientUpdateResponse struct { + Job +} + +// JobsClientListByResourceGroupResponse contains the response from method JobsClient.NewListByResourceGroupPager. +type JobsClientListByResourceGroupResponse struct { + JobsCollection +} + +// JobsClientListBySubscriptionResponse contains the response from method JobsClient.NewListBySubscriptionPager. +type JobsClientListBySubscriptionResponse struct { + JobsCollection +} + +// JobsClientListSecretsResponse contains the response from method JobsClient.ListSecrets. +type JobsClientListSecretsResponse struct { + JobSecretsCollection +} + +// JobsClientStopExecutionResponse contains the response from method JobsClient.BeginStopExecution. +type JobsClientStopExecutionResponse struct { + // placeholder for future response values +} + +// JobsClientStopMultipleExecutionsResponse contains the response from method JobsClient.BeginStopMultipleExecutions. +type JobsClientStopMultipleExecutionsResponse struct { + ContainerAppJobExecutions +} + +// ManagedCertificatesClientCreateOrUpdateResponse contains the response from method ManagedCertificatesClient.BeginCreateOrUpdate. +type ManagedCertificatesClientCreateOrUpdateResponse struct { + ManagedCertificate +} + +// ManagedCertificatesClientDeleteResponse contains the response from method ManagedCertificatesClient.Delete. +type ManagedCertificatesClientDeleteResponse struct { + // placeholder for future response values +} + +// ManagedCertificatesClientGetResponse contains the response from method ManagedCertificatesClient.Get. +type ManagedCertificatesClientGetResponse struct { + ManagedCertificate +} + +// ManagedCertificatesClientListResponse contains the response from method ManagedCertificatesClient.NewListPager. +type ManagedCertificatesClientListResponse struct { + ManagedCertificateCollection +} + +// ManagedCertificatesClientUpdateResponse contains the response from method ManagedCertificatesClient.Update. +type ManagedCertificatesClientUpdateResponse struct { + ManagedCertificate +} + // ManagedEnvironmentDiagnosticsClientGetDetectorResponse contains the response from method ManagedEnvironmentDiagnosticsClient.GetDetector. type ManagedEnvironmentDiagnosticsClientGetDetectorResponse struct { Diagnostics @@ -329,12 +409,12 @@ type ManagedEnvironmentDiagnosticsClientListDetectorsResponse struct { DiagnosticsCollection } -// ManagedEnvironmentsClientCreateOrUpdateResponse contains the response from method ManagedEnvironmentsClient.CreateOrUpdate. +// ManagedEnvironmentsClientCreateOrUpdateResponse contains the response from method ManagedEnvironmentsClient.BeginCreateOrUpdate. type ManagedEnvironmentsClientCreateOrUpdateResponse struct { ManagedEnvironment } -// ManagedEnvironmentsClientDeleteResponse contains the response from method ManagedEnvironmentsClient.Delete. +// ManagedEnvironmentsClientDeleteResponse contains the response from method ManagedEnvironmentsClient.BeginDelete. type ManagedEnvironmentsClientDeleteResponse struct { // placeholder for future response values } @@ -349,24 +429,24 @@ type ManagedEnvironmentsClientGetResponse struct { ManagedEnvironment } -// ManagedEnvironmentsClientListByResourceGroupResponse contains the response from method ManagedEnvironmentsClient.ListByResourceGroup. +// ManagedEnvironmentsClientListByResourceGroupResponse contains the response from method ManagedEnvironmentsClient.NewListByResourceGroupPager. type ManagedEnvironmentsClientListByResourceGroupResponse struct { ManagedEnvironmentsCollection } -// ManagedEnvironmentsClientListBySubscriptionResponse contains the response from method ManagedEnvironmentsClient.ListBySubscription. +// ManagedEnvironmentsClientListBySubscriptionResponse contains the response from method ManagedEnvironmentsClient.NewListBySubscriptionPager. type ManagedEnvironmentsClientListBySubscriptionResponse struct { ManagedEnvironmentsCollection } -// ManagedEnvironmentsClientListWorkloadProfileStatesResponse contains the response from method ManagedEnvironmentsClient.ListWorkloadProfileStates. +// ManagedEnvironmentsClientListWorkloadProfileStatesResponse contains the response from method ManagedEnvironmentsClient.NewListWorkloadProfileStatesPager. type ManagedEnvironmentsClientListWorkloadProfileStatesResponse struct { WorkloadProfileStatesCollection } -// ManagedEnvironmentsClientUpdateResponse contains the response from method ManagedEnvironmentsClient.Update. +// ManagedEnvironmentsClientUpdateResponse contains the response from method ManagedEnvironmentsClient.BeginUpdate. type ManagedEnvironmentsClientUpdateResponse struct { - // placeholder for future response values + ManagedEnvironment } // ManagedEnvironmentsDiagnosticsClientGetRootResponse contains the response from method ManagedEnvironmentsDiagnosticsClient.GetRoot. @@ -399,7 +479,7 @@ type NamespacesClientCheckNameAvailabilityResponse struct { CheckNameAvailabilityResponse } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { AvailableOperations } diff --git a/sdk/resourcemanager/appcontainers/armappcontainers/time_rfc3339.go b/sdk/resourcemanager/appcontainers/armappcontainers/time_rfc3339.go index b8bb8b91479c..2073cd115114 100644 --- a/sdk/resourcemanager/appcontainers/armappcontainers/time_rfc3339.go +++ b/sdk/resourcemanager/appcontainers/armappcontainers/time_rfc3339.go @@ -62,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) {