diff --git a/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md b/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md index 79bfba8a6bbe..21c50ea400ef 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md +++ b/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md @@ -1,5 +1,78 @@ # Release History +## 2.0.0-beta.2 (2023-05-22) +### Features Added + +- New enum type `ApmProvisioningState` with values `ApmProvisioningStateCanceled`, `ApmProvisioningStateCreating`, `ApmProvisioningStateDeleting`, `ApmProvisioningStateFailed`, `ApmProvisioningStateSucceeded`, `ApmProvisioningStateUpdating` +- New enum type `ConfigServerEnabledState` with values `ConfigServerEnabledStateDisabled`, `ConfigServerEnabledStateEnabled` +- New enum type `ConfigurationServiceGeneration` with values `ConfigurationServiceGenerationGen1`, `ConfigurationServiceGenerationGen2` +- New enum type `ContainerRegistryProvisioningState` with values `ContainerRegistryProvisioningStateCanceled`, `ContainerRegistryProvisioningStateCreating`, `ContainerRegistryProvisioningStateDeleting`, `ContainerRegistryProvisioningStateFailed`, `ContainerRegistryProvisioningStateSucceeded`, `ContainerRegistryProvisioningStateUpdating` +- New enum type `EurekaServerEnabledState` with values `EurekaServerEnabledStateDisabled`, `EurekaServerEnabledStateEnabled` +- New enum type `EurekaServerState` with values `EurekaServerStateCanceled`, `EurekaServerStateFailed`, `EurekaServerStateSucceeded`, `EurekaServerStateUpdating` +- New enum type `GatewayCertificateVerification` with values `GatewayCertificateVerificationDisabled`, `GatewayCertificateVerificationEnabled` +- New enum type `GitImplementation` with values `GitImplementationGoGit`, `GitImplementationLibgit2` +- New function `NewApmsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ApmsClient, error)` +- New function `*ApmsClient.BeginCreateOrUpdate(context.Context, string, string, string, ApmResource, *ApmsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ApmsClientCreateOrUpdateResponse], error)` +- New function `*ApmsClient.BeginDelete(context.Context, string, string, string, *ApmsClientBeginDeleteOptions) (*runtime.Poller[ApmsClientDeleteResponse], error)` +- New function `*ApmsClient.Get(context.Context, string, string, string, *ApmsClientGetOptions) (ApmsClientGetResponse, error)` +- New function `*ApmsClient.NewListPager(string, string, *ApmsClientListOptions) *runtime.Pager[ApmsClientListResponse]` +- New function `*ApmsClient.ListSecretKeys(context.Context, string, string, string, *ApmsClientListSecretKeysOptions) (ApmsClientListSecretKeysResponse, error)` +- New function `*BuildServiceClient.BeginCreateOrUpdate(context.Context, string, string, string, BuildService, *BuildServiceClientBeginCreateOrUpdateOptions) (*runtime.Poller[BuildServiceClientCreateOrUpdateResponse], error)` +- New function `*BuildServiceClient.BeginDeleteBuild(context.Context, string, string, string, string, *BuildServiceClientBeginDeleteBuildOptions) (*runtime.Poller[BuildServiceClientDeleteBuildResponse], error)` +- New function `*ClientFactory.NewApmsClient() *ApmsClient` +- New function `*ClientFactory.NewContainerRegistriesClient() *ContainerRegistriesClient` +- New function `*ClientFactory.NewEurekaServersClient() *EurekaServersClient` +- New function `NewContainerRegistriesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ContainerRegistriesClient, error)` +- New function `*ContainerRegistriesClient.BeginCreateOrUpdate(context.Context, string, string, string, ContainerRegistryResource, *ContainerRegistriesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ContainerRegistriesClientCreateOrUpdateResponse], error)` +- New function `*ContainerRegistriesClient.BeginDelete(context.Context, string, string, string, *ContainerRegistriesClientBeginDeleteOptions) (*runtime.Poller[ContainerRegistriesClientDeleteResponse], error)` +- New function `*ContainerRegistriesClient.Get(context.Context, string, string, string, *ContainerRegistriesClientGetOptions) (ContainerRegistriesClientGetResponse, error)` +- New function `*ContainerRegistriesClient.NewListPager(string, string, *ContainerRegistriesClientListOptions) *runtime.Pager[ContainerRegistriesClientListResponse]` +- New function `*ContainerRegistriesClient.BeginValidate(context.Context, string, string, string, ContainerRegistryProperties, *ContainerRegistriesClientBeginValidateOptions) (*runtime.Poller[ContainerRegistriesClientValidateResponse], error)` +- New function `*ContainerRegistryBasicCredentials.GetContainerRegistryCredentials() *ContainerRegistryCredentials` +- New function `*ContainerRegistryCredentials.GetContainerRegistryCredentials() *ContainerRegistryCredentials` +- New function `NewEurekaServersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*EurekaServersClient, error)` +- New function `*EurekaServersClient.Get(context.Context, string, string, *EurekaServersClientGetOptions) (EurekaServersClientGetResponse, error)` +- New function `*EurekaServersClient.List(context.Context, string, string, *EurekaServersClientListOptions) (EurekaServersClientListResponse, error)` +- New function `*EurekaServersClient.BeginUpdatePatch(context.Context, string, string, EurekaServerResource, *EurekaServersClientBeginUpdatePatchOptions) (*runtime.Poller[EurekaServersClientUpdatePatchResponse], error)` +- New function `*EurekaServersClient.BeginUpdatePut(context.Context, string, string, EurekaServerResource, *EurekaServersClientBeginUpdatePutOptions) (*runtime.Poller[EurekaServersClientUpdatePutResponse], error)` +- New function `*GatewaysClient.BeginRestart(context.Context, string, string, string, *GatewaysClientBeginRestartOptions) (*runtime.Poller[GatewaysClientRestartResponse], error)` +- New function `*ServicesClient.BeginDisableApmGlobally(context.Context, string, string, ApmReference, *ServicesClientBeginDisableApmGloballyOptions) (*runtime.Poller[ServicesClientDisableApmGloballyResponse], error)` +- New function `*ServicesClient.BeginEnableApmGlobally(context.Context, string, string, ApmReference, *ServicesClientBeginEnableApmGloballyOptions) (*runtime.Poller[ServicesClientEnableApmGloballyResponse], error)` +- New function `*ServicesClient.ListGloballyEnabledApms(context.Context, string, string, *ServicesClientListGloballyEnabledApmsOptions) (ServicesClientListGloballyEnabledApmsResponse, error)` +- New function `*ServicesClient.NewListSupportedApmTypesPager(string, string, *ServicesClientListSupportedApmTypesOptions) *runtime.Pager[ServicesClientListSupportedApmTypesResponse]` +- New struct `ApmProperties` +- New struct `ApmReference` +- New struct `ApmResource` +- New struct `ApmResourceCollection` +- New struct `ApmSecretKeys` +- New struct `CertificateReference` +- New struct `ContainerRegistryBasicCredentials` +- New struct `ContainerRegistryProperties` +- New struct `ContainerRegistryResource` +- New struct `ContainerRegistryResourceCollection` +- New struct `ContainerRegistryValidateResult` +- New struct `EurekaServerProperties` +- New struct `EurekaServerResource` +- New struct `EurekaServerResourceCollection` +- New struct `GatewayPropertiesClientAuth` +- New struct `GloballyEnabledApms` +- New struct `SupportedApmType` +- New struct `SupportedApmTypes` +- New field `CaCertResourceID` in struct `AcceleratorBasicAuthSetting` +- New field `CaCertResourceID` in struct `AcceleratorPublicSetting` +- New field `WorkloadProfileName` in struct `AppResourceProperties` +- New field `Apms`, `Certificates` in struct `BuildProperties` +- New field `Image` in struct `BuildResultProperties` +- New field `ContainerRegistry` in struct `BuildServiceProperties` +- New field `EnabledState` in struct `ConfigServerProperties` +- New field `CaCertResourceID`, `GitImplementation` in struct `ConfigurationServiceGitRepository` +- New field `Generation` in struct `ConfigurationServiceProperties` +- New field `Apms` in struct `DeploymentSettings` +- New field `AllowedOriginPatterns` in struct `GatewayCorsProperties` +- New field `AddonConfigs`, `ClientAuth` in struct `GatewayProperties` +- New field `DataPlanePublicEndpoint` in struct `ServiceVNetAddons` + + ## 2.0.0-beta.1 (2023-04-28) ### Breaking Changes diff --git a/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go index f388be7baed0..76b762e8cd8f 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go @@ -48,7 +48,7 @@ func NewAPIPortalCustomDomainsClient(subscriptionID string, credential azcore.To // BeginCreateOrUpdate - Create or update the API portal custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -72,7 +72,7 @@ func (client *APIPortalCustomDomainsClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Create or update the API portal custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *APIPortalCustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, apiPortalCustomDomainResource APIPortalCustomDomainResource, options *APIPortalCustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource, options) if err != nil { @@ -116,7 +116,7 @@ func (client *APIPortalCustomDomainsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, apiPortalCustomDomainResource) @@ -125,7 +125,7 @@ func (client *APIPortalCustomDomainsClient) createOrUpdateCreateRequest(ctx cont // BeginDelete - Delete the API portal custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -148,7 +148,7 @@ func (client *APIPortalCustomDomainsClient) BeginDelete(ctx context.Context, res // Delete - Delete the API portal custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *APIPortalCustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, domainName, options) if err != nil { @@ -192,7 +192,7 @@ func (client *APIPortalCustomDomainsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *APIPortalCustomDomainsClient) deleteCreateRequest(ctx context.Cont // Get - Get the API portal custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -252,7 +252,7 @@ func (client *APIPortalCustomDomainsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *APIPortalCustomDomainsClient) getHandleResponse(resp *http.Respons // NewListPager - Handle requests to list all API portal custom domains. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -328,7 +328,7 @@ func (client *APIPortalCustomDomainsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client_example_test.go deleted file mode 100644 index 3f2af14c1cb7..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client_example_test.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApiPortalCustomDomains_Get.json -func ExampleAPIPortalCustomDomainsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIPortalCustomDomainsClient().Get(ctx, "myResourceGroup", "myservice", "default", "myDomainName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.APIPortalCustomDomainResource = armappplatform.APIPortalCustomDomainResource{ - // Name: to.Ptr("myDomainName"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apiPortals/domains"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apiPortals/default/domains/myDomainName"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.APIPortalCustomDomainProperties{ - // Thumbprint: to.Ptr("*"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApiPortalCustomDomains_CreateOrUpdate.json -func ExampleAPIPortalCustomDomainsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAPIPortalCustomDomainsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", "myDomainName", armappplatform.APIPortalCustomDomainResource{ - Properties: &armappplatform.APIPortalCustomDomainProperties{ - Thumbprint: to.Ptr("*"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.APIPortalCustomDomainResource = armappplatform.APIPortalCustomDomainResource{ - // Name: to.Ptr("myDomainName"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apiPortals/domains"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apiPortals/default/domains/myDomainName"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.APIPortalCustomDomainProperties{ - // Thumbprint: to.Ptr("*"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApiPortalCustomDomains_Delete.json -func ExampleAPIPortalCustomDomainsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAPIPortalCustomDomainsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", "myDomainName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApiPortalCustomDomains_List.json -func ExampleAPIPortalCustomDomainsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAPIPortalCustomDomainsClient().NewListPager("myResourceGroup", "myservice", "default", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.APIPortalCustomDomainResourceCollection = armappplatform.APIPortalCustomDomainResourceCollection{ - // Value: []*armappplatform.APIPortalCustomDomainResource{ - // { - // Name: to.Ptr("myDomain"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apiPortals/domains"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apiPortals/default/domains/myDomain"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.APIPortalCustomDomainProperties{ - // Thumbprint: to.Ptr("*"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/apiportals_client.go b/sdk/resourcemanager/appplatform/armappplatform/apiportals_client.go index c2d241cbf658..b89317dfbe7e 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/apiportals_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/apiportals_client.go @@ -48,7 +48,7 @@ func NewAPIPortalsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Create the default API portal or update the existing API portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -71,7 +71,7 @@ func (client *APIPortalsClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Create the default API portal or update the existing API portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *APIPortalsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, apiPortalResource APIPortalResource, options *APIPortalsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, apiPortalResource, options) if err != nil { @@ -111,7 +111,7 @@ func (client *APIPortalsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, apiPortalResource) @@ -120,7 +120,7 @@ func (client *APIPortalsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Delete the default API portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -141,7 +141,7 @@ func (client *APIPortalsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete the default API portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *APIPortalsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, options) if err != nil { @@ -181,7 +181,7 @@ func (client *APIPortalsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *APIPortalsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get the API portal and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -235,7 +235,7 @@ func (client *APIPortalsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +252,7 @@ func (client *APIPortalsClient) getHandleResponse(resp *http.Response) (APIPorta // NewListPager - Handles requests to list all resources in a Service. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -305,7 +305,7 @@ func (client *APIPortalsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +323,7 @@ func (client *APIPortalsClient) listHandleResponse(resp *http.Response) (APIPort // ValidateDomain - Check the domains are valid as well as not in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -370,7 +370,7 @@ func (client *APIPortalsClient) validateDomainCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, validatePayload) diff --git a/sdk/resourcemanager/appplatform/armappplatform/apiportals_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/apiportals_client_example_test.go deleted file mode 100644 index 4b74776bc59f..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/apiportals_client_example_test.go +++ /dev/null @@ -1,263 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApiPortals_Get.json -func ExampleAPIPortalsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIPortalsClient().Get(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.APIPortalResource = armappplatform.APIPortalResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apiPortals"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apiPortals/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.APIPortalProperties{ - // GatewayIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default")}, - // Instances: []*armappplatform.APIPortalInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.APIPortalProvisioningStateSucceeded), - // Public: to.Ptr(true), - // ResourceRequests: &armappplatform.APIPortalResourceRequests{ - // CPU: to.Ptr("1"), - // Memory: to.Ptr("1G"), - // }, - // URL: to.Ptr("test-url"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApiPortals_CreateOrUpdate.json -func ExampleAPIPortalsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAPIPortalsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", armappplatform.APIPortalResource{ - Properties: &armappplatform.APIPortalProperties{ - GatewayIDs: []*string{ - to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default")}, - Public: to.Ptr(true), - }, - SKU: &armappplatform.SKU{ - Name: to.Ptr("E0"), - Capacity: to.Ptr[int32](2), - Tier: to.Ptr("Enterprise"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.APIPortalResource = armappplatform.APIPortalResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apiPortals"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apiPortals/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.APIPortalProperties{ - // GatewayIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default")}, - // Instances: []*armappplatform.APIPortalInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.APIPortalProvisioningStateSucceeded), - // Public: to.Ptr(true), - // ResourceRequests: &armappplatform.APIPortalResourceRequests{ - // CPU: to.Ptr("1"), - // Memory: to.Ptr("1G"), - // }, - // URL: to.Ptr("test-url"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApiPortals_Delete.json -func ExampleAPIPortalsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAPIPortalsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApiPortals_List.json -func ExampleAPIPortalsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAPIPortalsClient().NewListPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.APIPortalResourceCollection = armappplatform.APIPortalResourceCollection{ - // Value: []*armappplatform.APIPortalResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apiPortals"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apiPortals/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.APIPortalProperties{ - // GatewayIDs: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default")}, - // Instances: []*armappplatform.APIPortalInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.APIPortalProvisioningStateSucceeded), - // Public: to.Ptr(true), - // ResourceRequests: &armappplatform.APIPortalResourceRequests{ - // CPU: to.Ptr("1"), - // Memory: to.Ptr("1G"), - // }, - // URL: to.Ptr("test-url"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApiPortals_ValidateDomain.json -func ExampleAPIPortalsClient_ValidateDomain() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPIPortalsClient().ValidateDomain(ctx, "myResourceGroup", "myservice", "default", armappplatform.CustomDomainValidatePayload{ - Name: to.Ptr("mydomain.io"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomDomainValidateResult = armappplatform.CustomDomainValidateResult{ - // IsValid: to.Ptr(false), - // Message: to.Ptr("Certificate is invalid, please check if it is a self signed cert or if it contains a suitable dns name"), - // } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/apms_client.go b/sdk/resourcemanager/appplatform/armappplatform/apms_client.go new file mode 100644 index 000000000000..c4fbebce5c69 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/apms_client.go @@ -0,0 +1,386 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ApmsClient contains the methods for the Apms group. +// Don't use this type directly, use NewApmsClient() instead. +type ApmsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewApmsClient creates a new instance of ApmsClient with the specified values. +// - subscriptionID - Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewApmsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApmsClient, error) { + cl, err := arm.NewClient(moduleName+".ApmsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ApmsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update an APM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - apmName - The name of the APM +// - apmResource - Parameters for the create or update operation +// - options - ApmsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApmsClient.BeginCreateOrUpdate +// method. +func (client *ApmsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apmName string, apmResource ApmResource, options *ApmsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ApmsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, apmName, apmResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ApmsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[ApmsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create or update an APM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *ApmsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apmName string, apmResource ApmResource, options *ApmsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apmName, apmResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().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 *ApmsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apmName string, apmResource ApmResource, options *ApmsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apmName == "" { + return nil, errors.New("parameter apmName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apmName}", url.PathEscape(apmName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, apmResource) +} + +// BeginDelete - Operation to delete an APM +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - apmName - The name of the APM +// - options - ApmsClientBeginDeleteOptions contains the optional parameters for the ApmsClient.BeginDelete method. +func (client *ApmsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, apmName string, options *ApmsClientBeginDeleteOptions) (*runtime.Poller[ApmsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, apmName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApmsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ApmsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Operation to delete an APM +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *ApmsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, apmName string, options *ApmsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apmName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().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 *ApmsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apmName string, options *ApmsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apmName == "" { + return nil, errors.New("parameter apmName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apmName}", url.PathEscape(apmName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the APM by name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - apmName - The name of the APM +// - options - ApmsClientGetOptions contains the optional parameters for the ApmsClient.Get method. +func (client *ApmsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apmName string, options *ApmsClientGetOptions) (ApmsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apmName, options) + if err != nil { + return ApmsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApmsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApmsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ApmsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apmName string, options *ApmsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apmName == "" { + return nil, errors.New("parameter apmName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apmName}", url.PathEscape(apmName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-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 *ApmsClient) getHandleResponse(resp *http.Response) (ApmsClientGetResponse, error) { + result := ApmsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApmResource); err != nil { + return ApmsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Get collection of APMs. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - options - ApmsClientListOptions contains the optional parameters for the ApmsClient.NewListPager method. +func (client *ApmsClient) NewListPager(resourceGroupName string, serviceName string, options *ApmsClientListOptions) *runtime.Pager[ApmsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ApmsClientListResponse]{ + More: func(page ApmsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApmsClientListResponse) (ApmsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApmsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApmsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApmsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ApmsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ApmsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-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 *ApmsClient) listHandleResponse(resp *http.Response) (ApmsClientListResponse, error) { + result := ApmsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApmResourceCollection); err != nil { + return ApmsClientListResponse{}, err + } + return result, nil +} + +// ListSecretKeys - List keys of APM sensitive properties. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - apmName - The name of the APM +// - options - ApmsClientListSecretKeysOptions contains the optional parameters for the ApmsClient.ListSecretKeys method. +func (client *ApmsClient) ListSecretKeys(ctx context.Context, resourceGroupName string, serviceName string, apmName string, options *ApmsClientListSecretKeysOptions) (ApmsClientListSecretKeysResponse, error) { + req, err := client.listSecretKeysCreateRequest(ctx, resourceGroupName, serviceName, apmName, options) + if err != nil { + return ApmsClientListSecretKeysResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApmsClientListSecretKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApmsClientListSecretKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listSecretKeysHandleResponse(resp) +} + +// listSecretKeysCreateRequest creates the ListSecretKeys request. +func (client *ApmsClient) listSecretKeysCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apmName string, options *ApmsClientListSecretKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apms/{apmName}/listSecretKeys" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apmName == "" { + return nil, errors.New("parameter apmName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apmName}", url.PathEscape(apmName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSecretKeysHandleResponse handles the ListSecretKeys response. +func (client *ApmsClient) listSecretKeysHandleResponse(resp *http.Response) (ApmsClientListSecretKeysResponse, error) { + result := ApmsClientListSecretKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApmSecretKeys); err != nil { + return ApmsClientListSecretKeysResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client.go b/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client.go index 146bd52fc94b..d7ac30ca2a84 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client.go @@ -48,7 +48,7 @@ func NewApplicationAcceleratorsClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Create or update the application accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -71,7 +71,7 @@ func (client *ApplicationAcceleratorsClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Create or update the application accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ApplicationAcceleratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, applicationAcceleratorResource ApplicationAcceleratorResource, options *ApplicationAcceleratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, applicationAcceleratorResource, options) if err != nil { @@ -111,7 +111,7 @@ func (client *ApplicationAcceleratorsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, applicationAcceleratorResource) @@ -120,7 +120,7 @@ func (client *ApplicationAcceleratorsClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Delete the application accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -142,7 +142,7 @@ func (client *ApplicationAcceleratorsClient) BeginDelete(ctx context.Context, re // Delete - Delete the application accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ApplicationAcceleratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, options *ApplicationAcceleratorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, options) if err != nil { @@ -182,7 +182,7 @@ func (client *ApplicationAcceleratorsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *ApplicationAcceleratorsClient) deleteCreateRequest(ctx context.Con // Get - Get the application accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -237,7 +237,7 @@ func (client *ApplicationAcceleratorsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *ApplicationAcceleratorsClient) getHandleResponse(resp *http.Respon // NewListPager - Handle requests to list all application accelerator. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -308,7 +308,7 @@ func (client *ApplicationAcceleratorsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client_example_test.go deleted file mode 100644 index 2f4600ea300c..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client_example_test.go +++ /dev/null @@ -1,224 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApplicationAccelerators_List.json -func ExampleApplicationAcceleratorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationAcceleratorsClient().NewListPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationAcceleratorResourceCollection = armappplatform.ApplicationAcceleratorResourceCollection{ - // Value: []*armappplatform.ApplicationAcceleratorResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationAccelerators"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationAccelerators/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ApplicationAcceleratorProperties{ - // Components: []*armappplatform.ApplicationAcceleratorComponent{ - // { - // Name: to.Ptr("component1"), - // Instances: []*armappplatform.ApplicationAcceleratorInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }}, - // ResourceRequests: &armappplatform.ApplicationAcceleratorResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](1), - // Memory: to.Ptr("1Gi"), - // }, - // }}, - // ProvisioningState: to.Ptr(armappplatform.ApplicationAcceleratorProvisioningStateSucceeded), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApplicationAccelerators_Get.json -func ExampleApplicationAcceleratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationAcceleratorsClient().Get(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationAcceleratorResource = armappplatform.ApplicationAcceleratorResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationAccelerators"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationAccelerators/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ApplicationAcceleratorProperties{ - // Components: []*armappplatform.ApplicationAcceleratorComponent{ - // { - // Name: to.Ptr("component1"), - // Instances: []*armappplatform.ApplicationAcceleratorInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }}, - // ResourceRequests: &armappplatform.ApplicationAcceleratorResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](1), - // Memory: to.Ptr("1Gi"), - // }, - // }}, - // ProvisioningState: to.Ptr(armappplatform.ApplicationAcceleratorProvisioningStateSucceeded), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApplicationAccelerators_CreateOrUpdate.json -func ExampleApplicationAcceleratorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationAcceleratorsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", armappplatform.ApplicationAcceleratorResource{ - Properties: &armappplatform.ApplicationAcceleratorProperties{}, - SKU: &armappplatform.SKU{ - Name: to.Ptr("E0"), - Capacity: to.Ptr[int32](2), - Tier: to.Ptr("Enterprise"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationAcceleratorResource = armappplatform.ApplicationAcceleratorResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationAccelerators"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationAccelerators/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ApplicationAcceleratorProperties{ - // Components: []*armappplatform.ApplicationAcceleratorComponent{ - // { - // Name: to.Ptr("component1"), - // Instances: []*armappplatform.ApplicationAcceleratorInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }}, - // ResourceRequests: &armappplatform.ApplicationAcceleratorResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](1), - // Memory: to.Ptr("1Gi"), - // }, - // }}, - // ProvisioningState: to.Ptr(armappplatform.ApplicationAcceleratorProvisioningStateSucceeded), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApplicationAccelerators_Delete.json -func ExampleApplicationAcceleratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationAcceleratorsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", 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/appplatform/armappplatform/applicationliveviews_client.go b/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client.go index 81f3fa3feb81..3912e08cdbfb 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client.go @@ -48,7 +48,7 @@ func NewApplicationLiveViewsClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Create the default Application Live View or update the existing Application Live View. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -71,7 +71,7 @@ func (client *ApplicationLiveViewsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Create the default Application Live View or update the existing Application Live View. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ApplicationLiveViewsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, applicationLiveViewResource ApplicationLiveViewResource, options *ApplicationLiveViewsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, applicationLiveViewName, applicationLiveViewResource, options) if err != nil { @@ -111,7 +111,7 @@ func (client *ApplicationLiveViewsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, applicationLiveViewResource) @@ -120,7 +120,7 @@ func (client *ApplicationLiveViewsClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Disable the default Application Live View. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -142,7 +142,7 @@ func (client *ApplicationLiveViewsClient) BeginDelete(ctx context.Context, resou // Delete - Disable the default Application Live View. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ApplicationLiveViewsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, options *ApplicationLiveViewsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, applicationLiveViewName, options) if err != nil { @@ -182,7 +182,7 @@ func (client *ApplicationLiveViewsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *ApplicationLiveViewsClient) deleteCreateRequest(ctx context.Contex // Get - Get the Application Live and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -237,7 +237,7 @@ func (client *ApplicationLiveViewsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *ApplicationLiveViewsClient) getHandleResponse(resp *http.Response) // NewListPager - Handles requests to list all resources in a Service. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -308,7 +308,7 @@ func (client *ApplicationLiveViewsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client_example_test.go deleted file mode 100644 index 30f4c8b8795a..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client_example_test.go +++ /dev/null @@ -1,242 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApplicationLiveViews_List.json -func ExampleApplicationLiveViewsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationLiveViewsClient().NewListPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationLiveViewResourceCollection = armappplatform.ApplicationLiveViewResourceCollection{ - // Value: []*armappplatform.ApplicationLiveViewResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationLiveViews"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationLiveViews/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ApplicationLiveViewProperties{ - // Components: []*armappplatform.ApplicationLiveViewComponent{ - // { - // Name: "app-live-view-server", - // Instances: []*armappplatform.ApplicationLiveViewInstance{ - // { - // Name: to.Ptr("app-live-view-server-name"), - // Status: to.Ptr("Running"), - // }}, - // ResourceRequests: &armappplatform.ApplicationLiveViewResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](1), - // Memory: to.Ptr("1Gi"), - // }, - // }, - // { - // Name: "app-live-view-connector", - // Instances: []*armappplatform.ApplicationLiveViewInstance{ - // { - // Name: to.Ptr("app-live-view-connector-name1"), - // Status: to.Ptr("Starting"), - // }}, - // ResourceRequests: &armappplatform.ApplicationLiveViewResourceRequests{ - // CPU: to.Ptr("500m"), - // InstanceCount: to.Ptr[int32](1), - // Memory: to.Ptr("500Mi"), - // }, - // }}, - // ProvisioningState: to.Ptr(armappplatform.ApplicationLiveViewProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApplicationLiveViews_Get.json -func ExampleApplicationLiveViewsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationLiveViewsClient().Get(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationLiveViewResource = armappplatform.ApplicationLiveViewResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationLiveViews"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationLiveViews/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ApplicationLiveViewProperties{ - // Components: []*armappplatform.ApplicationLiveViewComponent{ - // { - // Name: "app-live-view-server", - // Instances: []*armappplatform.ApplicationLiveViewInstance{ - // { - // Name: to.Ptr("app-live-view-server-name"), - // Status: to.Ptr("Running"), - // }}, - // ResourceRequests: &armappplatform.ApplicationLiveViewResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](1), - // Memory: to.Ptr("1Gi"), - // }, - // }, - // { - // Name: "app-live-view-connector", - // Instances: []*armappplatform.ApplicationLiveViewInstance{ - // { - // Name: to.Ptr("app-live-view-connector-name1"), - // Status: to.Ptr("Starting"), - // }}, - // ResourceRequests: &armappplatform.ApplicationLiveViewResourceRequests{ - // CPU: to.Ptr("500m"), - // InstanceCount: to.Ptr[int32](1), - // Memory: to.Ptr("500Mi"), - // }, - // }}, - // ProvisioningState: to.Ptr(armappplatform.ApplicationLiveViewProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApplicationLiveViews_CreateOrUpdate.json -func ExampleApplicationLiveViewsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationLiveViewsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", armappplatform.ApplicationLiveViewResource{ - Properties: &armappplatform.ApplicationLiveViewProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ApplicationLiveViewResource = armappplatform.ApplicationLiveViewResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationLiveViews"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationLiveViews/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ApplicationLiveViewProperties{ - // Components: []*armappplatform.ApplicationLiveViewComponent{ - // { - // Name: "app-live-view-server", - // Instances: []*armappplatform.ApplicationLiveViewInstance{ - // { - // Name: to.Ptr("app-live-view-server-name"), - // Status: to.Ptr("Running"), - // }}, - // ResourceRequests: &armappplatform.ApplicationLiveViewResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](1), - // Memory: to.Ptr("1Gi"), - // }, - // }, - // { - // Name: "app-live-view-connector", - // Instances: []*armappplatform.ApplicationLiveViewInstance{ - // { - // Name: to.Ptr("app-live-view-connector-name1"), - // Status: to.Ptr("Starting"), - // }}, - // ResourceRequests: &armappplatform.ApplicationLiveViewResourceRequests{ - // CPU: to.Ptr("500m"), - // InstanceCount: to.Ptr[int32](1), - // Memory: to.Ptr("500Mi"), - // }, - // }}, - // ProvisioningState: to.Ptr(armappplatform.ApplicationLiveViewProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ApplicationLiveView_Delete.json -func ExampleApplicationLiveViewsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewApplicationLiveViewsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", 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/appplatform/armappplatform/apps_client.go b/sdk/resourcemanager/appplatform/armappplatform/apps_client.go index f24da3c91272..a53a5f50d845 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/apps_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/apps_client.go @@ -48,7 +48,7 @@ func NewAppsClient(subscriptionID string, credential azcore.TokenCredential, opt // BeginCreateOrUpdate - Create a new App or update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -71,7 +71,7 @@ func (client *AppsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroup // CreateOrUpdate - Create a new App or update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *AppsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource AppResource, options *AppsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, appResource, options) if err != nil { @@ -111,7 +111,7 @@ func (client *AppsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, appResource) @@ -120,7 +120,7 @@ func (client *AppsClient) createOrUpdateCreateRequest(ctx context.Context, resou // BeginDelete - Operation to delete an App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -141,7 +141,7 @@ func (client *AppsClient) BeginDelete(ctx context.Context, resourceGroupName str // Delete - Operation to delete an App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *AppsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, options *AppsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, options) if err != nil { @@ -181,7 +181,7 @@ func (client *AppsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *AppsClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Get an App and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -235,7 +235,7 @@ func (client *AppsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") if options != nil && options.SyncStatus != nil { reqQP.Set("syncStatus", *options.SyncStatus) } @@ -256,7 +256,7 @@ func (client *AppsClient) getHandleResponse(resp *http.Response) (AppsClientGetR // GetResourceUploadURL - Get an resource upload URL for an App, which may be artifacts or source archive. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -302,7 +302,7 @@ func (client *AppsClient) getResourceUploadURLCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -319,7 +319,7 @@ func (client *AppsClient) getResourceUploadURLHandleResponse(resp *http.Response // NewListPager - Handles requests to list all resources in a Service. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -372,7 +372,7 @@ func (client *AppsClient) listCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,7 +390,7 @@ func (client *AppsClient) listHandleResponse(resp *http.Response) (AppsClientLis // BeginSetActiveDeployments - Set existing Deployment under the app as active // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -413,7 +413,7 @@ func (client *AppsClient) BeginSetActiveDeployments(ctx context.Context, resourc // SetActiveDeployments - Set existing Deployment under the app as active // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *AppsClient) setActiveDeployments(ctx context.Context, resourceGroupName string, serviceName string, appName string, activeDeploymentCollection ActiveDeploymentCollection, options *AppsClientBeginSetActiveDeploymentsOptions) (*http.Response, error) { req, err := client.setActiveDeploymentsCreateRequest(ctx, resourceGroupName, serviceName, appName, activeDeploymentCollection, options) if err != nil { @@ -453,7 +453,7 @@ func (client *AppsClient) setActiveDeploymentsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, activeDeploymentCollection) @@ -462,7 +462,7 @@ func (client *AppsClient) setActiveDeploymentsCreateRequest(ctx context.Context, // BeginUpdate - Operation to update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -484,7 +484,7 @@ func (client *AppsClient) BeginUpdate(ctx context.Context, resourceGroupName str // Update - Operation to update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *AppsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource AppResource, options *AppsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, appResource, options) if err != nil { @@ -524,7 +524,7 @@ func (client *AppsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, appResource) @@ -533,7 +533,7 @@ func (client *AppsClient) updateCreateRequest(ctx context.Context, resourceGroup // ValidateDomain - Check the resource name is valid as well as not in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -579,7 +579,7 @@ func (client *AppsClient) validateDomainCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, validatePayload) diff --git a/sdk/resourcemanager/appplatform/armappplatform/apps_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/apps_client_example_test.go deleted file mode 100644 index 861b066bcefd..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/apps_client_example_test.go +++ /dev/null @@ -1,1086 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Apps_Get.json -func ExampleAppsClient_Get_appsGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAppsClient().Get(ctx, "myResourceGroup", "myservice", "myapp", &armappplatform.AppsClientGetOptions{SyncStatus: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AppResource = armappplatform.AppResource{ - // Name: to.Ptr("myapp"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalid"), - // TenantID: to.Ptr("tenantid"), - // UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId2"), - // PrincipalID: to.Ptr("principalId2"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armappplatform.AppResourceProperties{ - // CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - // { - // CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - // Type: to.Ptr(armappplatform.TypeAzureFileVolume), - // MountOptions: []*string{ - // to.Ptr("uid=0"), - // to.Ptr("gid=0"), - // to.Ptr("dir_mode=0777"), - // to.Ptr("file_mode=0777")}, - // MountPath: to.Ptr("/mypath1/mypath2"), - // ShareName: to.Ptr("myFileShare"), - // }, - // StorageID: to.Ptr("myASCStorageID"), - // }}, - // EnableEndToEndTLS: to.Ptr(false), - // Fqdn: to.Ptr("myapp.mydomain.com"), - // HTTPSOnly: to.Ptr(false), - // LoadedCertificates: []*armappplatform.LoadedCertificate{ - // { - // LoadTrustStore: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1"), - // }, - // { - // LoadTrustStore: to.Ptr(true), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2"), - // }}, - // PersistentDisk: &armappplatform.PersistentDisk{ - // MountPath: to.Ptr("/mypersistentdisk"), - // SizeInGB: to.Ptr[int32](2), - // UsedInGB: to.Ptr[int32](1), - // }, - // ProvisioningState: to.Ptr(armappplatform.AppResourceProvisioningStateSucceeded), - // Public: to.Ptr(true), - // TemporaryDisk: &armappplatform.TemporaryDisk{ - // MountPath: to.Ptr("/mytemporarydisk"), - // SizeInGB: to.Ptr[int32](2), - // }, - // URL: to.Ptr("myapp.myservice.azuremicroservices.io"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Apps_Get_VNetInjection.json -func ExampleAppsClient_Get_appsGetVNetInjection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAppsClient().Get(ctx, "myResourceGroup", "myservice", "myapp", &armappplatform.AppsClientGetOptions{SyncStatus: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AppResource = armappplatform.AppResource{ - // Name: to.Ptr("myapp"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalid"), - // TenantID: to.Ptr("tenantid"), - // UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId2"), - // PrincipalID: to.Ptr("principalId2"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armappplatform.AppResourceProperties{ - // CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - // { - // CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - // Type: to.Ptr(armappplatform.TypeAzureFileVolume), - // MountOptions: []*string{ - // to.Ptr("uid=0"), - // to.Ptr("gid=0"), - // to.Ptr("dir_mode=0777"), - // to.Ptr("file_mode=0777")}, - // MountPath: to.Ptr("/mypath1/mypath2"), - // ShareName: to.Ptr("myFileShare"), - // }, - // StorageID: to.Ptr("myASCStorageID"), - // }}, - // EnableEndToEndTLS: to.Ptr(false), - // Fqdn: to.Ptr("myapp.private.mydomain.com"), - // HTTPSOnly: to.Ptr(false), - // LoadedCertificates: []*armappplatform.LoadedCertificate{ - // { - // LoadTrustStore: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1"), - // }, - // { - // LoadTrustStore: to.Ptr(true), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2"), - // }}, - // PersistentDisk: &armappplatform.PersistentDisk{ - // MountPath: to.Ptr("/mypersistentdisk"), - // SizeInGB: to.Ptr[int32](2), - // UsedInGB: to.Ptr[int32](1), - // }, - // ProvisioningState: to.Ptr(armappplatform.AppResourceProvisioningStateSucceeded), - // Public: to.Ptr(true), - // TemporaryDisk: &armappplatform.TemporaryDisk{ - // MountPath: to.Ptr("/mytemporarydisk"), - // SizeInGB: to.Ptr[int32](2), - // }, - // URL: to.Ptr("myapp.myservice.private.azuremicroservices.io"), - // VnetAddons: &armappplatform.AppVNetAddons{ - // PublicEndpoint: to.Ptr(true), - // PublicEndpointURL: to.Ptr("myapp.myservice.azuremicroservices.io"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Apps_CreateOrUpdate.json -func ExampleAppsClient_BeginCreateOrUpdate_appsCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAppsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.AppResource{ - Identity: &armappplatform.ManagedIdentityProperties{ - Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": {}, - }, - }, - Location: to.Ptr("eastus"), - Properties: &armappplatform.AppResourceProperties{ - AddonConfigs: map[string]any{ - "ApplicationConfigurationService": map[string]any{ - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs", - }, - "ServiceRegistry": map[string]any{ - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry", - }, - }, - CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - { - CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - Type: to.Ptr(armappplatform.TypeAzureFileVolume), - EnableSubPath: to.Ptr(true), - MountOptions: []*string{ - to.Ptr("uid=0"), - to.Ptr("gid=0"), - to.Ptr("dir_mode=0777"), - to.Ptr("file_mode=0777")}, - MountPath: to.Ptr("/mypath1/mypath2"), - ShareName: to.Ptr("myFileShare"), - }, - StorageID: to.Ptr("myASCStorageID"), - }}, - EnableEndToEndTLS: to.Ptr(false), - HTTPSOnly: to.Ptr(false), - LoadedCertificates: []*armappplatform.LoadedCertificate{ - { - LoadTrustStore: to.Ptr(false), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1"), - }, - { - LoadTrustStore: to.Ptr(true), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2"), - }}, - PersistentDisk: &armappplatform.PersistentDisk{ - MountPath: to.Ptr("/mypersistentdisk"), - SizeInGB: to.Ptr[int32](2), - }, - Public: to.Ptr(true), - TemporaryDisk: &armappplatform.TemporaryDisk{ - MountPath: to.Ptr("/mytemporarydisk"), - SizeInGB: to.Ptr[int32](2), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AppResource = armappplatform.AppResource{ - // Name: to.Ptr("myapp"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalid"), - // TenantID: to.Ptr("tenantid"), - // UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId2"), - // PrincipalID: to.Ptr("principalId2"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armappplatform.AppResourceProperties{ - // AddonConfigs: map[string]any{ - // "ApplicationConfigurationService": map[string]any{ - // "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs", - // }, - // "ServiceRegistry": map[string]any{ - // "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry", - // }, - // }, - // CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - // { - // CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - // Type: to.Ptr(armappplatform.TypeAzureFileVolume), - // EnableSubPath: to.Ptr(true), - // MountOptions: []*string{ - // to.Ptr("uid=0"), - // to.Ptr("gid=0"), - // to.Ptr("dir_mode=0777"), - // to.Ptr("file_mode=0777")}, - // MountPath: to.Ptr("/mypath1/mypath2"), - // ShareName: to.Ptr("myFileShare"), - // }, - // StorageID: to.Ptr("myASCStorageID"), - // }}, - // EnableEndToEndTLS: to.Ptr(false), - // Fqdn: to.Ptr("myapp.mydomain.com"), - // HTTPSOnly: to.Ptr(false), - // PersistentDisk: &armappplatform.PersistentDisk{ - // MountPath: to.Ptr("/mypersistentdisk"), - // SizeInGB: to.Ptr[int32](2), - // UsedInGB: to.Ptr[int32](1), - // }, - // ProvisioningState: to.Ptr(armappplatform.AppResourceProvisioningStateSucceeded), - // Public: to.Ptr(true), - // TemporaryDisk: &armappplatform.TemporaryDisk{ - // MountPath: to.Ptr("/mytemporarydisk"), - // SizeInGB: to.Ptr[int32](2), - // }, - // URL: to.Ptr("myapp.myservice.azuremicroservices.io"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Apps_CreateOrUpdate_VNetInjection.json -func ExampleAppsClient_BeginCreateOrUpdate_appsCreateOrUpdateVNetInjection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAppsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.AppResource{ - Identity: &armappplatform.ManagedIdentityProperties{ - Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": {}, - }, - }, - Location: to.Ptr("eastus"), - Properties: &armappplatform.AppResourceProperties{ - AddonConfigs: map[string]any{ - "ApplicationConfigurationService": map[string]any{ - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs", - }, - "ServiceRegistry": map[string]any{ - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry", - }, - }, - CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - { - CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - Type: to.Ptr(armappplatform.TypeAzureFileVolume), - MountOptions: []*string{ - to.Ptr("uid=0"), - to.Ptr("gid=0"), - to.Ptr("dir_mode=0777"), - to.Ptr("file_mode=0777")}, - MountPath: to.Ptr("/mypath1/mypath2"), - ShareName: to.Ptr("myFileShare"), - }, - StorageID: to.Ptr("myASCStorageID"), - }}, - EnableEndToEndTLS: to.Ptr(false), - HTTPSOnly: to.Ptr(false), - LoadedCertificates: []*armappplatform.LoadedCertificate{ - { - LoadTrustStore: to.Ptr(false), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1"), - }, - { - LoadTrustStore: to.Ptr(true), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2"), - }}, - PersistentDisk: &armappplatform.PersistentDisk{ - MountPath: to.Ptr("/mypersistentdisk"), - SizeInGB: to.Ptr[int32](2), - }, - Public: to.Ptr(true), - TemporaryDisk: &armappplatform.TemporaryDisk{ - MountPath: to.Ptr("/mytemporarydisk"), - SizeInGB: to.Ptr[int32](2), - }, - VnetAddons: &armappplatform.AppVNetAddons{ - PublicEndpoint: to.Ptr(true), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AppResource = armappplatform.AppResource{ - // Name: to.Ptr("myapp"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalid"), - // TenantID: to.Ptr("tenantid"), - // UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId2"), - // PrincipalID: to.Ptr("principalId2"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armappplatform.AppResourceProperties{ - // AddonConfigs: map[string]any{ - // "ApplicationConfigurationService": map[string]any{ - // "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs", - // }, - // "ServiceRegistry": map[string]any{ - // "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry", - // }, - // }, - // CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - // { - // CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - // Type: to.Ptr(armappplatform.TypeAzureFileVolume), - // MountOptions: []*string{ - // to.Ptr("uid=0"), - // to.Ptr("gid=0"), - // to.Ptr("dir_mode=0777"), - // to.Ptr("file_mode=0777")}, - // MountPath: to.Ptr("/mypath1/mypath2"), - // ShareName: to.Ptr("myFileShare"), - // }, - // StorageID: to.Ptr("myASCStorageID"), - // }}, - // EnableEndToEndTLS: to.Ptr(false), - // Fqdn: to.Ptr("myapp.private.mydomain.com"), - // HTTPSOnly: to.Ptr(false), - // PersistentDisk: &armappplatform.PersistentDisk{ - // MountPath: to.Ptr("/mypersistentdisk"), - // SizeInGB: to.Ptr[int32](2), - // UsedInGB: to.Ptr[int32](1), - // }, - // ProvisioningState: to.Ptr(armappplatform.AppResourceProvisioningStateSucceeded), - // Public: to.Ptr(true), - // TemporaryDisk: &armappplatform.TemporaryDisk{ - // MountPath: to.Ptr("/mytemporarydisk"), - // SizeInGB: to.Ptr[int32](2), - // }, - // URL: to.Ptr("myapp.myservice.private.azuremicroservices.io"), - // VnetAddons: &armappplatform.AppVNetAddons{ - // PublicEndpoint: to.Ptr(true), - // PublicEndpointURL: to.Ptr("myapp.myservice.azuremicroservices.io"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Apps_Delete.json -func ExampleAppsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAppsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "myapp", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Apps_Update.json -func ExampleAppsClient_BeginUpdate_appsUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAppsClient().BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.AppResource{ - Identity: &armappplatform.ManagedIdentityProperties{ - Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": {}, - }, - }, - Location: to.Ptr("eastus"), - Properties: &armappplatform.AppResourceProperties{ - CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - { - CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - Type: to.Ptr(armappplatform.TypeAzureFileVolume), - MountOptions: []*string{}, - MountPath: to.Ptr("/mypath1/mypath2"), - ShareName: to.Ptr("myFileShare"), - }, - StorageID: to.Ptr("myASCStorageID"), - }}, - EnableEndToEndTLS: to.Ptr(false), - HTTPSOnly: to.Ptr(false), - PersistentDisk: &armappplatform.PersistentDisk{ - MountPath: to.Ptr("/mypersistentdisk"), - SizeInGB: to.Ptr[int32](2), - }, - Public: to.Ptr(true), - TemporaryDisk: &armappplatform.TemporaryDisk{ - MountPath: to.Ptr("/mytemporarydisk"), - SizeInGB: to.Ptr[int32](2), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AppResource = armappplatform.AppResource{ - // Name: to.Ptr("myapp"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalid"), - // TenantID: to.Ptr("tenantid"), - // UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId2"), - // PrincipalID: to.Ptr("principalId2"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armappplatform.AppResourceProperties{ - // CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - // { - // CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - // Type: to.Ptr(armappplatform.TypeAzureFileVolume), - // MountOptions: []*string{ - // }, - // MountPath: to.Ptr("/mypath1/mypath2"), - // ShareName: to.Ptr("myFileShare"), - // }, - // StorageID: to.Ptr("myASCStorageID"), - // }}, - // EnableEndToEndTLS: to.Ptr(false), - // Fqdn: to.Ptr("myapp.mydomain.com"), - // HTTPSOnly: to.Ptr(false), - // PersistentDisk: &armappplatform.PersistentDisk{ - // MountPath: to.Ptr("/mypersistentdisk"), - // SizeInGB: to.Ptr[int32](2), - // UsedInGB: to.Ptr[int32](1), - // }, - // ProvisioningState: to.Ptr(armappplatform.AppResourceProvisioningStateSucceeded), - // Public: to.Ptr(true), - // TemporaryDisk: &armappplatform.TemporaryDisk{ - // MountPath: to.Ptr("/mytemporarydisk"), - // SizeInGB: to.Ptr[int32](2), - // }, - // URL: to.Ptr("myapp.myservice.azuremicroservices.io"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Apps_Update_VNetInjection.json -func ExampleAppsClient_BeginUpdate_appsUpdateVNetInjection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAppsClient().BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.AppResource{ - Identity: &armappplatform.ManagedIdentityProperties{ - Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": {}, - }, - }, - Location: to.Ptr("eastus"), - Properties: &armappplatform.AppResourceProperties{ - CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - { - CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - Type: to.Ptr(armappplatform.TypeAzureFileVolume), - MountOptions: []*string{}, - MountPath: to.Ptr("/mypath1/mypath2"), - ShareName: to.Ptr("myFileShare"), - }, - StorageID: to.Ptr("myASCStorageID"), - }}, - EnableEndToEndTLS: to.Ptr(false), - HTTPSOnly: to.Ptr(false), - PersistentDisk: &armappplatform.PersistentDisk{ - MountPath: to.Ptr("/mypersistentdisk"), - SizeInGB: to.Ptr[int32](2), - }, - Public: to.Ptr(true), - TemporaryDisk: &armappplatform.TemporaryDisk{ - MountPath: to.Ptr("/mytemporarydisk"), - SizeInGB: to.Ptr[int32](2), - }, - VnetAddons: &armappplatform.AppVNetAddons{ - PublicEndpoint: to.Ptr(true), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AppResource = armappplatform.AppResource{ - // Name: to.Ptr("myapp"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalid"), - // TenantID: to.Ptr("tenantid"), - // UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId2"), - // PrincipalID: to.Ptr("principalId2"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armappplatform.AppResourceProperties{ - // CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - // { - // CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - // Type: to.Ptr(armappplatform.TypeAzureFileVolume), - // MountOptions: []*string{ - // }, - // MountPath: to.Ptr("/mypath1/mypath2"), - // ShareName: to.Ptr("myFileShare"), - // }, - // StorageID: to.Ptr("myASCStorageID"), - // }}, - // EnableEndToEndTLS: to.Ptr(false), - // Fqdn: to.Ptr("myapp.private.mydomain.com"), - // HTTPSOnly: to.Ptr(false), - // PersistentDisk: &armappplatform.PersistentDisk{ - // MountPath: to.Ptr("/mypersistentdisk"), - // SizeInGB: to.Ptr[int32](2), - // UsedInGB: to.Ptr[int32](1), - // }, - // ProvisioningState: to.Ptr(armappplatform.AppResourceProvisioningStateSucceeded), - // Public: to.Ptr(true), - // TemporaryDisk: &armappplatform.TemporaryDisk{ - // MountPath: to.Ptr("/mytemporarydisk"), - // SizeInGB: to.Ptr[int32](2), - // }, - // URL: to.Ptr("myapp.myservice.private.azuremicroservices.io"), - // VnetAddons: &armappplatform.AppVNetAddons{ - // PublicEndpoint: to.Ptr(true), - // PublicEndpointURL: to.Ptr("myapp.myservice.azuremicroservices.io"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Apps_List.json -func ExampleAppsClient_NewListPager_appsList() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAppsClient().NewListPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AppResourceCollection = armappplatform.AppResourceCollection{ - // Value: []*armappplatform.AppResource{ - // { - // Name: to.Ptr("myapp"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalid"), - // TenantID: to.Ptr("tenantid"), - // UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId2"), - // PrincipalID: to.Ptr("principalId2"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armappplatform.AppResourceProperties{ - // CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - // { - // CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - // Type: to.Ptr(armappplatform.TypeAzureFileVolume), - // MountOptions: []*string{ - // to.Ptr("uid=0"), - // to.Ptr("gid=0"), - // to.Ptr("dir_mode=0777"), - // to.Ptr("file_mode=0777")}, - // MountPath: to.Ptr("/mypath1/mypath2"), - // ShareName: to.Ptr("myFileShare"), - // }, - // StorageID: to.Ptr("myASCStorageID"), - // }}, - // EnableEndToEndTLS: to.Ptr(false), - // Fqdn: to.Ptr("myapp.mydomain.com"), - // HTTPSOnly: to.Ptr(false), - // LoadedCertificates: []*armappplatform.LoadedCertificate{ - // { - // LoadTrustStore: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1"), - // }, - // { - // LoadTrustStore: to.Ptr(true), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2"), - // }}, - // PersistentDisk: &armappplatform.PersistentDisk{ - // MountPath: to.Ptr("/mypersistentdisk"), - // SizeInGB: to.Ptr[int32](2), - // UsedInGB: to.Ptr[int32](1), - // }, - // ProvisioningState: to.Ptr(armappplatform.AppResourceProvisioningStateSucceeded), - // Public: to.Ptr(true), - // TemporaryDisk: &armappplatform.TemporaryDisk{ - // MountPath: to.Ptr("/mytemporarydisk"), - // SizeInGB: to.Ptr[int32](2), - // }, - // URL: to.Ptr("myapp.myservice.azuremicroservices.io"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Apps_List_VNetInjection.json -func ExampleAppsClient_NewListPager_appsListVNetInjection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAppsClient().NewListPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AppResourceCollection = armappplatform.AppResourceCollection{ - // Value: []*armappplatform.AppResource{ - // { - // Name: to.Ptr("myapp"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalid"), - // TenantID: to.Ptr("tenantid"), - // UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId2"), - // PrincipalID: to.Ptr("principalId2"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armappplatform.AppResourceProperties{ - // CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - // { - // CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - // Type: to.Ptr(armappplatform.TypeAzureFileVolume), - // MountOptions: []*string{ - // to.Ptr("uid=0"), - // to.Ptr("gid=0"), - // to.Ptr("dir_mode=0777"), - // to.Ptr("file_mode=0777")}, - // MountPath: to.Ptr("/mypath1/mypath2"), - // ShareName: to.Ptr("myFileShare"), - // }, - // StorageID: to.Ptr("myASCStorageID"), - // }}, - // EnableEndToEndTLS: to.Ptr(false), - // Fqdn: to.Ptr("myapp.mydomain.com"), - // HTTPSOnly: to.Ptr(false), - // LoadedCertificates: []*armappplatform.LoadedCertificate{ - // { - // LoadTrustStore: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1"), - // }, - // { - // LoadTrustStore: to.Ptr(true), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2"), - // }}, - // PersistentDisk: &armappplatform.PersistentDisk{ - // MountPath: to.Ptr("/mypersistentdisk"), - // SizeInGB: to.Ptr[int32](2), - // UsedInGB: to.Ptr[int32](1), - // }, - // ProvisioningState: to.Ptr(armappplatform.AppResourceProvisioningStateSucceeded), - // Public: to.Ptr(true), - // TemporaryDisk: &armappplatform.TemporaryDisk{ - // MountPath: to.Ptr("/mytemporarydisk"), - // SizeInGB: to.Ptr[int32](2), - // }, - // URL: to.Ptr("myapp.myservice.private.azuremicroservices.io"), - // VnetAddons: &armappplatform.AppVNetAddons{ - // PublicEndpoint: to.Ptr(true), - // PublicEndpointURL: to.Ptr("myapp.myservice.azuremicroservices.io"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Apps_GetResourceUploadUrl.json -func ExampleAppsClient_GetResourceUploadURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAppsClient().GetResourceUploadURL(ctx, "myResourceGroup", "myservice", "myapp", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceUploadDefinition = armappplatform.ResourceUploadDefinition{ - // RelativePath: to.Ptr("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20190801-3ed9f4a2-986b-4bbd-b833-a42dccb2f777"), - // UploadURL: to.Ptr("https://springcloudstorageaccount.file.core.windows.net/bd172614181f42e2853f6fd90029cda8/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20190801-3ed9f4a2-986b-4bbd-b833-a42dccb2f777?sv=2018-03-28&sr=f&sig=SampleSignature&se=2019-08-01T10%3A42%3A21Z&sp=w"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Apps_SetActiveDeployments.json -func ExampleAppsClient_BeginSetActiveDeployments() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAppsClient().BeginSetActiveDeployments(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.ActiveDeploymentCollection{ - ActiveDeploymentNames: []*string{ - to.Ptr("default")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AppResource = armappplatform.AppResource{ - // Name: to.Ptr("myapp"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("principalid"), - // TenantID: to.Ptr("tenantid"), - // UserAssignedIdentities: map[string]*armappplatform.UserAssignedManagedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId1"), - // PrincipalID: to.Ptr("principalId1"), - // }, - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2": &armappplatform.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("clientId2"), - // PrincipalID: to.Ptr("principalId2"), - // }, - // }, - // }, - // Location: to.Ptr("eastus"), - // Properties: &armappplatform.AppResourceProperties{ - // CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ - // { - // CustomPersistentDiskProperties: &armappplatform.AzureFileVolume{ - // Type: to.Ptr(armappplatform.TypeAzureFileVolume), - // MountOptions: []*string{ - // }, - // MountPath: to.Ptr("/mypath1/mypath2"), - // ShareName: to.Ptr("myFileShare"), - // }, - // StorageID: to.Ptr("myASCStorageID"), - // }}, - // EnableEndToEndTLS: to.Ptr(false), - // Fqdn: to.Ptr("myapp.mydomain.com"), - // HTTPSOnly: to.Ptr(false), - // PersistentDisk: &armappplatform.PersistentDisk{ - // MountPath: to.Ptr("/mypersistentdisk"), - // SizeInGB: to.Ptr[int32](2), - // UsedInGB: to.Ptr[int32](1), - // }, - // ProvisioningState: to.Ptr(armappplatform.AppResourceProvisioningStateSucceeded), - // Public: to.Ptr(true), - // TemporaryDisk: &armappplatform.TemporaryDisk{ - // MountPath: to.Ptr("/mytemporarydisk"), - // SizeInGB: to.Ptr[int32](2), - // }, - // URL: to.Ptr("myapp.myservice.azuremicroservices.io"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Apps_ValidateDomain.json -func ExampleAppsClient_ValidateDomain() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAppsClient().ValidateDomain(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.CustomDomainValidatePayload{ - Name: to.Ptr("mydomain.io"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomDomainValidateResult = armappplatform.CustomDomainValidateResult{ - // IsValid: to.Ptr(false), - // Message: to.Ptr("Certificate is invalid, please check if it is a self signed cert or if it contains a suitable dns name"), - // } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/autorest.md b/sdk/resourcemanager/appplatform/armappplatform/autorest.md index efeb986f3edc..0a416b090d33 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/autorest.md +++ b/sdk/resourcemanager/appplatform/armappplatform/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appplatform/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appplatform/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0-beta.1 -tag: package-preview-2023-01 +module-version: 2.0.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/appplatform/armappplatform/bindings_client.go b/sdk/resourcemanager/appplatform/armappplatform/bindings_client.go index d9eee6f8e26d..f5b0832b4f00 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/bindings_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/bindings_client.go @@ -48,7 +48,7 @@ func NewBindingsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create a new Binding or update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -72,7 +72,7 @@ func (client *BindingsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a new Binding or update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *BindingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, bindingResource BindingResource, options *BindingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, bindingResource, options) if err != nil { @@ -116,7 +116,7 @@ func (client *BindingsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bindingResource) @@ -125,7 +125,7 @@ func (client *BindingsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Operation to delete a Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -147,7 +147,7 @@ func (client *BindingsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Operation to delete a Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *BindingsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, options *BindingsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, options) if err != nil { @@ -191,7 +191,7 @@ func (client *BindingsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +200,7 @@ func (client *BindingsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a Binding and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -250,7 +250,7 @@ func (client *BindingsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +267,7 @@ func (client *BindingsClient) getHandleResponse(resp *http.Response) (BindingsCl // NewListPager - Handles requests to list all resources in an App. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -325,7 +325,7 @@ func (client *BindingsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -343,7 +343,7 @@ func (client *BindingsClient) listHandleResponse(resp *http.Response) (BindingsC // BeginUpdate - Operation to update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -366,7 +366,7 @@ func (client *BindingsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Operation to update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *BindingsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, bindingResource BindingResource, options *BindingsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, bindingResource, options) if err != nil { @@ -410,7 +410,7 @@ func (client *BindingsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bindingResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/bindings_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/bindings_client_example_test.go deleted file mode 100644 index e2775b122e5b..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/bindings_client_example_test.go +++ /dev/null @@ -1,253 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Bindings_Get.json -func ExampleBindingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBindingsClient().Get(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BindingResource = armappplatform.BindingResource{ - // Name: to.Ptr("mybinding"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/bindings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/bindings/mybinding"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BindingResourceProperties{ - // BindingParameters: map[string]*string{ - // "apiType": to.Ptr("SQL"), - // "databaseName": to.Ptr("db1"), - // }, - // CreatedAt: to.Ptr("2019-01-01T12:34:56.000Z"), - // GeneratedProperties: to.Ptr(""), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1"), - // ResourceName: to.Ptr("my-cosmosdb-1"), - // ResourceType: to.Ptr("Microsoft.DocumentDB"), - // UpdatedAt: to.Ptr("2019-01-01T12:34:56.000Z"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Bindings_CreateOrUpdate.json -func ExampleBindingsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBindingsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", armappplatform.BindingResource{ - Properties: &armappplatform.BindingResourceProperties{ - BindingParameters: map[string]*string{ - "apiType": to.Ptr("SQL"), - "databaseName": to.Ptr("db1"), - }, - Key: to.Ptr("xxxx"), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BindingResource = armappplatform.BindingResource{ - // Name: to.Ptr("mybinding"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/bindings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/bindings/mybinding"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BindingResourceProperties{ - // BindingParameters: map[string]*string{ - // "apiType": to.Ptr("SQL"), - // "databaseName": to.Ptr("db1"), - // }, - // CreatedAt: to.Ptr("2019-01-01T12:34:56.000Z"), - // GeneratedProperties: to.Ptr(""), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1"), - // ResourceName: to.Ptr("my-cosmosdb-1"), - // ResourceType: to.Ptr("Microsoft.DocumentDB"), - // UpdatedAt: to.Ptr("2019-01-01T12:34:56.000Z"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Bindings_Delete.json -func ExampleBindingsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBindingsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Bindings_Update.json -func ExampleBindingsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBindingsClient().BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", armappplatform.BindingResource{ - Properties: &armappplatform.BindingResourceProperties{ - BindingParameters: map[string]*string{ - "apiType": to.Ptr("SQL"), - "databaseName": to.Ptr("db1"), - }, - Key: to.Ptr("xxxx"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BindingResource = armappplatform.BindingResource{ - // Name: to.Ptr("mybinding"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/bindings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/bindings/mybinding"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BindingResourceProperties{ - // BindingParameters: map[string]*string{ - // "apiType": to.Ptr("SQL"), - // "databaseName": to.Ptr("db1"), - // }, - // CreatedAt: to.Ptr("2019-01-01T12:34:56.000Z"), - // GeneratedProperties: to.Ptr(""), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1"), - // ResourceName: to.Ptr("my-cosmosdb-1"), - // ResourceType: to.Ptr("Microsoft.DocumentDB"), - // UpdatedAt: to.Ptr("2019-01-01T12:34:56.000Z"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Bindings_List.json -func ExampleBindingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBindingsClient().NewListPager("myResourceGroup", "myservice", "myapp", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BindingResourceCollection = armappplatform.BindingResourceCollection{ - // Value: []*armappplatform.BindingResource{ - // { - // Name: to.Ptr("mybinding"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/bindings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/bindings/mybinding"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BindingResourceProperties{ - // BindingParameters: map[string]*string{ - // "apiType": to.Ptr("SQL"), - // "databaseName": to.Ptr("db1"), - // }, - // CreatedAt: to.Ptr("2019-01-01T12:34:56.000Z"), - // GeneratedProperties: to.Ptr(""), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1"), - // ResourceName: to.Ptr("my-cosmosdb-1"), - // ResourceType: to.Ptr("Microsoft.DocumentDB"), - // UpdatedAt: to.Ptr("2019-01-01T12:34:56.000Z"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client.go b/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client.go index d9a330601cc5..97ca04bfc573 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client.go @@ -48,7 +48,7 @@ func NewBuildpackBindingClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Create or update a buildpack binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -73,7 +73,7 @@ func (client *BuildpackBindingClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Create or update a buildpack binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *BuildpackBindingClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, buildpackBindingName string, buildpackBinding BuildpackBindingResource, options *BuildpackBindingClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, buildpackBinding, options) if err != nil { @@ -121,7 +121,7 @@ func (client *BuildpackBindingClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, buildpackBinding) @@ -130,7 +130,7 @@ func (client *BuildpackBindingClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Operation to delete a Buildpack Binding // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -154,7 +154,7 @@ func (client *BuildpackBindingClient) BeginDelete(ctx context.Context, resourceG // Delete - Operation to delete a Buildpack Binding // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *BuildpackBindingClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, buildpackBindingName string, options *BuildpackBindingClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, options) if err != nil { @@ -202,7 +202,7 @@ func (client *BuildpackBindingClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,7 @@ func (client *BuildpackBindingClient) deleteCreateRequest(ctx context.Context, r // Get - Get a buildpack binding by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -266,7 +266,7 @@ func (client *BuildpackBindingClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *BuildpackBindingClient) getHandleResponse(resp *http.Response) (Bu // NewListPager - Handles requests to list all buildpack bindings in a builder. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -347,7 +347,7 @@ func (client *BuildpackBindingClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,7 +364,7 @@ func (client *BuildpackBindingClient) listHandleResponse(resp *http.Response) (B // NewListForClusterPager - Get collection of buildpack bindings under all builders. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -418,7 +418,7 @@ func (client *BuildpackBindingClient) listForClusterCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client_example_test.go deleted file mode 100644 index 268d2699e495..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client_example_test.go +++ /dev/null @@ -1,283 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildpackBinding_ListForCluster.json -func ExampleBuildpackBindingClient_NewListForClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBuildpackBindingClient().NewListForClusterPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BuildpackBindingResourceCollection = armappplatform.BuildpackBindingResourceCollection{ - // Value: []*armappplatform.BuildpackBindingResource{ - // { - // Name: to.Ptr("myBuildpackBinding"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default/buildpackBindings/myBuildpackBinding"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildpackBindingProperties{ - // BindingType: to.Ptr(armappplatform.BindingTypeApplicationInsights), - // LaunchProperties: &armappplatform.BuildpackBindingLaunchProperties{ - // Properties: map[string]*string{ - // "abc": to.Ptr("def"), - // "any-string": to.Ptr("any-string"), - // "sampling-rate": to.Ptr("12.0"), - // }, - // Secrets: map[string]*string{ - // "connection-string": to.Ptr("*"), - // }, - // }, - // ProvisioningState: to.Ptr(armappplatform.BuildpackBindingProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("appdynamic"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default/buildpackBindings/appdynamic"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildpackBindingProperties{ - // BindingType: to.Ptr(armappplatform.BindingTypeAppDynamics), - // LaunchProperties: &armappplatform.BuildpackBindingLaunchProperties{ - // Properties: map[string]*string{ - // "abc": to.Ptr("def"), - // }, - // Secrets: map[string]*string{ - // }, - // }, - // ProvisioningState: to.Ptr(armappplatform.BuildpackBindingProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildpackBinding_Get.json -func ExampleBuildpackBindingClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildpackBindingClient().Get(ctx, "myResourceGroup", "myservice", "default", "default", "myBuildpackBinding", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BuildpackBindingResource = armappplatform.BuildpackBindingResource{ - // Name: to.Ptr("myBuildpackBinding"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default/buildpackBindings/myBuildpackBinding"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildpackBindingProperties{ - // BindingType: to.Ptr(armappplatform.BindingTypeApplicationInsights), - // LaunchProperties: &armappplatform.BuildpackBindingLaunchProperties{ - // Properties: map[string]*string{ - // "abc": to.Ptr("def"), - // "any-string": to.Ptr("any-string"), - // "sampling-rate": to.Ptr("12.0"), - // }, - // Secrets: map[string]*string{ - // "connection-string": to.Ptr("*"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildpackBinding_CreateOrUpdate.json -func ExampleBuildpackBindingClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBuildpackBindingClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", "default", "myBuildpackBinding", armappplatform.BuildpackBindingResource{ - Properties: &armappplatform.BuildpackBindingProperties{ - BindingType: to.Ptr(armappplatform.BindingTypeApplicationInsights), - LaunchProperties: &armappplatform.BuildpackBindingLaunchProperties{ - Properties: map[string]*string{ - "abc": to.Ptr("def"), - "any-string": to.Ptr("any-string"), - "sampling-rate": to.Ptr("12.0"), - }, - Secrets: map[string]*string{ - "connection-string": to.Ptr("XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BuildpackBindingResource = armappplatform.BuildpackBindingResource{ - // Name: to.Ptr("myBuildpackBinding"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default/buildpackBindings/myBuildpackBinding"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildpackBindingProperties{ - // BindingType: to.Ptr(armappplatform.BindingTypeApplicationInsights), - // LaunchProperties: &armappplatform.BuildpackBindingLaunchProperties{ - // Properties: map[string]*string{ - // "abc": to.Ptr("def"), - // "any-string": to.Ptr("any-string"), - // "sampling-rate": to.Ptr("12.0"), - // }, - // Secrets: map[string]*string{ - // "connection-string": to.Ptr("*"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildpackBinding_Delete.json -func ExampleBuildpackBindingClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBuildpackBindingClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", "default", "myBuildpackBinding", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildpackBinding_List.json -func ExampleBuildpackBindingClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBuildpackBindingClient().NewListPager("myResourceGroup", "myservice", "default", "default", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BuildpackBindingResourceCollection = armappplatform.BuildpackBindingResourceCollection{ - // Value: []*armappplatform.BuildpackBindingResource{ - // { - // Name: to.Ptr("myBuildpackBinding"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default/buildpackBindings/myBuildpackBinding"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildpackBindingProperties{ - // BindingType: to.Ptr(armappplatform.BindingTypeApplicationInsights), - // LaunchProperties: &armappplatform.BuildpackBindingLaunchProperties{ - // Properties: map[string]*string{ - // "abc": to.Ptr("def"), - // "any-string": to.Ptr("any-string"), - // "sampling-rate": to.Ptr("12.0"), - // }, - // Secrets: map[string]*string{ - // "connection-string": to.Ptr("*"), - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildservice_client.go b/sdk/resourcemanager/appplatform/armappplatform/buildservice_client.go index c10751378438..72293b7a54eb 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildservice_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildservice_client.go @@ -45,10 +45,84 @@ func NewBuildServiceClient(subscriptionID string, credential azcore.TokenCredent return client, nil } +// BeginCreateOrUpdate - Create a build service resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - buildServiceName - The name of the build service resource. +// - buildService - Parameters for the create operation +// - options - BuildServiceClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildServiceClient.BeginCreateOrUpdate +// method. +func (client *BuildServiceClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildService BuildService, options *BuildServiceClientBeginCreateOrUpdateOptions) (*runtime.Poller[BuildServiceClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, buildServiceName, buildService, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildServiceClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[BuildServiceClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create a build service resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *BuildServiceClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildService BuildService, options *BuildServiceClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, buildService, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().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 *BuildServiceClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildService BuildService, options *BuildServiceClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if buildServiceName == "" { + return nil, errors.New("parameter buildServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{buildServiceName}", url.PathEscape(buildServiceName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, buildService) +} + // CreateOrUpdateBuild - Create or update a KPack build. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -100,7 +174,7 @@ func (client *BuildServiceClient) createOrUpdateBuildCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, buildParam) @@ -115,10 +189,88 @@ func (client *BuildServiceClient) createOrUpdateBuildHandleResponse(resp *http.R return result, nil } +// BeginDeleteBuild - delete a KPack build. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - buildServiceName - The name of the build service resource. +// - buildName - The name of the build resource. +// - options - BuildServiceClientBeginDeleteBuildOptions contains the optional parameters for the BuildServiceClient.BeginDeleteBuild +// method. +func (client *BuildServiceClient) BeginDeleteBuild(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildName string, options *BuildServiceClientBeginDeleteBuildOptions) (*runtime.Poller[BuildServiceClientDeleteBuildResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteBuild(ctx, resourceGroupName, serviceName, buildServiceName, buildName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildServiceClientDeleteBuildResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[BuildServiceClientDeleteBuildResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// DeleteBuild - delete a KPack build. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *BuildServiceClient) deleteBuild(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildName string, options *BuildServiceClientBeginDeleteBuildOptions) (*http.Response, error) { + req, err := client.deleteBuildCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, buildName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().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 +} + +// deleteBuildCreateRequest creates the DeleteBuild request. +func (client *BuildServiceClient) deleteBuildCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildName string, options *BuildServiceClientBeginDeleteBuildOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builds/{buildName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if buildServiceName == "" { + return nil, errors.New("parameter buildServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{buildServiceName}", url.PathEscape(buildServiceName)) + if buildName == "" { + return nil, errors.New("parameter buildName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{buildName}", url.PathEscape(buildName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // GetBuild - Get a KPack build. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -168,7 +320,7 @@ func (client *BuildServiceClient) getBuildCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +338,7 @@ func (client *BuildServiceClient) getBuildHandleResponse(resp *http.Response) (B // GetBuildResult - Get a KPack build result. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -242,7 +394,7 @@ func (client *BuildServiceClient) getBuildResultCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,7 +412,7 @@ func (client *BuildServiceClient) getBuildResultHandleResponse(resp *http.Respon // GetBuildResultLog - Get a KPack build result log download URL. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -316,7 +468,7 @@ func (client *BuildServiceClient) getBuildResultLogCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,7 +486,7 @@ func (client *BuildServiceClient) getBuildResultLogHandleResponse(resp *http.Res // GetBuildService - Get a build service resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -380,7 +532,7 @@ func (client *BuildServiceClient) getBuildServiceCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -398,7 +550,7 @@ func (client *BuildServiceClient) getBuildServiceHandleResponse(resp *http.Respo // GetResourceUploadURL - Get an resource upload URL for build service, which may be artifacts or source archive. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -444,7 +596,7 @@ func (client *BuildServiceClient) getResourceUploadURLCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -462,7 +614,7 @@ func (client *BuildServiceClient) getResourceUploadURLHandleResponse(resp *http. // GetSupportedBuildpack - Get the supported buildpack resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -513,7 +665,7 @@ func (client *BuildServiceClient) getSupportedBuildpackCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -531,7 +683,7 @@ func (client *BuildServiceClient) getSupportedBuildpackHandleResponse(resp *http // GetSupportedStack - Get the supported stack resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -582,7 +734,7 @@ func (client *BuildServiceClient) getSupportedStackCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -599,7 +751,7 @@ func (client *BuildServiceClient) getSupportedStackHandleResponse(resp *http.Res // NewListBuildResultsPager - List KPack build results. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -663,7 +815,7 @@ func (client *BuildServiceClient) listBuildResultsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -680,7 +832,7 @@ func (client *BuildServiceClient) listBuildResultsHandleResponse(resp *http.Resp // NewListBuildServicesPager - List build services resource. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -734,7 +886,7 @@ func (client *BuildServiceClient) listBuildServicesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -751,7 +903,7 @@ func (client *BuildServiceClient) listBuildServicesHandleResponse(resp *http.Res // NewListBuildsPager - List KPack builds. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -810,7 +962,7 @@ func (client *BuildServiceClient) listBuildsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -828,7 +980,7 @@ func (client *BuildServiceClient) listBuildsHandleResponse(resp *http.Response) // ListSupportedBuildpacks - Get all supported buildpacks. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -874,7 +1026,7 @@ func (client *BuildServiceClient) listSupportedBuildpacksCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -892,7 +1044,7 @@ func (client *BuildServiceClient) listSupportedBuildpacksHandleResponse(resp *ht // ListSupportedStacks - Get all supported stacks. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -938,7 +1090,7 @@ func (client *BuildServiceClient) listSupportedStacksCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildservice_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/buildservice_client_example_test.go deleted file mode 100644 index e37e370e06cb..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/buildservice_client_example_test.go +++ /dev/null @@ -1,631 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_ListBuildServices.json -func ExampleBuildServiceClient_NewListBuildServicesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBuildServiceClient().NewListBuildServicesPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BuildServiceCollection = armappplatform.BuildServiceCollection{ - // Value: []*armappplatform.BuildService{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildServiceProperties{ - // KPackVersion: to.Ptr("0.3.1"), - // ProvisioningState: to.Ptr(armappplatform.BuildServiceProvisioningStateSucceeded), - // ResourceRequests: &armappplatform.BuildServicePropertiesResourceRequests{ - // CPU: to.Ptr("200m"), - // Memory: to.Ptr("4Gi"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_GetBuildService.json -func ExampleBuildServiceClient_GetBuildService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceClient().GetBuildService(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BuildService = armappplatform.BuildService{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildServiceProperties{ - // KPackVersion: to.Ptr("0.3.1"), - // ProvisioningState: to.Ptr(armappplatform.BuildServiceProvisioningStateSucceeded), - // ResourceRequests: &armappplatform.BuildServicePropertiesResourceRequests{ - // CPU: to.Ptr("200m"), - // Memory: to.Ptr("4Gi"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_ListBuilds.json -func ExampleBuildServiceClient_NewListBuildsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBuildServiceClient().NewListBuildsPager("myResourceGroup", "myservice", "default", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BuildCollection = armappplatform.BuildCollection{ - // Value: []*armappplatform.Build{ - // { - // Name: to.Ptr("myBuild"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builds/myBuild"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildProperties{ - // AgentPool: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default"), - // Builder: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default"), - // Env: map[string]*string{ - // "environmentVariable": to.Ptr("test"), - // }, - // ProvisioningState: to.Ptr(armappplatform.BuildProvisioningStateSucceeded), - // RelativePath: to.Ptr("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777"), - // ResourceRequests: &armappplatform.BuildResourceRequests{ - // CPU: to.Ptr("1"), - // Memory: to.Ptr("2Gi"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_GetBuild.json -func ExampleBuildServiceClient_GetBuild() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceClient().GetBuild(ctx, "myResourceGroup", "myservice", "default", "mybuild", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Build = armappplatform.Build{ - // Name: to.Ptr("123"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builds/results"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builds/mybuild/results/123"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildProperties{ - // AgentPool: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default"), - // Builder: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default"), - // Env: map[string]*string{ - // "environmentVariable": to.Ptr("test"), - // }, - // ProvisioningState: to.Ptr(armappplatform.BuildProvisioningStateSucceeded), - // RelativePath: to.Ptr("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777"), - // ResourceRequests: &armappplatform.BuildResourceRequests{ - // CPU: to.Ptr("1"), - // Memory: to.Ptr("2Gi"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_CreateOrUpdateBuild.json -func ExampleBuildServiceClient_CreateOrUpdateBuild() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceClient().CreateOrUpdateBuild(ctx, "myResourceGroup", "myservice", "default", "mybuild", armappplatform.Build{ - Properties: &armappplatform.BuildProperties{ - AgentPool: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default"), - Builder: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default"), - Env: map[string]*string{ - "environmentVariable": to.Ptr("test"), - }, - RelativePath: to.Ptr("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777"), - ResourceRequests: &armappplatform.BuildResourceRequests{ - CPU: to.Ptr("1"), - Memory: to.Ptr("2Gi"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Build = armappplatform.Build{ - // Name: to.Ptr("mybuild"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builds"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builds/mybuild"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildProperties{ - // AgentPool: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default"), - // Builder: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default"), - // Env: map[string]*string{ - // "environmentVariable": to.Ptr("test"), - // }, - // ProvisioningState: to.Ptr(armappplatform.BuildProvisioningStateSucceeded), - // RelativePath: to.Ptr("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777"), - // ResourceRequests: &armappplatform.BuildResourceRequests{ - // CPU: to.Ptr("1"), - // Memory: to.Ptr("2Gi"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_ListBuildResults.json -func ExampleBuildServiceClient_NewListBuildResultsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBuildServiceClient().NewListBuildResultsPager("myResourceGroup", "myservice", "default", "mybuild", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BuildResultCollection = armappplatform.BuildResultCollection{ - // Value: []*armappplatform.BuildResult{ - // { - // Name: to.Ptr("123"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builds/results"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builds/mybuild/results/123"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildResultProperties{ - // Name: to.Ptr("123"), - // BuildPodName: to.Ptr("mybuild-default-1"), - // BuildStages: []*armappplatform.BuildStageProperties{ - // { - // Name: to.Ptr("prepare"), - // ExitCode: to.Ptr("0"), - // Reason: to.Ptr("Completed"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), - // }, - // { - // Name: to.Ptr("detect"), - // ExitCode: to.Ptr("0"), - // Reason: to.Ptr("Completed"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), - // }, - // { - // Name: to.Ptr("analyze"), - // ExitCode: to.Ptr("0"), - // Reason: to.Ptr("Completed"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), - // }, - // { - // Name: to.Ptr("restore"), - // ExitCode: to.Ptr("0"), - // Reason: to.Ptr("Completed"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), - // }, - // { - // Name: to.Ptr("build"), - // ExitCode: to.Ptr("51"), - // Reason: to.Ptr("Error"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateFailed), - // }, - // { - // Name: to.Ptr("export"), - // ExitCode: to.Ptr("-1"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateNotStarted), - // }}, - // Error: &armappplatform.Error{ - // Code: to.Ptr("51"), - // Message: to.Ptr("Build failed in stage build with reason OOMKilled, please refer to https://aka.ms/buildexitcode"), - // }, - // ProvisioningState: to.Ptr(armappplatform.BuildResultProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_GetBuildResult.json -func ExampleBuildServiceClient_GetBuildResult() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceClient().GetBuildResult(ctx, "myResourceGroup", "myservice", "default", "mybuild", "123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BuildResult = armappplatform.BuildResult{ - // Name: to.Ptr("123"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builds/results"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builds/mybuild/results/123"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildResultProperties{ - // Name: to.Ptr("123"), - // BuildPodName: to.Ptr("mybuild-default-1"), - // BuildStages: []*armappplatform.BuildStageProperties{ - // { - // Name: to.Ptr("prepare"), - // ExitCode: to.Ptr("0"), - // Reason: to.Ptr("Completed"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), - // }, - // { - // Name: to.Ptr("detect"), - // ExitCode: to.Ptr("0"), - // Reason: to.Ptr("Completed"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), - // }, - // { - // Name: to.Ptr("analyze"), - // ExitCode: to.Ptr("0"), - // Reason: to.Ptr("Completed"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), - // }, - // { - // Name: to.Ptr("restore"), - // ExitCode: to.Ptr("0"), - // Reason: to.Ptr("Completed"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), - // }, - // { - // Name: to.Ptr("build"), - // ExitCode: to.Ptr("51"), - // Reason: to.Ptr("Error"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateFailed), - // }, - // { - // Name: to.Ptr("export"), - // ExitCode: to.Ptr("-1"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateNotStarted), - // }}, - // Error: &armappplatform.Error{ - // Code: to.Ptr("51"), - // Message: to.Ptr("Build failed in stage build with reason OOMKilled, please refer to https://aka.ms/buildexitcode"), - // }, - // ProvisioningState: to.Ptr(armappplatform.BuildResultProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_GetBuildResultLog.json -func ExampleBuildServiceClient_GetBuildResultLog() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceClient().GetBuildResultLog(ctx, "myResourceGroup", "myservice", "default", "mybuild", "123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BuildResultLog = armappplatform.BuildResultLog{ - // BlobURL: to.Ptr("https://sample-storage-account-name.blob.core.windows.net/sample-log-blob-file?readonly-sas-token"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_GetResourceUploadUrl.json -func ExampleBuildServiceClient_GetResourceUploadURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceClient().GetResourceUploadURL(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceUploadDefinition = armappplatform.ResourceUploadDefinition{ - // RelativePath: to.Ptr("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777"), - // UploadURL: to.Ptr("https://springcloudstorageaccount.file.core.windows.net/bd172614181f42e2853f6fd90029cda8/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777?sv=2021-06-01&sr=f&sig=SampleSignature&se=2021-06-01T10%3A42%3A21Z&sp=w"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_ListSupportedBuildpacks.json -func ExampleBuildServiceClient_ListSupportedBuildpacks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceClient().ListSupportedBuildpacks(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SupportedBuildpacksCollection = armappplatform.SupportedBuildpacksCollection{ - // Value: []*armappplatform.SupportedBuildpackResource{ - // { - // Name: to.Ptr("tanzu-buildpacks-java-azure"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/supportedBuildpacks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/supportedBuildpacks/tanzu-buildpacks-java-azure"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.SupportedBuildpackResourceProperties{ - // BuildpackID: to.Ptr("tanzu-buildpacks/java-azure"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_GetSupportedBuildpack.json -func ExampleBuildServiceClient_GetSupportedBuildpack() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceClient().GetSupportedBuildpack(ctx, "myResourceGroup", "myservice", "default", "tanzu-buildpacks-java-azure", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SupportedBuildpackResource = armappplatform.SupportedBuildpackResource{ - // Name: to.Ptr("tanzu-buildpacks-java-azure"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/supportedBuildpacks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/supportedBuildpacks/tanzu-buildpacks-java-azure"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.SupportedBuildpackResourceProperties{ - // BuildpackID: to.Ptr("tanzu-buildpacks/java-azure"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_ListSupportedStacks.json -func ExampleBuildServiceClient_ListSupportedStacks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceClient().ListSupportedStacks(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SupportedStacksCollection = armappplatform.SupportedStacksCollection{ - // Value: []*armappplatform.SupportedStackResource{ - // { - // Name: to.Ptr("io.buildpacks.stacks.bionic-base"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/supportedStacks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/supportedStacks/io.buildpacks.stacks.bionic-base"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.SupportedStackResourceProperties{ - // StackID: to.Ptr("io.buildpacks.stacks.bionic"), - // Version: to.Ptr("base"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildService_GetSupportedStack.json -func ExampleBuildServiceClient_GetSupportedStack() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceClient().GetSupportedStack(ctx, "myResourceGroup", "myservice", "default", "io.buildpacks.stacks.bionic-base", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SupportedStackResource = armappplatform.SupportedStackResource{ - // Name: to.Ptr("io.buildpacks.stacks.bionic-base"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/supportedStacks"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/supportedBuildpacks/io.buildpacks.stacks.bionic-base"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.SupportedStackResourceProperties{ - // StackID: to.Ptr("io.buildpacks.stacks.bionic"), - // Version: to.Ptr("base"), - // }, - // } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client.go b/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client.go index 5cd5e2670538..d3e1c0ebe1c4 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client.go @@ -48,7 +48,7 @@ func NewBuildServiceAgentPoolClient(subscriptionID string, credential azcore.Tok // Get - Get build service agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -99,7 +99,7 @@ func (client *BuildServiceAgentPoolClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *BuildServiceAgentPoolClient) getHandleResponse(resp *http.Response // NewListPager - List build service agent pool. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -175,7 +175,7 @@ func (client *BuildServiceAgentPoolClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *BuildServiceAgentPoolClient) listHandleResponse(resp *http.Respons // BeginUpdatePut - Create or update build service agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -217,7 +217,7 @@ func (client *BuildServiceAgentPoolClient) BeginUpdatePut(ctx context.Context, r // UpdatePut - Create or update build service agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *BuildServiceAgentPoolClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, agentPoolName string, agentPoolResource BuildServiceAgentPoolResource, options *BuildServiceAgentPoolClientBeginUpdatePutOptions) (*http.Response, error) { req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource, options) if err != nil { @@ -261,7 +261,7 @@ func (client *BuildServiceAgentPoolClient) updatePutCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, agentPoolResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client_example_test.go deleted file mode 100644 index 1b9be0331c95..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client_example_test.go +++ /dev/null @@ -1,160 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildServiceAgentPool_List.json -func ExampleBuildServiceAgentPoolClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBuildServiceAgentPoolClient().NewListPager("myResourceGroup", "myservice", "default", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BuildServiceAgentPoolResourceCollection = armappplatform.BuildServiceAgentPoolResourceCollection{ - // Value: []*armappplatform.BuildServiceAgentPoolResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/agentPools"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildServiceAgentPoolProperties{ - // PoolSize: &armappplatform.BuildServiceAgentPoolSizeProperties{ - // Name: to.Ptr("S3"), - // CPU: to.Ptr("4"), - // Memory: to.Ptr("8Gi"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildServiceAgentPool_Get.json -func ExampleBuildServiceAgentPoolClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceAgentPoolClient().Get(ctx, "myResourceGroup", "myservice", "default", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BuildServiceAgentPoolResource = armappplatform.BuildServiceAgentPoolResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/agentPools"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildServiceAgentPoolProperties{ - // PoolSize: &armappplatform.BuildServiceAgentPoolSizeProperties{ - // Name: to.Ptr("S3"), - // CPU: to.Ptr("4"), - // Memory: to.Ptr("8Gi"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildServiceAgentPool_UpdatePut.json -func ExampleBuildServiceAgentPoolClient_BeginUpdatePut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBuildServiceAgentPoolClient().BeginUpdatePut(ctx, "myResourceGroup", "myservice", "default", "default", armappplatform.BuildServiceAgentPoolResource{ - Properties: &armappplatform.BuildServiceAgentPoolProperties{ - PoolSize: &armappplatform.BuildServiceAgentPoolSizeProperties{ - Name: to.Ptr("S3"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BuildServiceAgentPoolResource = armappplatform.BuildServiceAgentPoolResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/agentPools"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuildServiceAgentPoolProperties{ - // PoolSize: &armappplatform.BuildServiceAgentPoolSizeProperties{ - // Name: to.Ptr("S3"), - // CPU: to.Ptr("4"), - // Memory: to.Ptr("8Gi"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client.go b/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client.go index addbf30af2a4..b68715d7073c 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client.go @@ -48,7 +48,7 @@ func NewBuildServiceBuilderClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Create or update a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -72,7 +72,7 @@ func (client *BuildServiceBuilderClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Create or update a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *BuildServiceBuilderClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, builderResource BuilderResource, options *BuildServiceBuilderClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, builderResource, options) if err != nil { @@ -116,7 +116,7 @@ func (client *BuildServiceBuilderClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, builderResource) @@ -125,7 +125,7 @@ func (client *BuildServiceBuilderClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -148,7 +148,7 @@ func (client *BuildServiceBuilderClient) BeginDelete(ctx context.Context, resour // Delete - Delete a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *BuildServiceBuilderClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, options *BuildServiceBuilderClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, options) if err != nil { @@ -192,7 +192,7 @@ func (client *BuildServiceBuilderClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *BuildServiceBuilderClient) deleteCreateRequest(ctx context.Context // Get - Get a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -251,7 +251,7 @@ func (client *BuildServiceBuilderClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *BuildServiceBuilderClient) getHandleResponse(resp *http.Response) // NewListPager - List KPack builders result. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -327,7 +327,7 @@ func (client *BuildServiceBuilderClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +345,7 @@ func (client *BuildServiceBuilderClient) listHandleResponse(resp *http.Response) // ListDeployments - List deployments that are using the builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -396,7 +396,7 @@ func (client *BuildServiceBuilderClient) listDeploymentsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client_example_test.go deleted file mode 100644 index d5efd0363dc4..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client_example_test.go +++ /dev/null @@ -1,239 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildServiceBuilder_Get.json -func ExampleBuildServiceBuilderClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceBuilderClient().Get(ctx, "myResourceGroup", "myservice", "default", "mybuilder", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BuilderResource = armappplatform.BuilderResource{ - // Name: to.Ptr("mybuilder"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builders"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/mybuilder"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuilderProperties{ - // BuildpackGroups: []*armappplatform.BuildpacksGroupProperties{ - // { - // Name: to.Ptr("mix"), - // Buildpacks: []*armappplatform.BuildpackProperties{ - // { - // ID: to.Ptr("tanzu-buildpacks/java-azure"), - // }}, - // }}, - // ProvisioningState: to.Ptr(armappplatform.BuilderProvisioningStateSucceeded), - // Stack: &armappplatform.StackProperties{ - // ID: to.Ptr("io.buildpacks.stacks.bionic"), - // Version: to.Ptr("base"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildServiceBuilder_CreateOrUpdate.json -func ExampleBuildServiceBuilderClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBuildServiceBuilderClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", "mybuilder", armappplatform.BuilderResource{ - Properties: &armappplatform.BuilderProperties{ - BuildpackGroups: []*armappplatform.BuildpacksGroupProperties{ - { - Name: to.Ptr("mix"), - Buildpacks: []*armappplatform.BuildpackProperties{ - { - ID: to.Ptr("tanzu-buildpacks/java-azure"), - }}, - }}, - Stack: &armappplatform.StackProperties{ - ID: to.Ptr("io.buildpacks.stacks.bionic"), - Version: to.Ptr("base"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BuilderResource = armappplatform.BuilderResource{ - // Name: to.Ptr("mybuilder"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builders"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/mybuilder"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuilderProperties{ - // BuildpackGroups: []*armappplatform.BuildpacksGroupProperties{ - // { - // Name: to.Ptr("mix"), - // Buildpacks: []*armappplatform.BuildpackProperties{ - // { - // ID: to.Ptr("tanzu-buildpacks/java-azure"), - // }, - // { - // ID: to.Ptr("tanzu-buildpacks/dotnet-core"), - // }}, - // }}, - // ProvisioningState: to.Ptr(armappplatform.BuilderProvisioningStateSucceeded), - // Stack: &armappplatform.StackProperties{ - // ID: to.Ptr("io.buildpacks.stacks.bionic"), - // Version: to.Ptr("base"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildServiceBuilder_Delete.json -func ExampleBuildServiceBuilderClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBuildServiceBuilderClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", "mybuilder", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildServiceBuilder_List.json -func ExampleBuildServiceBuilderClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBuildServiceBuilderClient().NewListPager("myResourceGroup", "myservice", "default", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BuilderResourceCollection = armappplatform.BuilderResourceCollection{ - // Value: []*armappplatform.BuilderResource{ - // { - // Name: to.Ptr("mybuilder"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/buildServices/builders"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/mybuilder"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.BuilderProperties{ - // BuildpackGroups: []*armappplatform.BuildpacksGroupProperties{ - // { - // Name: to.Ptr("mix"), - // Buildpacks: []*armappplatform.BuildpackProperties{ - // { - // ID: to.Ptr("tanzu-buildpacks/java-azure"), - // }}, - // }}, - // ProvisioningState: to.Ptr(armappplatform.BuilderProvisioningStateSucceeded), - // Stack: &armappplatform.StackProperties{ - // ID: to.Ptr("io.buildpacks.stacks.bionic"), - // Version: to.Ptr("base"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/BuildServiceBuilder_ListDeployments.json -func ExampleBuildServiceBuilderClient_ListDeployments() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBuildServiceBuilderClient().ListDeployments(ctx, "myResourceGroup", "myservice", "default", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeploymentList = armappplatform.DeploymentList{ - // Deployments: []*string{ - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/test/deployments/default"), - // to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/test/deployments/green")}, - // } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/certificates_client.go b/sdk/resourcemanager/appplatform/armappplatform/certificates_client.go index 86c83f3da072..1bd7736da557 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/certificates_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/certificates_client.go @@ -48,7 +48,7 @@ func NewCertificatesClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Create or update certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -71,7 +71,7 @@ func (client *CertificatesClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Create or update certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *CertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, certificateName string, certificateResource CertificateResource, options *CertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, certificateName, certificateResource, options) if err != nil { @@ -111,7 +111,7 @@ func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, certificateResource) @@ -120,7 +120,7 @@ func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete the certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -142,7 +142,7 @@ func (client *CertificatesClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete the certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *CertificatesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, certificateName string, options *CertificatesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, certificateName, options) if err != nil { @@ -182,7 +182,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou // Get - Get the certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -236,7 +236,7 @@ func (client *CertificatesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +253,7 @@ func (client *CertificatesClient) getHandleResponse(resp *http.Response) (Certif // NewListPager - List all the certificates of one user. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -306,7 +306,7 @@ func (client *CertificatesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/certificates_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/certificates_client_example_test.go deleted file mode 100644 index f6c0419b667e..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/certificates_client_example_test.go +++ /dev/null @@ -1,211 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Certificates_Get.json -func ExampleCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCertificatesClient().Get(ctx, "myResourceGroup", "myservice", "mycertificate", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateResource = armappplatform.CertificateResource{ - // Name: to.Ptr("mycertificate"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/certificates"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycertificate"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.KeyVaultCertificateProperties{ - // Type: to.Ptr("KeyVaultCertificate"), - // ActivateDate: to.Ptr("2019-02-22T07:40:42Z"), - // DNSNames: []*string{ - // to.Ptr("mydomain.com"), - // to.Ptr("mydomain.net"), - // to.Ptr("mydomain.io")}, - // ExpirationDate: to.Ptr("2019-02-21T07:40:42Z"), - // IssuedDate: to.Ptr("2019-02-20T07:40:42Z"), - // Issuer: to.Ptr("mydomain.com"), - // ProvisioningState: to.Ptr(armappplatform.CertificateResourceProvisioningStateSucceeded), - // SubjectName: to.Ptr("mysubjectname"), - // Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), - // CertVersion: to.Ptr("08a219d06d874795a96db47e06fbb01e"), - // ExcludePrivateKey: to.Ptr(false), - // KeyVaultCertName: to.Ptr("mycert"), - // VaultURI: to.Ptr("https://myvault.vault.azure.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Certificates_CreateOrUpdate.json -func ExampleCertificatesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificatesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "mycertificate", armappplatform.CertificateResource{ - Properties: &armappplatform.KeyVaultCertificateProperties{ - Type: to.Ptr("KeyVaultCertificate"), - CertVersion: to.Ptr("08a219d06d874795a96db47e06fbb01e"), - KeyVaultCertName: to.Ptr("mycert"), - VaultURI: to.Ptr("https://myvault.vault.azure.net"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CertificateResource = armappplatform.CertificateResource{ - // Name: to.Ptr("mycertificate"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/certificates"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycertificate"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.KeyVaultCertificateProperties{ - // Type: to.Ptr("KeyVaultCertificate"), - // ActivateDate: to.Ptr("2019-02-22T07:40:42Z"), - // DNSNames: []*string{ - // to.Ptr("mydomain.com"), - // to.Ptr("mydomain.net"), - // to.Ptr("mydomain.io")}, - // ExpirationDate: to.Ptr("2019-02-21T07:40:42Z"), - // IssuedDate: to.Ptr("2019-02-20T07:40:42Z"), - // Issuer: to.Ptr("mydomain.com"), - // SubjectName: to.Ptr("mysubjectname"), - // Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), - // CertVersion: to.Ptr("08a219d06d874795a96db47e06fbb01e"), - // ExcludePrivateKey: to.Ptr(false), - // KeyVaultCertName: to.Ptr("mycert"), - // VaultURI: to.Ptr("https://myvault.vault.azure.net"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Certificates_Delete.json -func ExampleCertificatesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCertificatesClient().BeginDelete(ctx, "myResourceGroup", "myservice", "mycertificate", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Certificates_List.json -func ExampleCertificatesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCertificatesClient().NewListPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CertificateResourceCollection = armappplatform.CertificateResourceCollection{ - // Value: []*armappplatform.CertificateResource{ - // { - // Name: to.Ptr("mycertificate"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/certificates"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycertificate"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.KeyVaultCertificateProperties{ - // Type: to.Ptr("KeyVaultCertificate"), - // ActivateDate: to.Ptr("2019-02-22T07:40:42Z"), - // DNSNames: []*string{ - // to.Ptr("mydomain.com"), - // to.Ptr("mydomain.net"), - // to.Ptr("mydomain.io")}, - // ExpirationDate: to.Ptr("2019-02-21T07:40:42Z"), - // IssuedDate: to.Ptr("2019-02-20T07:40:42Z"), - // Issuer: to.Ptr("mydomain.com"), - // ProvisioningState: to.Ptr(armappplatform.CertificateResourceProvisioningStateSucceeded), - // SubjectName: to.Ptr("mysubjectname"), - // Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), - // CertVersion: to.Ptr("08a219d06d874795a96db47e06fbb01e"), - // ExcludePrivateKey: to.Ptr(false), - // KeyVaultCertName: to.Ptr("mycert"), - // VaultURI: to.Ptr("https://myvault.vault.azure.net"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/client_factory.go b/sdk/resourcemanager/appplatform/armappplatform/client_factory.go index 1f68b46b9274..863e7ad70efe 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/client_factory.go +++ b/sdk/resourcemanager/appplatform/armappplatform/client_factory.go @@ -44,6 +44,16 @@ func (c *ClientFactory) NewServicesClient() *ServicesClient { return subClient } +func (c *ClientFactory) NewApmsClient() *ApmsClient { + subClient, _ := NewApmsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewEurekaServersClient() *EurekaServersClient { + subClient, _ := NewEurekaServersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewConfigServersClient() *ConfigServersClient { subClient, _ := NewConfigServersClient(c.subscriptionID, c.credential, c.options) return subClient @@ -69,6 +79,11 @@ func (c *ClientFactory) NewDevToolPortalsClient() *DevToolPortalsClient { return subClient } +func (c *ClientFactory) NewContainerRegistriesClient() *ContainerRegistriesClient { + subClient, _ := NewContainerRegistriesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewBuildServiceClient() *BuildServiceClient { subClient, _ := NewBuildServiceClient(c.subscriptionID, c.credential, c.options) return subClient diff --git a/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go b/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go index 54b0df009902..82d803f6e756 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go @@ -48,7 +48,7 @@ func NewConfigServersClient(subscriptionID string, credential azcore.TokenCreden // Get - Get the config server and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -88,7 +88,7 @@ func (client *ConfigServersClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +106,7 @@ func (client *ConfigServersClient) getHandleResponse(resp *http.Response) (Confi // BeginUpdatePatch - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -128,7 +128,7 @@ func (client *ConfigServersClient) BeginUpdatePatch(ctx context.Context, resourc // UpdatePatch - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ConfigServersClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, configServerResource ConfigServerResource, options *ConfigServersClientBeginUpdatePatchOptions) (*http.Response, error) { req, err := client.updatePatchCreateRequest(ctx, resourceGroupName, serviceName, configServerResource, options) if err != nil { @@ -164,7 +164,7 @@ func (client *ConfigServersClient) updatePatchCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configServerResource) @@ -173,7 +173,7 @@ func (client *ConfigServersClient) updatePatchCreateRequest(ctx context.Context, // BeginUpdatePut - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -195,7 +195,7 @@ func (client *ConfigServersClient) BeginUpdatePut(ctx context.Context, resourceG // UpdatePut - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ConfigServersClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, configServerResource ConfigServerResource, options *ConfigServersClientBeginUpdatePutOptions) (*http.Response, error) { req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, configServerResource, options) if err != nil { @@ -231,7 +231,7 @@ func (client *ConfigServersClient) updatePutCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configServerResource) @@ -240,7 +240,7 @@ func (client *ConfigServersClient) updatePutCreateRequest(ctx context.Context, r // BeginValidate - Check if the config server settings are valid. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -264,7 +264,7 @@ func (client *ConfigServersClient) BeginValidate(ctx context.Context, resourceGr // Validate - Check if the config server settings are valid. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ConfigServersClient) validate(ctx context.Context, resourceGroupName string, serviceName string, configServerSettings ConfigServerSettings, options *ConfigServersClientBeginValidateOptions) (*http.Response, error) { req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, configServerSettings, options) if err != nil { @@ -300,7 +300,7 @@ func (client *ConfigServersClient) validateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configServerSettings) diff --git a/sdk/resourcemanager/appplatform/armappplatform/configservers_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/configservers_client_example_test.go deleted file mode 100644 index f9d0e0e1bd01..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/configservers_client_example_test.go +++ /dev/null @@ -1,215 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ConfigServers_Get.json -func ExampleConfigServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigServersClient().Get(ctx, "myResourceGroup", "myservice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigServerResource = armappplatform.ConfigServerResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/configServers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configServers/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ConfigServerProperties{ - // ConfigServer: &armappplatform.ConfigServerSettings{ - // GitProperty: &armappplatform.ConfigServerGitProperty{ - // Label: to.Ptr("master"), - // SearchPaths: []*string{ - // to.Ptr("/")}, - // URI: to.Ptr("https://github.com/fake-user/fake-repository.git"), - // }, - // }, - // ProvisioningState: to.Ptr(armappplatform.ConfigServerStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ConfigServers_UpdatePut.json -func ExampleConfigServersClient_BeginUpdatePut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigServersClient().BeginUpdatePut(ctx, "myResourceGroup", "myservice", armappplatform.ConfigServerResource{ - Properties: &armappplatform.ConfigServerProperties{ - ConfigServer: &armappplatform.ConfigServerSettings{ - GitProperty: &armappplatform.ConfigServerGitProperty{ - Label: to.Ptr("master"), - SearchPaths: []*string{ - to.Ptr("/")}, - URI: to.Ptr("https://github.com/fake-user/fake-repository.git"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigServerResource = armappplatform.ConfigServerResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/configServers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configServers/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ConfigServerProperties{ - // ConfigServer: &armappplatform.ConfigServerSettings{ - // GitProperty: &armappplatform.ConfigServerGitProperty{ - // Label: to.Ptr("master"), - // SearchPaths: []*string{ - // to.Ptr("/")}, - // URI: to.Ptr("https://github.com/fake-user/fake-repository.git"), - // }, - // }, - // ProvisioningState: to.Ptr(armappplatform.ConfigServerStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ConfigServers_UpdatePatch.json -func ExampleConfigServersClient_BeginUpdatePatch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigServersClient().BeginUpdatePatch(ctx, "myResourceGroup", "myservice", armappplatform.ConfigServerResource{ - Properties: &armappplatform.ConfigServerProperties{ - ConfigServer: &armappplatform.ConfigServerSettings{ - GitProperty: &armappplatform.ConfigServerGitProperty{ - Label: to.Ptr("master"), - SearchPaths: []*string{ - to.Ptr("/")}, - URI: to.Ptr("https://github.com/fake-user/fake-repository.git"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigServerResource = armappplatform.ConfigServerResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/configServers"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configServers/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ConfigServerProperties{ - // ConfigServer: &armappplatform.ConfigServerSettings{ - // GitProperty: &armappplatform.ConfigServerGitProperty{ - // Label: to.Ptr("master"), - // SearchPaths: []*string{ - // to.Ptr("/")}, - // URI: to.Ptr("https://github.com/fake-user/fake-repository.git"), - // }, - // }, - // ProvisioningState: to.Ptr(armappplatform.ConfigServerStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ConfigServers_Validate.json -func ExampleConfigServersClient_BeginValidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigServersClient().BeginValidate(ctx, "myResourceGroup", "myservice", armappplatform.ConfigServerSettings{ - GitProperty: &armappplatform.ConfigServerGitProperty{ - Label: to.Ptr("master"), - SearchPaths: []*string{ - to.Ptr("/")}, - URI: to.Ptr("https://github.com/fake-user/fake-repository.git"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigServerSettingsValidateResult = armappplatform.ConfigServerSettingsValidateResult{ - // IsValid: to.Ptr(true), - // } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client.go b/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client.go index b9b69e87f2a4..b87e76d864d7 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client.go @@ -49,7 +49,7 @@ func NewConfigurationServicesClient(subscriptionID string, credential azcore.Tok // Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -73,7 +73,7 @@ func (client *ConfigurationServicesClient) BeginCreateOrUpdate(ctx context.Conte // Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ConfigurationServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, configurationServiceResource ConfigurationServiceResource, options *ConfigurationServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, options) if err != nil { @@ -113,7 +113,7 @@ func (client *ConfigurationServicesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configurationServiceResource) @@ -122,7 +122,7 @@ func (client *ConfigurationServicesClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Disable the default Application Configuration Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -144,7 +144,7 @@ func (client *ConfigurationServicesClient) BeginDelete(ctx context.Context, reso // Delete - Disable the default Application Configuration Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ConfigurationServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, options *ConfigurationServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, options) if err != nil { @@ -184,7 +184,7 @@ func (client *ConfigurationServicesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *ConfigurationServicesClient) deleteCreateRequest(ctx context.Conte // Get - Get the Application Configuration Service and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -239,7 +239,7 @@ func (client *ConfigurationServicesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,7 +256,7 @@ func (client *ConfigurationServicesClient) getHandleResponse(resp *http.Response // NewListPager - Handles requests to list all resources in a Service. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -310,7 +310,7 @@ func (client *ConfigurationServicesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +328,7 @@ func (client *ConfigurationServicesClient) listHandleResponse(resp *http.Respons // BeginValidate - Check if the Application Configuration Service settings are valid. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -353,7 +353,7 @@ func (client *ConfigurationServicesClient) BeginValidate(ctx context.Context, re // Validate - Check if the Application Configuration Service settings are valid. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ConfigurationServicesClient) validate(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, settings ConfigurationServiceSettings, options *ConfigurationServicesClientBeginValidateOptions) (*http.Response, error) { req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, settings, options) if err != nil { @@ -393,7 +393,7 @@ func (client *ConfigurationServicesClient) validateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, settings) diff --git a/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client_example_test.go deleted file mode 100644 index 09b7b61910ca..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client_example_test.go +++ /dev/null @@ -1,295 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ConfigurationServices_Get.json -func ExampleConfigurationServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConfigurationServicesClient().Get(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigurationServiceResource = armappplatform.ConfigurationServiceResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/configurationServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ConfigurationServiceProperties{ - // Instances: []*armappplatform.ConfigurationServiceInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.ConfigurationServiceProvisioningStateSucceeded), - // ResourceRequests: &armappplatform.ConfigurationServiceResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](2), - // Memory: to.Ptr("1G"), - // }, - // Settings: &armappplatform.ConfigurationServiceSettings{ - // GitProperty: &armappplatform.ConfigurationServiceGitProperty{ - // Repositories: []*armappplatform.ConfigurationServiceGitRepository{ - // { - // Name: to.Ptr("fake"), - // Label: to.Ptr("master"), - // Patterns: []*string{ - // to.Ptr("app1"), - // to.Ptr("app2/dev")}, - // URI: to.Ptr("https://github.com/fake-user/fake-repository.git"), - // }}, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ConfigurationServices_CreateOrUpdate.json -func ExampleConfigurationServicesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationServicesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", armappplatform.ConfigurationServiceResource{ - Properties: &armappplatform.ConfigurationServiceProperties{ - Settings: &armappplatform.ConfigurationServiceSettings{ - GitProperty: &armappplatform.ConfigurationServiceGitProperty{ - Repositories: []*armappplatform.ConfigurationServiceGitRepository{ - { - Name: to.Ptr("fake"), - Label: to.Ptr("master"), - Patterns: []*string{ - to.Ptr("app/dev")}, - URI: to.Ptr("https://github.com/fake-user/fake-repository"), - }}, - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigurationServiceResource = armappplatform.ConfigurationServiceResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/configurationServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ConfigurationServiceProperties{ - // Instances: []*armappplatform.ConfigurationServiceInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.ConfigurationServiceProvisioningStateSucceeded), - // ResourceRequests: &armappplatform.ConfigurationServiceResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](2), - // Memory: to.Ptr("1G"), - // }, - // Settings: &armappplatform.ConfigurationServiceSettings{ - // GitProperty: &armappplatform.ConfigurationServiceGitProperty{ - // Repositories: []*armappplatform.ConfigurationServiceGitRepository{ - // { - // Name: to.Ptr("fake"), - // Label: to.Ptr("master"), - // Patterns: []*string{ - // to.Ptr("app/dev")}, - // URI: to.Ptr("https://github.com/fake-user/fake-repository"), - // }}, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ConfigurationServices_Delete.json -func ExampleConfigurationServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationServicesClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ConfigurationServices_List.json -func ExampleConfigurationServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConfigurationServicesClient().NewListPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConfigurationServiceResourceCollection = armappplatform.ConfigurationServiceResourceCollection{ - // Value: []*armappplatform.ConfigurationServiceResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/configurationServices"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ConfigurationServiceProperties{ - // Instances: []*armappplatform.ConfigurationServiceInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.ConfigurationServiceProvisioningStateSucceeded), - // ResourceRequests: &armappplatform.ConfigurationServiceResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](2), - // Memory: to.Ptr("1G"), - // }, - // Settings: &armappplatform.ConfigurationServiceSettings{ - // GitProperty: &armappplatform.ConfigurationServiceGitProperty{ - // Repositories: []*armappplatform.ConfigurationServiceGitRepository{ - // { - // Name: to.Ptr("fake"), - // Label: to.Ptr("master"), - // Patterns: []*string{ - // to.Ptr("app1"), - // to.Ptr("app2/dev")}, - // URI: to.Ptr("https://github.com/fake-user/fake-repository.git"), - // }}, - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ConfigurationServices_Validate.json -func ExampleConfigurationServicesClient_BeginValidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConfigurationServicesClient().BeginValidate(ctx, "myResourceGroup", "myservice", "default", armappplatform.ConfigurationServiceSettings{ - GitProperty: &armappplatform.ConfigurationServiceGitProperty{ - Repositories: []*armappplatform.ConfigurationServiceGitRepository{ - { - Name: to.Ptr("fake"), - Label: to.Ptr("master"), - Patterns: []*string{ - to.Ptr("app/dev")}, - URI: to.Ptr("https://github.com/fake-user/fake-repository"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConfigurationServiceSettingsValidateResult = armappplatform.ConfigurationServiceSettingsValidateResult{ - // GitPropertyValidationResult: &armappplatform.ConfigurationServiceGitPropertyValidateResult{ - // IsValid: to.Ptr(true), - // }, - // } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/constants.go b/sdk/resourcemanager/appplatform/armappplatform/constants.go index a328ef950627..b129b801919c 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/constants.go +++ b/sdk/resourcemanager/appplatform/armappplatform/constants.go @@ -11,7 +11,7 @@ package armappplatform const ( moduleName = "armappplatform" - moduleVersion = "v2.0.0-beta.1" + moduleVersion = "v2.0.0-beta.2" ) // APIPortalProvisioningState - State of the API portal. @@ -50,6 +50,30 @@ func PossibleActionTypeValues() []ActionType { } } +// ApmProvisioningState - State of the APM. +type ApmProvisioningState string + +const ( + ApmProvisioningStateCanceled ApmProvisioningState = "Canceled" + ApmProvisioningStateCreating ApmProvisioningState = "Creating" + ApmProvisioningStateDeleting ApmProvisioningState = "Deleting" + ApmProvisioningStateFailed ApmProvisioningState = "Failed" + ApmProvisioningStateSucceeded ApmProvisioningState = "Succeeded" + ApmProvisioningStateUpdating ApmProvisioningState = "Updating" +) + +// PossibleApmProvisioningStateValues returns the possible values for the ApmProvisioningState const type. +func PossibleApmProvisioningStateValues() []ApmProvisioningState { + return []ApmProvisioningState{ + ApmProvisioningStateCanceled, + ApmProvisioningStateCreating, + ApmProvisioningStateDeleting, + ApmProvisioningStateFailed, + ApmProvisioningStateSucceeded, + ApmProvisioningStateUpdating, + } +} + // ApmType - Type of application performance monitoring type ApmType string @@ -226,7 +250,7 @@ func PossibleBuildResultProvisioningStateValues() []BuildResultProvisioningState } } -// BuildServiceProvisioningState - Provisioning state of the KPack build result +// BuildServiceProvisioningState - Provisioning state of the KPack build service type BuildServiceProvisioningState string const ( @@ -314,6 +338,24 @@ func PossibleCertificateResourceProvisioningStateValues() []CertificateResourceP } } +// ConfigServerEnabledState - Enabled state of the config server. This is only used in Consumption tier. +type ConfigServerEnabledState string + +const ( + // ConfigServerEnabledStateDisabled - Disable the config server. + ConfigServerEnabledStateDisabled ConfigServerEnabledState = "Disabled" + // ConfigServerEnabledStateEnabled - Enable the config server. + ConfigServerEnabledStateEnabled ConfigServerEnabledState = "Enabled" +) + +// PossibleConfigServerEnabledStateValues returns the possible values for the ConfigServerEnabledState const type. +func PossibleConfigServerEnabledStateValues() []ConfigServerEnabledState { + return []ConfigServerEnabledState{ + ConfigServerEnabledStateDisabled, + ConfigServerEnabledStateEnabled, + } +} + // ConfigServerState - State of the config server. type ConfigServerState string @@ -336,6 +378,22 @@ func PossibleConfigServerStateValues() []ConfigServerState { } } +// ConfigurationServiceGeneration - The generation of the Application Configuration Service. +type ConfigurationServiceGeneration string + +const ( + ConfigurationServiceGenerationGen1 ConfigurationServiceGeneration = "Gen1" + ConfigurationServiceGenerationGen2 ConfigurationServiceGeneration = "Gen2" +) + +// PossibleConfigurationServiceGenerationValues returns the possible values for the ConfigurationServiceGeneration const type. +func PossibleConfigurationServiceGenerationValues() []ConfigurationServiceGeneration { + return []ConfigurationServiceGeneration{ + ConfigurationServiceGenerationGen1, + ConfigurationServiceGenerationGen2, + } +} + // ConfigurationServiceProvisioningState - State of the Application Configuration Service. type ConfigurationServiceProvisioningState string @@ -358,6 +416,30 @@ func PossibleConfigurationServiceProvisioningStateValues() []ConfigurationServic } } +// ContainerRegistryProvisioningState - State of the Container Registry. +type ContainerRegistryProvisioningState string + +const ( + ContainerRegistryProvisioningStateCanceled ContainerRegistryProvisioningState = "Canceled" + ContainerRegistryProvisioningStateCreating ContainerRegistryProvisioningState = "Creating" + ContainerRegistryProvisioningStateDeleting ContainerRegistryProvisioningState = "Deleting" + ContainerRegistryProvisioningStateFailed ContainerRegistryProvisioningState = "Failed" + ContainerRegistryProvisioningStateSucceeded ContainerRegistryProvisioningState = "Succeeded" + ContainerRegistryProvisioningStateUpdating ContainerRegistryProvisioningState = "Updating" +) + +// PossibleContainerRegistryProvisioningStateValues returns the possible values for the ContainerRegistryProvisioningState const type. +func PossibleContainerRegistryProvisioningStateValues() []ContainerRegistryProvisioningState { + return []ContainerRegistryProvisioningState{ + ContainerRegistryProvisioningStateCanceled, + ContainerRegistryProvisioningStateCreating, + ContainerRegistryProvisioningStateDeleting, + ContainerRegistryProvisioningStateFailed, + ContainerRegistryProvisioningStateSucceeded, + ContainerRegistryProvisioningStateUpdating, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -518,6 +600,62 @@ func PossibleDevToolPortalProvisioningStateValues() []DevToolPortalProvisioningS } } +// EurekaServerEnabledState - Enabled state of the eureka server. This is only used in Consumption tier. +type EurekaServerEnabledState string + +const ( + // EurekaServerEnabledStateDisabled - Disable the eureka server. + EurekaServerEnabledStateDisabled EurekaServerEnabledState = "Disabled" + // EurekaServerEnabledStateEnabled - Enable the eureka server. + EurekaServerEnabledStateEnabled EurekaServerEnabledState = "Enabled" +) + +// PossibleEurekaServerEnabledStateValues returns the possible values for the EurekaServerEnabledState const type. +func PossibleEurekaServerEnabledStateValues() []EurekaServerEnabledState { + return []EurekaServerEnabledState{ + EurekaServerEnabledStateDisabled, + EurekaServerEnabledStateEnabled, + } +} + +// EurekaServerState - State of the eureka server. +type EurekaServerState string + +const ( + EurekaServerStateCanceled EurekaServerState = "Canceled" + EurekaServerStateFailed EurekaServerState = "Failed" + EurekaServerStateSucceeded EurekaServerState = "Succeeded" + EurekaServerStateUpdating EurekaServerState = "Updating" +) + +// PossibleEurekaServerStateValues returns the possible values for the EurekaServerState const type. +func PossibleEurekaServerStateValues() []EurekaServerState { + return []EurekaServerState{ + EurekaServerStateCanceled, + EurekaServerStateFailed, + EurekaServerStateSucceeded, + EurekaServerStateUpdating, + } +} + +// GatewayCertificateVerification - Whether to enable certificate verification or not +type GatewayCertificateVerification string + +const ( + // GatewayCertificateVerificationDisabled - Disable certificate verification in Spring Cloud Gateway. + GatewayCertificateVerificationDisabled GatewayCertificateVerification = "Disabled" + // GatewayCertificateVerificationEnabled - Enable certificate verification in Spring Cloud Gateway. + GatewayCertificateVerificationEnabled GatewayCertificateVerification = "Enabled" +) + +// PossibleGatewayCertificateVerificationValues returns the possible values for the GatewayCertificateVerification const type. +func PossibleGatewayCertificateVerificationValues() []GatewayCertificateVerification { + return []GatewayCertificateVerification{ + GatewayCertificateVerificationDisabled, + GatewayCertificateVerificationEnabled, + } +} + // GatewayProvisioningState - State of the Spring Cloud Gateway. type GatewayProvisioningState string @@ -556,6 +694,22 @@ func PossibleGatewayRouteConfigProtocolValues() []GatewayRouteConfigProtocol { } } +// GitImplementation - Git libraries used to support various repository providers +type GitImplementation string + +const ( + GitImplementationGoGit GitImplementation = "go-git" + GitImplementationLibgit2 GitImplementation = "libgit2" +) + +// PossibleGitImplementationValues returns the possible values for the GitImplementation const type. +func PossibleGitImplementationValues() []GitImplementation { + return []GitImplementation{ + GitImplementationGoGit, + GitImplementationLibgit2, + } +} + // HTTPSchemeType - Scheme to use for connecting to the host. Defaults to HTTP. // Possible enum values: // * "HTTP" means that the scheme used will be http:// diff --git a/sdk/resourcemanager/appplatform/armappplatform/containerregistries_client.go b/sdk/resourcemanager/appplatform/armappplatform/containerregistries_client.go new file mode 100644 index 000000000000..733e602b10e6 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/containerregistries_client.go @@ -0,0 +1,401 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ContainerRegistriesClient contains the methods for the ContainerRegistries group. +// Don't use this type directly, use NewContainerRegistriesClient() instead. +type ContainerRegistriesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewContainerRegistriesClient creates a new instance of ContainerRegistriesClient with the specified values. +// - subscriptionID - Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewContainerRegistriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContainerRegistriesClient, error) { + cl, err := arm.NewClient(moduleName+".ContainerRegistriesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ContainerRegistriesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update container registry resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - containerRegistryName - The name of the container registry. +// - containerRegistryResource - Parameters for the create or update operation +// - options - ContainerRegistriesClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerRegistriesClient.BeginCreateOrUpdate +// method. +func (client *ContainerRegistriesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, containerRegistryResource ContainerRegistryResource, options *ContainerRegistriesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ContainerRegistriesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, containerRegistryName, containerRegistryResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerRegistriesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ContainerRegistriesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create or update container registry resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *ContainerRegistriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, containerRegistryResource ContainerRegistryResource, options *ContainerRegistriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, containerRegistryName, containerRegistryResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().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 *ContainerRegistriesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, containerRegistryResource ContainerRegistryResource, options *ContainerRegistriesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if containerRegistryName == "" { + return nil, errors.New("parameter containerRegistryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerRegistryName}", url.PathEscape(containerRegistryName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, containerRegistryResource) +} + +// BeginDelete - Delete a container registry resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - containerRegistryName - The name of the container registry. +// - options - ContainerRegistriesClientBeginDeleteOptions contains the optional parameters for the ContainerRegistriesClient.BeginDelete +// method. +func (client *ContainerRegistriesClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, options *ContainerRegistriesClientBeginDeleteOptions) (*runtime.Poller[ContainerRegistriesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, containerRegistryName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerRegistriesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ContainerRegistriesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a container registry resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *ContainerRegistriesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, options *ContainerRegistriesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, containerRegistryName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().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 *ContainerRegistriesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, options *ContainerRegistriesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if containerRegistryName == "" { + return nil, errors.New("parameter containerRegistryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerRegistryName}", url.PathEscape(containerRegistryName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the container registries resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - containerRegistryName - The name of the container registry. +// - options - ContainerRegistriesClientGetOptions contains the optional parameters for the ContainerRegistriesClient.Get method. +func (client *ContainerRegistriesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, options *ContainerRegistriesClientGetOptions) (ContainerRegistriesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, containerRegistryName, options) + if err != nil { + return ContainerRegistriesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ContainerRegistriesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ContainerRegistriesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ContainerRegistriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, options *ContainerRegistriesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if containerRegistryName == "" { + return nil, errors.New("parameter containerRegistryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerRegistryName}", url.PathEscape(containerRegistryName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-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 *ContainerRegistriesClient) getHandleResponse(resp *http.Response) (ContainerRegistriesClientGetResponse, error) { + result := ContainerRegistriesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ContainerRegistryResource); err != nil { + return ContainerRegistriesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List container registries resource. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - options - ContainerRegistriesClientListOptions contains the optional parameters for the ContainerRegistriesClient.NewListPager +// method. +func (client *ContainerRegistriesClient) NewListPager(resourceGroupName string, serviceName string, options *ContainerRegistriesClientListOptions) *runtime.Pager[ContainerRegistriesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ContainerRegistriesClientListResponse]{ + More: func(page ContainerRegistriesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ContainerRegistriesClientListResponse) (ContainerRegistriesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ContainerRegistriesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ContainerRegistriesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ContainerRegistriesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ContainerRegistriesClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ContainerRegistriesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-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 *ContainerRegistriesClient) listHandleResponse(resp *http.Response) (ContainerRegistriesClientListResponse, error) { + result := ContainerRegistriesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ContainerRegistryResourceCollection); err != nil { + return ContainerRegistriesClientListResponse{}, err + } + return result, nil +} + +// BeginValidate - Check if the container registry properties are valid. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - containerRegistryName - The name of the container registry. +// - containerRegistryProperties - Parameters for the validate operation +// - options - ContainerRegistriesClientBeginValidateOptions contains the optional parameters for the ContainerRegistriesClient.BeginValidate +// method. +func (client *ContainerRegistriesClient) BeginValidate(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, containerRegistryProperties ContainerRegistryProperties, options *ContainerRegistriesClientBeginValidateOptions) (*runtime.Poller[ContainerRegistriesClientValidateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.validate(ctx, resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerRegistriesClientValidateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ContainerRegistriesClientValidateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Validate - Check if the container registry properties are valid. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *ContainerRegistriesClient) validate(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, containerRegistryProperties ContainerRegistryProperties, options *ContainerRegistriesClientBeginValidateOptions) (*http.Response, error) { + req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// validateCreateRequest creates the Validate request. +func (client *ContainerRegistriesClient) validateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, containerRegistryProperties ContainerRegistryProperties, options *ContainerRegistriesClientBeginValidateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/containerRegistries/{containerRegistryName}/validate" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if containerRegistryName == "" { + return nil, errors.New("parameter containerRegistryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerRegistryName}", url.PathEscape(containerRegistryName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, containerRegistryProperties) +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go index b772e4d460c5..19e7692eaed5 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go @@ -48,7 +48,7 @@ func NewCustomDomainsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Create or update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -72,7 +72,7 @@ func (client *CustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Create or update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *CustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, domainName string, domainResource CustomDomainResource, options *CustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, domainResource, options) if err != nil { @@ -116,7 +116,7 @@ func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, domainResource) @@ -125,7 +125,7 @@ func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Delete the custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -148,7 +148,7 @@ func (client *CustomDomainsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Delete the custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *CustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, domainName string, options *CustomDomainsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, options) if err != nil { @@ -192,7 +192,7 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso // Get - Get the custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -251,7 +251,7 @@ func (client *CustomDomainsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *CustomDomainsClient) getHandleResponse(resp *http.Response) (Custo // NewListPager - List the custom domains of one lifecycle application. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -326,7 +326,7 @@ func (client *CustomDomainsClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -344,7 +344,7 @@ func (client *CustomDomainsClient) listHandleResponse(resp *http.Response) (Cust // BeginUpdate - Update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -368,7 +368,7 @@ func (client *CustomDomainsClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *CustomDomainsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, domainName string, domainResource CustomDomainResource, options *CustomDomainsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, domainResource, options) if err != nil { @@ -412,7 +412,7 @@ func (client *CustomDomainsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, domainResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/customdomains_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/customdomains_client_example_test.go deleted file mode 100644 index 8b3aaabdbf2b..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/customdomains_client_example_test.go +++ /dev/null @@ -1,220 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/CustomDomains_Get.json -func ExampleCustomDomainsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomDomainsClient().Get(ctx, "myResourceGroup", "myservice", "myapp", "mydomain.com", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomDomainResource = armappplatform.CustomDomainResource{ - // Name: to.Ptr("mydomain.com"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/domains"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/domains/mydomain.com"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.CustomDomainProperties{ - // AppName: to.Ptr("myapp"), - // CertName: to.Ptr("mycert"), - // ProvisioningState: to.Ptr(armappplatform.CustomDomainResourceProvisioningStateSucceeded), - // Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/CustomDomains_CreateOrUpdate.json -func ExampleCustomDomainsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomDomainsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydomain.com", armappplatform.CustomDomainResource{ - Properties: &armappplatform.CustomDomainProperties{ - CertName: to.Ptr("mycert"), - Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomDomainResource = armappplatform.CustomDomainResource{ - // Name: to.Ptr("mydomain.com"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/domains"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/domains/mydomain.com"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.CustomDomainProperties{ - // AppName: to.Ptr("myapp"), - // CertName: to.Ptr("mycert"), - // Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/CustomDomains_Delete.json -func ExampleCustomDomainsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomDomainsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "myapp", "mydomain.com", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/CustomDomains_Update.json -func ExampleCustomDomainsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomDomainsClient().BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydomain.com", armappplatform.CustomDomainResource{ - Properties: &armappplatform.CustomDomainProperties{ - CertName: to.Ptr("mycert"), - Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomDomainResource = armappplatform.CustomDomainResource{ - // Name: to.Ptr("mydomain.com"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/domains"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/domains/mydomain.com"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.CustomDomainProperties{ - // AppName: to.Ptr("myapp"), - // CertName: to.Ptr("mycert"), - // Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/CustomDomains_List.json -func ExampleCustomDomainsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomDomainsClient().NewListPager("myResourceGroup", "myservice", "myapp", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomDomainResourceCollection = armappplatform.CustomDomainResourceCollection{ - // Value: []*armappplatform.CustomDomainResource{ - // { - // Name: to.Ptr("mydomain.com"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/domains"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/domains/mydomain.com"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.CustomDomainProperties{ - // AppName: to.Ptr("myapp"), - // CertName: to.Ptr("mycert"), - // ProvisioningState: to.Ptr(armappplatform.CustomDomainResourceProvisioningStateSucceeded), - // Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client.go b/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client.go index 1a4ad8551f17..ed3df026c3a5 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client.go @@ -48,7 +48,7 @@ func NewCustomizedAcceleratorsClient(subscriptionID string, credential azcore.To // BeginCreateOrUpdate - Create or update the customized accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -72,7 +72,7 @@ func (client *CustomizedAcceleratorsClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Create or update the customized accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *CustomizedAcceleratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, customizedAcceleratorResource CustomizedAcceleratorResource, options *CustomizedAcceleratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, customizedAcceleratorResource, options) if err != nil { @@ -116,7 +116,7 @@ func (client *CustomizedAcceleratorsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, customizedAcceleratorResource) @@ -125,7 +125,7 @@ func (client *CustomizedAcceleratorsClient) createOrUpdateCreateRequest(ctx cont // BeginDelete - Delete the customized accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -148,7 +148,7 @@ func (client *CustomizedAcceleratorsClient) BeginDelete(ctx context.Context, res // Delete - Delete the customized accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *CustomizedAcceleratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, options *CustomizedAcceleratorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, options) if err != nil { @@ -192,7 +192,7 @@ func (client *CustomizedAcceleratorsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *CustomizedAcceleratorsClient) deleteCreateRequest(ctx context.Cont // Get - Get the customized accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -252,7 +252,7 @@ func (client *CustomizedAcceleratorsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *CustomizedAcceleratorsClient) getHandleResponse(resp *http.Respons // NewListPager - Handle requests to list all customized accelerators. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -328,7 +328,7 @@ func (client *CustomizedAcceleratorsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -346,7 +346,7 @@ func (client *CustomizedAcceleratorsClient) listHandleResponse(resp *http.Respon // Validate - Check the customized accelerator are valid. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -398,7 +398,7 @@ func (client *CustomizedAcceleratorsClient) validateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) diff --git a/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client_example_test.go deleted file mode 100644 index 2f528dbdfabd..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client_example_test.go +++ /dev/null @@ -1,294 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/CustomizedAccelerators_List.json -func ExampleCustomizedAcceleratorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomizedAcceleratorsClient().NewListPager("myResourceGroup", "myservice", "default", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomizedAcceleratorResourceCollection = armappplatform.CustomizedAcceleratorResourceCollection{ - // Value: []*armappplatform.CustomizedAcceleratorResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationAccelerators/customizedAccelerators"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationAccelerators/default/customizedAccelerators"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.CustomizedAcceleratorProperties{ - // Description: to.Ptr("acc-desc"), - // AcceleratorTags: []*string{ - // to.Ptr("tag-a"), - // to.Ptr("tag-b")}, - // DisplayName: to.Ptr("acc-name"), - // GitRepository: &armappplatform.AcceleratorGitRepository{ - // AuthSetting: &armappplatform.AcceleratorSSHSetting{ - // AuthType: to.Ptr("SSH"), - // }, - // Branch: to.Ptr("git-branch"), - // Commit: to.Ptr("12345"), - // GitTag: to.Ptr("git-tag"), - // IntervalInSeconds: to.Ptr[int32](70), - // URL: to.Ptr("git-url"), - // }, - // IconURL: to.Ptr("acc-icon"), - // ProvisioningState: to.Ptr(armappplatform.CustomizedAcceleratorProvisioningStateSucceeded), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/CustomizedAccelerators_Get.json -func ExampleCustomizedAcceleratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomizedAcceleratorsClient().Get(ctx, "myResourceGroup", "myservice", "default", "acc-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomizedAcceleratorResource = armappplatform.CustomizedAcceleratorResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationAccelerators/customizedAccelerators"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationAccelerators/default/customizedAccelerators/acc-name"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.CustomizedAcceleratorProperties{ - // Description: to.Ptr("acc-desc"), - // AcceleratorTags: []*string{ - // to.Ptr("tag-a"), - // to.Ptr("tag-b")}, - // DisplayName: to.Ptr("acc-name"), - // GitRepository: &armappplatform.AcceleratorGitRepository{ - // AuthSetting: &armappplatform.AcceleratorSSHSetting{ - // AuthType: to.Ptr("SSH"), - // }, - // Branch: to.Ptr("git-branch"), - // Commit: to.Ptr("12345"), - // GitTag: to.Ptr("git-tag"), - // IntervalInSeconds: to.Ptr[int32](70), - // URL: to.Ptr("git-url"), - // }, - // IconURL: to.Ptr("acc-icon"), - // ProvisioningState: to.Ptr(armappplatform.CustomizedAcceleratorProvisioningStateSucceeded), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/CustomizedAccelerators_CreateOrUpdate.json -func ExampleCustomizedAcceleratorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomizedAcceleratorsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", "acc-name", armappplatform.CustomizedAcceleratorResource{ - Properties: &armappplatform.CustomizedAcceleratorProperties{ - Description: to.Ptr("acc-desc"), - AcceleratorTags: []*string{ - to.Ptr("tag-a"), - to.Ptr("tag-b")}, - DisplayName: to.Ptr("acc-name"), - GitRepository: &armappplatform.AcceleratorGitRepository{ - AuthSetting: &armappplatform.AcceleratorSSHSetting{ - AuthType: to.Ptr("SSH"), - HostKey: to.Ptr("git-auth-hostkey"), - HostKeyAlgorithm: to.Ptr("git-auth-algorithm"), - PrivateKey: to.Ptr("git-auth-privatekey"), - }, - Branch: to.Ptr("git-branch"), - Commit: to.Ptr("12345"), - GitTag: to.Ptr("git-tag"), - IntervalInSeconds: to.Ptr[int32](70), - URL: to.Ptr("git-url"), - }, - IconURL: to.Ptr("acc-icon"), - }, - SKU: &armappplatform.SKU{ - Name: to.Ptr("E0"), - Capacity: to.Ptr[int32](2), - Tier: to.Ptr("Enterprise"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomizedAcceleratorResource = armappplatform.CustomizedAcceleratorResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationAccelerators/customizedAccelerators"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationAccelerators/default/customizedAccelerators/acc-name"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.CustomizedAcceleratorProperties{ - // Description: to.Ptr("acc-desc"), - // AcceleratorTags: []*string{ - // to.Ptr("tag-a"), - // to.Ptr("tag-b")}, - // DisplayName: to.Ptr("acc-name"), - // GitRepository: &armappplatform.AcceleratorGitRepository{ - // AuthSetting: &armappplatform.AcceleratorSSHSetting{ - // AuthType: to.Ptr("SSH"), - // }, - // Branch: to.Ptr("git-branch"), - // Commit: to.Ptr("12345"), - // GitTag: to.Ptr("git-tag"), - // IntervalInSeconds: to.Ptr[int32](70), - // URL: to.Ptr("git-url"), - // }, - // IconURL: to.Ptr("acc-icon"), - // ProvisioningState: to.Ptr(armappplatform.CustomizedAcceleratorProvisioningStateSucceeded), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/CustomizedAccelerators_Delete.json -func ExampleCustomizedAcceleratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCustomizedAcceleratorsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", "acc-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/CustomizedAccelerators_Validate.json -func ExampleCustomizedAcceleratorsClient_Validate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomizedAcceleratorsClient().Validate(ctx, "myResourceGroup", "myservice", "default", "acc-name", armappplatform.CustomizedAcceleratorProperties{ - Description: to.Ptr("acc-desc"), - AcceleratorTags: []*string{ - to.Ptr("tag-a"), - to.Ptr("tag-b")}, - DisplayName: to.Ptr("acc-name"), - GitRepository: &armappplatform.AcceleratorGitRepository{ - AuthSetting: &armappplatform.AcceleratorSSHSetting{ - AuthType: to.Ptr("SSH"), - HostKey: to.Ptr("git-auth-hostkey"), - HostKeyAlgorithm: to.Ptr("git-auth-algorithm"), - PrivateKey: to.Ptr("git-auth-privatekey"), - }, - Branch: to.Ptr("git-branch"), - Commit: to.Ptr("12345"), - GitTag: to.Ptr("git-tag"), - IntervalInSeconds: to.Ptr[int32](70), - URL: to.Ptr("git-url"), - }, - IconURL: to.Ptr("acc-icon"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomizedAcceleratorValidateResult = armappplatform.CustomizedAcceleratorValidateResult{ - // ErrorMessage: to.Ptr(""), - // State: to.Ptr(armappplatform.CustomizedAcceleratorValidateResultStateValid), - // } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/deployments_client.go b/sdk/resourcemanager/appplatform/armappplatform/deployments_client.go index 41a9d5ed042e..f68bb543fe60 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/deployments_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/deployments_client.go @@ -48,7 +48,7 @@ func NewDeploymentsClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Create a new Deployment or update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -72,7 +72,7 @@ func (client *DeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Create a new Deployment or update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DeploymentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, deploymentResource DeploymentResource, options *DeploymentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, deploymentResource, options) if err != nil { @@ -116,7 +116,7 @@ func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, deploymentResource) @@ -125,7 +125,7 @@ func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Operation to delete a Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -147,7 +147,7 @@ func (client *DeploymentsClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Operation to delete a Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DeploymentsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -191,7 +191,7 @@ func (client *DeploymentsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +200,7 @@ func (client *DeploymentsClient) deleteCreateRequest(ctx context.Context, resour // BeginDisableRemoteDebugging - Disable remote debugging. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -223,7 +223,7 @@ func (client *DeploymentsClient) BeginDisableRemoteDebugging(ctx context.Context // DisableRemoteDebugging - Disable remote debugging. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DeploymentsClient) disableRemoteDebugging(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginDisableRemoteDebuggingOptions) (*http.Response, error) { req, err := client.disableRemoteDebuggingCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -267,7 +267,7 @@ func (client *DeploymentsClient) disableRemoteDebuggingCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *DeploymentsClient) disableRemoteDebuggingCreateRequest(ctx context // BeginEnableRemoteDebugging - Enable remote debugging. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -299,7 +299,7 @@ func (client *DeploymentsClient) BeginEnableRemoteDebugging(ctx context.Context, // EnableRemoteDebugging - Enable remote debugging. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DeploymentsClient) enableRemoteDebugging(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginEnableRemoteDebuggingOptions) (*http.Response, error) { req, err := client.enableRemoteDebuggingCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -343,7 +343,7 @@ func (client *DeploymentsClient) enableRemoteDebuggingCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.RemoteDebuggingPayload != nil { @@ -355,7 +355,7 @@ func (client *DeploymentsClient) enableRemoteDebuggingCreateRequest(ctx context. // BeginGenerateHeapDump - Generate Heap Dump // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -379,7 +379,7 @@ func (client *DeploymentsClient) BeginGenerateHeapDump(ctx context.Context, reso // GenerateHeapDump - Generate Heap Dump // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DeploymentsClient) generateHeapDump(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, diagnosticParameters DiagnosticParameters, options *DeploymentsClientBeginGenerateHeapDumpOptions) (*http.Response, error) { req, err := client.generateHeapDumpCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, options) if err != nil { @@ -423,7 +423,7 @@ func (client *DeploymentsClient) generateHeapDumpCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, diagnosticParameters) @@ -432,7 +432,7 @@ func (client *DeploymentsClient) generateHeapDumpCreateRequest(ctx context.Conte // BeginGenerateThreadDump - Generate Thread Dump // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -456,7 +456,7 @@ func (client *DeploymentsClient) BeginGenerateThreadDump(ctx context.Context, re // GenerateThreadDump - Generate Thread Dump // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DeploymentsClient) generateThreadDump(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, diagnosticParameters DiagnosticParameters, options *DeploymentsClientBeginGenerateThreadDumpOptions) (*http.Response, error) { req, err := client.generateThreadDumpCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, options) if err != nil { @@ -500,7 +500,7 @@ func (client *DeploymentsClient) generateThreadDumpCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, diagnosticParameters) @@ -509,7 +509,7 @@ func (client *DeploymentsClient) generateThreadDumpCreateRequest(ctx context.Con // Get - Get a Deployment and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -559,7 +559,7 @@ func (client *DeploymentsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -577,7 +577,7 @@ func (client *DeploymentsClient) getHandleResponse(resp *http.Response) (Deploym // GetLogFileURL - Get deployment log file URL // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -628,7 +628,7 @@ func (client *DeploymentsClient) getLogFileURLCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -646,7 +646,7 @@ func (client *DeploymentsClient) getLogFileURLHandleResponse(resp *http.Response // GetRemoteDebuggingConfig - Get remote debugging config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -697,7 +697,7 @@ func (client *DeploymentsClient) getRemoteDebuggingConfigCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -714,7 +714,7 @@ func (client *DeploymentsClient) getRemoteDebuggingConfigHandleResponse(resp *ht // NewListPager - Handles requests to list all resources in an App. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -772,7 +772,7 @@ func (client *DeploymentsClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") if options != nil && options.Version != nil { for _, qv := range options.Version { reqQP.Add("version", qv) @@ -794,7 +794,7 @@ func (client *DeploymentsClient) listHandleResponse(resp *http.Response) (Deploy // NewListForClusterPager - List deployments for a certain service // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -848,7 +848,7 @@ func (client *DeploymentsClient) listForClusterCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") if options != nil && options.Version != nil { for _, qv := range options.Version { reqQP.Add("version", qv) @@ -871,7 +871,7 @@ func (client *DeploymentsClient) listForClusterHandleResponse(resp *http.Respons // BeginRestart - Restart the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -894,7 +894,7 @@ func (client *DeploymentsClient) BeginRestart(ctx context.Context, resourceGroup // Restart - Restart the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DeploymentsClient) restart(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginRestartOptions) (*http.Response, error) { req, err := client.restartCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -938,7 +938,7 @@ func (client *DeploymentsClient) restartCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -947,7 +947,7 @@ func (client *DeploymentsClient) restartCreateRequest(ctx context.Context, resou // BeginStart - Start the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -969,7 +969,7 @@ func (client *DeploymentsClient) BeginStart(ctx context.Context, resourceGroupNa // Start - Start the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DeploymentsClient) start(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -1013,7 +1013,7 @@ func (client *DeploymentsClient) startCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1022,7 +1022,7 @@ func (client *DeploymentsClient) startCreateRequest(ctx context.Context, resourc // BeginStartJFR - Start JFR // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -1046,7 +1046,7 @@ func (client *DeploymentsClient) BeginStartJFR(ctx context.Context, resourceGrou // StartJFR - Start JFR // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DeploymentsClient) startJFR(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, diagnosticParameters DiagnosticParameters, options *DeploymentsClientBeginStartJFROptions) (*http.Response, error) { req, err := client.startJFRCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, options) if err != nil { @@ -1090,7 +1090,7 @@ func (client *DeploymentsClient) startJFRCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, diagnosticParameters) @@ -1099,7 +1099,7 @@ func (client *DeploymentsClient) startJFRCreateRequest(ctx context.Context, reso // BeginStop - Stop the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -1121,7 +1121,7 @@ func (client *DeploymentsClient) BeginStop(ctx context.Context, resourceGroupNam // Stop - Stop the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DeploymentsClient) stop(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -1165,7 +1165,7 @@ func (client *DeploymentsClient) stopCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1174,7 +1174,7 @@ func (client *DeploymentsClient) stopCreateRequest(ctx context.Context, resource // BeginUpdate - Operation to update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -1197,7 +1197,7 @@ func (client *DeploymentsClient) BeginUpdate(ctx context.Context, resourceGroupN // Update - Operation to update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DeploymentsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, deploymentResource DeploymentResource, options *DeploymentsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, deploymentResource, options) if err != nil { @@ -1241,7 +1241,7 @@ func (client *DeploymentsClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, deploymentResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/deployments_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/deployments_client_example_test.go deleted file mode 100644 index b33f6931ded8..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/deployments_client_example_test.go +++ /dev/null @@ -1,1032 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_Get.json -func ExampleDeploymentsClient_Get_deploymentsGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeploymentsClient().Get(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeploymentResource = armappplatform.DeploymentResource{ - // Name: to.Ptr("mydeployment"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/deployments/mydeployment"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.DeploymentResourceProperties{ - // Active: to.Ptr(true), - // DeploymentSettings: &armappplatform.DeploymentSettings{ - // EnvironmentVariables: map[string]*string{ - // "env": to.Ptr("test"), - // }, - // ResourceRequests: &armappplatform.ResourceRequests{ - // CPU: to.Ptr("1000m"), - // Memory: to.Ptr("3Gi"), - // }, - // }, - // Instances: []*armappplatform.DeploymentInstance{ - // { - // Name: to.Ptr("instance1"), - // DiscoveryStatus: to.Ptr("pending"), - // StartTime: to.Ptr("2020-08-26T01:55:02Z"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.DeploymentResourceProvisioningStateSucceeded), - // Source: &armappplatform.SourceUploadedUserSourceInfo{ - // Type: to.Ptr("Source"), - // Version: to.Ptr("1.0"), - // RelativePath: to.Ptr("resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc"), - // ArtifactSelector: to.Ptr("sub-module-1"), - // }, - // Status: to.Ptr(armappplatform.DeploymentResourceStatusRunning), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Capacity: to.Ptr[int32](1), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_Get_CustomContainer.json -func ExampleDeploymentsClient_Get_deploymentsGetCustomContainer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeploymentsClient().Get(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeploymentResource = armappplatform.DeploymentResource{ - // Name: to.Ptr("mydeployment"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/deployments/mydeployment"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.DeploymentResourceProperties{ - // Active: to.Ptr(false), - // DeploymentSettings: &armappplatform.DeploymentSettings{ - // EnvironmentVariables: map[string]*string{ - // "env": to.Ptr("test"), - // }, - // ResourceRequests: &armappplatform.ResourceRequests{ - // CPU: to.Ptr("1000m"), - // Memory: to.Ptr("3Gi"), - // }, - // }, - // Instances: []*armappplatform.DeploymentInstance{ - // { - // Name: to.Ptr("instance1"), - // DiscoveryStatus: to.Ptr("N/A"), - // StartTime: to.Ptr("2020-08-26T01:55:02Z"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.DeploymentResourceProvisioningStateSucceeded), - // Source: &armappplatform.CustomContainerUserSourceInfo{ - // Type: to.Ptr("Container"), - // CustomContainer: &armappplatform.CustomContainer{ - // Args: []*string{ - // to.Ptr("-c"), - // to.Ptr("while true; do echo hello; sleep 10;done")}, - // Command: []*string{ - // to.Ptr("/bin/sh")}, - // ContainerImage: to.Ptr("myContainerImage:v1"), - // ImageRegistryCredential: &armappplatform.ImageRegistryCredential{ - // Password: to.Ptr(""), - // Username: to.Ptr("myUsername"), - // }, - // LanguageFramework: to.Ptr("springboot"), - // Server: to.Ptr("myacr.azurecr.io"), - // }, - // }, - // Status: to.Ptr(armappplatform.DeploymentResourceStatusRunning), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Capacity: to.Ptr[int32](1), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_CreateOrUpdate.json -func ExampleDeploymentsClient_BeginCreateOrUpdate_deploymentsCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", armappplatform.DeploymentResource{ - Properties: &armappplatform.DeploymentResourceProperties{ - DeploymentSettings: &armappplatform.DeploymentSettings{ - AddonConfigs: map[string]any{ - "ApplicationConfigurationService": map[string]any{ - "patterns": []any{ - "mypattern", - }, - }, - }, - EnvironmentVariables: map[string]*string{ - "env": to.Ptr("test"), - }, - LivenessProbe: &armappplatform.Probe{ - DisableProbe: to.Ptr(false), - FailureThreshold: to.Ptr[int32](3), - InitialDelaySeconds: to.Ptr[int32](30), - PeriodSeconds: to.Ptr[int32](10), - ProbeAction: &armappplatform.HTTPGetAction{ - Type: to.Ptr(armappplatform.ProbeActionTypeHTTPGetAction), - Path: to.Ptr("/health"), - Scheme: to.Ptr(armappplatform.HTTPSchemeTypeHTTP), - }, - }, - ReadinessProbe: &armappplatform.Probe{ - DisableProbe: to.Ptr(false), - FailureThreshold: to.Ptr[int32](3), - InitialDelaySeconds: to.Ptr[int32](30), - PeriodSeconds: to.Ptr[int32](10), - ProbeAction: &armappplatform.HTTPGetAction{ - Type: to.Ptr(armappplatform.ProbeActionTypeHTTPGetAction), - Path: to.Ptr("/health"), - Scheme: to.Ptr(armappplatform.HTTPSchemeTypeHTTP), - }, - }, - ResourceRequests: &armappplatform.ResourceRequests{ - CPU: to.Ptr("1000m"), - Memory: to.Ptr("3Gi"), - }, - TerminationGracePeriodSeconds: to.Ptr[int32](30), - }, - Source: &armappplatform.SourceUploadedUserSourceInfo{ - Type: to.Ptr("Source"), - Version: to.Ptr("1.0"), - RelativePath: to.Ptr("resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc"), - ArtifactSelector: to.Ptr("sub-module-1"), - }, - }, - SKU: &armappplatform.SKU{ - Name: to.Ptr("S0"), - Capacity: to.Ptr[int32](1), - Tier: to.Ptr("Standard"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeploymentResource = armappplatform.DeploymentResource{ - // Name: to.Ptr("mydeployment"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/deployments/mydeployment"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.DeploymentResourceProperties{ - // Active: to.Ptr(false), - // DeploymentSettings: &armappplatform.DeploymentSettings{ - // EnvironmentVariables: map[string]*string{ - // "env": to.Ptr("test"), - // }, - // LivenessProbe: &armappplatform.Probe{ - // DisableProbe: to.Ptr(false), - // FailureThreshold: to.Ptr[int32](3), - // InitialDelaySeconds: to.Ptr[int32](30), - // PeriodSeconds: to.Ptr[int32](10), - // ProbeAction: &armappplatform.HTTPGetAction{ - // Type: to.Ptr(armappplatform.ProbeActionTypeHTTPGetAction), - // Path: to.Ptr("/health"), - // Scheme: to.Ptr(armappplatform.HTTPSchemeTypeHTTP), - // }, - // }, - // ReadinessProbe: &armappplatform.Probe{ - // DisableProbe: to.Ptr(false), - // FailureThreshold: to.Ptr[int32](3), - // InitialDelaySeconds: to.Ptr[int32](30), - // PeriodSeconds: to.Ptr[int32](10), - // ProbeAction: &armappplatform.HTTPGetAction{ - // Type: to.Ptr(armappplatform.ProbeActionTypeHTTPGetAction), - // Path: to.Ptr("/health"), - // Scheme: to.Ptr(armappplatform.HTTPSchemeTypeHTTP), - // }, - // }, - // ResourceRequests: &armappplatform.ResourceRequests{ - // CPU: to.Ptr("1000m"), - // Memory: to.Ptr("3Gi"), - // }, - // TerminationGracePeriodSeconds: to.Ptr[int32](30), - // }, - // Instances: []*armappplatform.DeploymentInstance{ - // { - // Name: to.Ptr("instance1"), - // DiscoveryStatus: to.Ptr("pending"), - // StartTime: to.Ptr("2020-08-26T01:55:02Z"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.DeploymentResourceProvisioningStateSucceeded), - // Source: &armappplatform.SourceUploadedUserSourceInfo{ - // Type: to.Ptr("Source"), - // Version: to.Ptr("1.0"), - // RelativePath: to.Ptr("resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc"), - // ArtifactSelector: to.Ptr("sub-module-1"), - // }, - // Status: to.Ptr(armappplatform.DeploymentResourceStatusRunning), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Capacity: to.Ptr[int32](1), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_CreateOrUpdate_CustomContainer.json -func ExampleDeploymentsClient_BeginCreateOrUpdate_deploymentsCreateOrUpdateCustomContainer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", armappplatform.DeploymentResource{ - Properties: &armappplatform.DeploymentResourceProperties{ - DeploymentSettings: &armappplatform.DeploymentSettings{ - EnvironmentVariables: map[string]*string{ - "env": to.Ptr("test"), - }, - LivenessProbe: &armappplatform.Probe{ - DisableProbe: to.Ptr(false), - FailureThreshold: to.Ptr[int32](3), - InitialDelaySeconds: to.Ptr[int32](30), - PeriodSeconds: to.Ptr[int32](10), - ProbeAction: &armappplatform.HTTPGetAction{ - Type: to.Ptr(armappplatform.ProbeActionTypeHTTPGetAction), - Path: to.Ptr("/health"), - Scheme: to.Ptr(armappplatform.HTTPSchemeTypeHTTP), - }, - }, - ReadinessProbe: &armappplatform.Probe{ - DisableProbe: to.Ptr(false), - FailureThreshold: to.Ptr[int32](3), - InitialDelaySeconds: to.Ptr[int32](30), - PeriodSeconds: to.Ptr[int32](10), - ProbeAction: &armappplatform.HTTPGetAction{ - Type: to.Ptr(armappplatform.ProbeActionTypeHTTPGetAction), - Path: to.Ptr("/health"), - Scheme: to.Ptr(armappplatform.HTTPSchemeTypeHTTP), - }, - }, - ResourceRequests: &armappplatform.ResourceRequests{ - CPU: to.Ptr("1000m"), - Memory: to.Ptr("3Gi"), - }, - TerminationGracePeriodSeconds: to.Ptr[int32](30), - }, - Source: &armappplatform.CustomContainerUserSourceInfo{ - Type: to.Ptr("Container"), - CustomContainer: &armappplatform.CustomContainer{ - Args: []*string{ - to.Ptr("-c"), - to.Ptr("while true; do echo hello; sleep 10;done")}, - Command: []*string{ - to.Ptr("/bin/sh")}, - ContainerImage: to.Ptr("myContainerImage:v1"), - ImageRegistryCredential: &armappplatform.ImageRegistryCredential{ - Password: to.Ptr("myPassword"), - Username: to.Ptr("myUsername"), - }, - LanguageFramework: to.Ptr("springboot"), - Server: to.Ptr("myacr.azurecr.io"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeploymentResource = armappplatform.DeploymentResource{ - // Name: to.Ptr("mydeployment"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/deployments/mydeployment"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.DeploymentResourceProperties{ - // Active: to.Ptr(false), - // DeploymentSettings: &armappplatform.DeploymentSettings{ - // EnvironmentVariables: map[string]*string{ - // "env": to.Ptr("test"), - // }, - // LivenessProbe: &armappplatform.Probe{ - // DisableProbe: to.Ptr(false), - // FailureThreshold: to.Ptr[int32](3), - // InitialDelaySeconds: to.Ptr[int32](30), - // PeriodSeconds: to.Ptr[int32](10), - // ProbeAction: &armappplatform.HTTPGetAction{ - // Type: to.Ptr(armappplatform.ProbeActionTypeHTTPGetAction), - // Path: to.Ptr("/health"), - // Scheme: to.Ptr(armappplatform.HTTPSchemeTypeHTTP), - // }, - // }, - // ReadinessProbe: &armappplatform.Probe{ - // DisableProbe: to.Ptr(false), - // FailureThreshold: to.Ptr[int32](3), - // InitialDelaySeconds: to.Ptr[int32](30), - // PeriodSeconds: to.Ptr[int32](10), - // ProbeAction: &armappplatform.HTTPGetAction{ - // Type: to.Ptr(armappplatform.ProbeActionTypeHTTPGetAction), - // Path: to.Ptr("/health"), - // Scheme: to.Ptr(armappplatform.HTTPSchemeTypeHTTP), - // }, - // }, - // ResourceRequests: &armappplatform.ResourceRequests{ - // CPU: to.Ptr("1000m"), - // Memory: to.Ptr("3Gi"), - // }, - // TerminationGracePeriodSeconds: to.Ptr[int32](30), - // }, - // Instances: []*armappplatform.DeploymentInstance{ - // { - // Name: to.Ptr("instance1"), - // DiscoveryStatus: to.Ptr("N/A"), - // StartTime: to.Ptr("2020-08-26T01:55:02Z"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.DeploymentResourceProvisioningStateSucceeded), - // Source: &armappplatform.CustomContainerUserSourceInfo{ - // Type: to.Ptr("Container"), - // CustomContainer: &armappplatform.CustomContainer{ - // ContainerImage: to.Ptr("myContainerImage:v1"), - // ImageRegistryCredential: &armappplatform.ImageRegistryCredential{ - // Password: to.Ptr(""), - // Username: to.Ptr("myUsername"), - // }, - // LanguageFramework: to.Ptr("springboot"), - // Server: to.Ptr("myacr.azurecr.io"), - // }, - // }, - // Status: to.Ptr(armappplatform.DeploymentResourceStatusRunning), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Capacity: to.Ptr[int32](1), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_Delete.json -func ExampleDeploymentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_Update.json -func ExampleDeploymentsClient_BeginUpdate_deploymentsUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", armappplatform.DeploymentResource{ - Properties: &armappplatform.DeploymentResourceProperties{ - Source: &armappplatform.SourceUploadedUserSourceInfo{ - Type: to.Ptr("Source"), - Version: to.Ptr("1.0"), - RelativePath: to.Ptr("resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc"), - ArtifactSelector: to.Ptr("sub-module-1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeploymentResource = armappplatform.DeploymentResource{ - // Name: to.Ptr("mydeployment"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/deployments/mydeployment"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.DeploymentResourceProperties{ - // Active: to.Ptr(true), - // DeploymentSettings: &armappplatform.DeploymentSettings{ - // EnvironmentVariables: map[string]*string{ - // "env": to.Ptr("test"), - // }, - // ResourceRequests: &armappplatform.ResourceRequests{ - // CPU: to.Ptr("1000m"), - // Memory: to.Ptr("3Gi"), - // }, - // }, - // Instances: []*armappplatform.DeploymentInstance{ - // { - // Name: to.Ptr("instance1"), - // DiscoveryStatus: to.Ptr("pending"), - // StartTime: to.Ptr("2020-08-26T01:55:02Z"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.DeploymentResourceProvisioningStateSucceeded), - // Source: &armappplatform.SourceUploadedUserSourceInfo{ - // Type: to.Ptr("Source"), - // Version: to.Ptr("1.0"), - // RelativePath: to.Ptr("resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc"), - // ArtifactSelector: to.Ptr("sub-module-1"), - // }, - // Status: to.Ptr(armappplatform.DeploymentResourceStatusRunning), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Capacity: to.Ptr[int32](1), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_Update_CustomContainer.json -func ExampleDeploymentsClient_BeginUpdate_deploymentsUpdateCustomContainer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", armappplatform.DeploymentResource{ - Properties: &armappplatform.DeploymentResourceProperties{ - Source: &armappplatform.CustomContainerUserSourceInfo{ - Type: to.Ptr("Container"), - CustomContainer: &armappplatform.CustomContainer{ - Args: []*string{ - to.Ptr("-c"), - to.Ptr("while true; do echo hello; sleep 10;done")}, - Command: []*string{ - to.Ptr("/bin/sh")}, - ContainerImage: to.Ptr("myNewContainerImage:v1"), - ImageRegistryCredential: &armappplatform.ImageRegistryCredential{ - Password: to.Ptr(""), - Username: to.Ptr("myNewUsername"), - }, - Server: to.Ptr("mynewacr.azurecr.io"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeploymentResource = armappplatform.DeploymentResource{ - // Name: to.Ptr("mydeployment"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/deployments/mydeployment"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.DeploymentResourceProperties{ - // Active: to.Ptr(false), - // DeploymentSettings: &armappplatform.DeploymentSettings{ - // EnvironmentVariables: map[string]*string{ - // "env": to.Ptr("test"), - // }, - // ResourceRequests: &armappplatform.ResourceRequests{ - // CPU: to.Ptr("1000m"), - // Memory: to.Ptr("3Gi"), - // }, - // }, - // Instances: []*armappplatform.DeploymentInstance{ - // { - // Name: to.Ptr("instance1"), - // DiscoveryStatus: to.Ptr("N/A"), - // StartTime: to.Ptr("2020-08-26T01:55:02Z"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.DeploymentResourceProvisioningStateSucceeded), - // Source: &armappplatform.CustomContainerUserSourceInfo{ - // Type: to.Ptr("Container"), - // CustomContainer: &armappplatform.CustomContainer{ - // ContainerImage: to.Ptr("myNewContainerImage:v1"), - // ImageRegistryCredential: &armappplatform.ImageRegistryCredential{ - // Password: to.Ptr(""), - // Username: to.Ptr("myNewUsername"), - // }, - // Server: to.Ptr("mynewacr.azurecr.io"), - // }, - // }, - // Status: to.Ptr(armappplatform.DeploymentResourceStatusRunning), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Capacity: to.Ptr[int32](1), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_List.json -func ExampleDeploymentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeploymentsClient().NewListPager("myResourceGroup", "myservice", "myapp", &armappplatform.DeploymentsClientListOptions{Version: []string{}}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeploymentResourceCollection = armappplatform.DeploymentResourceCollection{ - // Value: []*armappplatform.DeploymentResource{ - // { - // Name: to.Ptr("mydeployment"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/deployments/mydeployment"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.DeploymentResourceProperties{ - // Active: to.Ptr(true), - // DeploymentSettings: &armappplatform.DeploymentSettings{ - // EnvironmentVariables: map[string]*string{ - // "env": to.Ptr("test"), - // }, - // ResourceRequests: &armappplatform.ResourceRequests{ - // CPU: to.Ptr("1000m"), - // Memory: to.Ptr("3Gi"), - // }, - // }, - // Instances: []*armappplatform.DeploymentInstance{ - // { - // Name: to.Ptr("instance1"), - // DiscoveryStatus: to.Ptr("pending"), - // StartTime: to.Ptr("2020-08-26T01:55:02Z"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.DeploymentResourceProvisioningStateSucceeded), - // Source: &armappplatform.SourceUploadedUserSourceInfo{ - // Type: to.Ptr("Source"), - // Version: to.Ptr("1.0"), - // RelativePath: to.Ptr("resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc"), - // ArtifactSelector: to.Ptr("sub-module-1"), - // }, - // Status: to.Ptr(armappplatform.DeploymentResourceStatusRunning), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Capacity: to.Ptr[int32](1), - // Tier: to.Ptr("Standard"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_ListForCluster.json -func ExampleDeploymentsClient_NewListForClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeploymentsClient().NewListForClusterPager("myResourceGroup", "myservice", &armappplatform.DeploymentsClientListForClusterOptions{Version: []string{}}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeploymentResourceCollection = armappplatform.DeploymentResourceCollection{ - // Value: []*armappplatform.DeploymentResource{ - // { - // Name: to.Ptr("mydeployment"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/apps/deployments"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myapp/deployments/mydeployment"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.DeploymentResourceProperties{ - // Active: to.Ptr(true), - // DeploymentSettings: &armappplatform.DeploymentSettings{ - // EnvironmentVariables: map[string]*string{ - // "env": to.Ptr("test"), - // }, - // ResourceRequests: &armappplatform.ResourceRequests{ - // CPU: to.Ptr("1000m"), - // Memory: to.Ptr("3Gi"), - // }, - // }, - // Instances: []*armappplatform.DeploymentInstance{ - // { - // Name: to.Ptr("instance1"), - // DiscoveryStatus: to.Ptr("pending"), - // StartTime: to.Ptr("2020-08-26T01:55:02Z"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.DeploymentResourceProvisioningStateSucceeded), - // Source: &armappplatform.SourceUploadedUserSourceInfo{ - // Type: to.Ptr("Source"), - // Version: to.Ptr("1.0"), - // RelativePath: to.Ptr("resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc"), - // ArtifactSelector: to.Ptr("sub-module-1"), - // }, - // Status: to.Ptr(armappplatform.DeploymentResourceStatusRunning), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Capacity: to.Ptr[int32](1), - // Tier: to.Ptr("Standard"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_Start.json -func ExampleDeploymentsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginStart(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_Stop.json -func ExampleDeploymentsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginStop(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_Restart.json -func ExampleDeploymentsClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginRestart(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_EnableRemoteDebugging.json -func ExampleDeploymentsClient_BeginEnableRemoteDebugging() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginEnableRemoteDebugging(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", &armappplatform.DeploymentsClientBeginEnableRemoteDebuggingOptions{RemoteDebuggingPayload: &armappplatform.RemoteDebuggingPayload{}}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RemoteDebugging = armappplatform.RemoteDebugging{ - // Enabled: to.Ptr(true), - // Port: to.Ptr[int32](5005), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_DisableRemoteDebugging.json -func ExampleDeploymentsClient_BeginDisableRemoteDebugging() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginDisableRemoteDebugging(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RemoteDebugging = armappplatform.RemoteDebugging{ - // Enabled: to.Ptr(false), - // Port: to.Ptr[int32](5005), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_GetRemoteDebuggingConfig.json -func ExampleDeploymentsClient_GetRemoteDebuggingConfig() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeploymentsClient().GetRemoteDebuggingConfig(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RemoteDebugging = armappplatform.RemoteDebugging{ - // Enabled: to.Ptr(true), - // Port: to.Ptr[int32](5005), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_GetLogFileUrl.json -func ExampleDeploymentsClient_GetLogFileURL() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeploymentsClient().GetLogFileURL(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogFileURLResponse = armappplatform.LogFileURLResponse{ - // URL: to.Ptr("https://spring.blob.core.windows.net/logs/110ec0c337154d45b1f01daf2196c0bf/b58b0cb4ecdea3c65311b4ca8833fe47b6ae0a7500f87a8eb31e8379d3fe48f1-2019081312-42b7b90c-f108-4c09-b33d-1ea134f57f23?sv=2018-03-28&sr=b&sig=example-signature&se=2019-08-14T09%3A43%3A52Z&sp=r"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_GenerateHeapDump.json -func ExampleDeploymentsClient_BeginGenerateHeapDump() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginGenerateHeapDump(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", armappplatform.DiagnosticParameters{ - AppInstance: to.Ptr("myappinstance"), - FilePath: to.Ptr("/byos/diagnose"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_GenerateThreadDump.json -func ExampleDeploymentsClient_BeginGenerateThreadDump() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginGenerateThreadDump(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", armappplatform.DiagnosticParameters{ - AppInstance: to.Ptr("myappinstance"), - FilePath: to.Ptr("/byos/diagnose"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Deployments_StartJFR.json -func ExampleDeploymentsClient_BeginStartJFR() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDeploymentsClient().BeginStartJFR(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", armappplatform.DiagnosticParameters{ - AppInstance: to.Ptr("myappinstance"), - Duration: to.Ptr("60s"), - FilePath: to.Ptr("/byos/diagnose"), - }, 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/appplatform/armappplatform/devtoolportals_client.go b/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client.go index 023a0373639e..cbc90f4d77fc 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client.go @@ -48,7 +48,7 @@ func NewDevToolPortalsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Create the default Dev Tool Portal or update the existing Dev Tool Portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -71,7 +71,7 @@ func (client *DevToolPortalsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Create the default Dev Tool Portal or update the existing Dev Tool Portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DevToolPortalsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, devToolPortalResource DevToolPortalResource, options *DevToolPortalsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, devToolPortalName, devToolPortalResource, options) if err != nil { @@ -111,7 +111,7 @@ func (client *DevToolPortalsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, devToolPortalResource) @@ -120,7 +120,7 @@ func (client *DevToolPortalsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Disable the default Dev Tool Portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -142,7 +142,7 @@ func (client *DevToolPortalsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Disable the default Dev Tool Portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *DevToolPortalsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, options *DevToolPortalsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, devToolPortalName, options) if err != nil { @@ -182,7 +182,7 @@ func (client *DevToolPortalsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *DevToolPortalsClient) deleteCreateRequest(ctx context.Context, res // Get - Get the Application Live and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -236,7 +236,7 @@ func (client *DevToolPortalsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +253,7 @@ func (client *DevToolPortalsClient) getHandleResponse(resp *http.Response) (DevT // NewListPager - Handles requests to list all resources in a Service. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -306,7 +306,7 @@ func (client *DevToolPortalsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client_example_test.go deleted file mode 100644 index 7b603d898bcc..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client_example_test.go +++ /dev/null @@ -1,263 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/DevToolPortals_List.json -func ExampleDevToolPortalsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDevToolPortalsClient().NewListPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DevToolPortalResourceCollection = armappplatform.DevToolPortalResourceCollection{ - // Value: []*armappplatform.DevToolPortalResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationLiveViews"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationLiveViews/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.DevToolPortalProperties{ - // Features: &armappplatform.DevToolPortalFeatureSettings{ - // ApplicationAccelerator: &armappplatform.DevToolPortalFeatureDetail{ - // Route: to.Ptr("create"), - // State: to.Ptr(armappplatform.DevToolPortalFeatureStateEnabled), - // }, - // ApplicationLiveView: &armappplatform.DevToolPortalFeatureDetail{ - // Route: to.Ptr("appliveview"), - // State: to.Ptr(armappplatform.DevToolPortalFeatureStateEnabled), - // }, - // }, - // Instances: []*armappplatform.DevToolPortalInstance{ - // { - // Name: to.Ptr("app-live-view-server-name"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.DevToolPortalProvisioningStateSucceeded), - // Public: to.Ptr(true), - // ResourceRequests: &armappplatform.DevToolPortalResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](1), - // Memory: to.Ptr("1Gi"), - // }, - // SsoProperties: &armappplatform.DevToolPortalSsoProperties{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // MetadataURL: to.Ptr("https://login.microsoft.com/00000000-0000-0000-0000-000000000000/v2.0/.well-known/openid-configuration"), - // Scopes: []*string{ - // to.Ptr("openid")}, - // }, - // URL: to.Ptr("aaa.com"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/DevToolPortals_Get.json -func ExampleDevToolPortalsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDevToolPortalsClient().Get(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DevToolPortalResource = armappplatform.DevToolPortalResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationLiveViews"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationLiveViews/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.DevToolPortalProperties{ - // Features: &armappplatform.DevToolPortalFeatureSettings{ - // ApplicationAccelerator: &armappplatform.DevToolPortalFeatureDetail{ - // Route: to.Ptr("create"), - // State: to.Ptr(armappplatform.DevToolPortalFeatureStateEnabled), - // }, - // ApplicationLiveView: &armappplatform.DevToolPortalFeatureDetail{ - // Route: to.Ptr("appliveview"), - // State: to.Ptr(armappplatform.DevToolPortalFeatureStateEnabled), - // }, - // }, - // Instances: []*armappplatform.DevToolPortalInstance{ - // { - // Name: to.Ptr("app-live-view-server-name"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.DevToolPortalProvisioningStateSucceeded), - // Public: to.Ptr(true), - // ResourceRequests: &armappplatform.DevToolPortalResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](1), - // Memory: to.Ptr("1Gi"), - // }, - // SsoProperties: &armappplatform.DevToolPortalSsoProperties{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // MetadataURL: to.Ptr("https://login.microsoft.com/00000000-0000-0000-0000-000000000000/v2.0/.well-known/openid-configuration"), - // Scopes: []*string{ - // to.Ptr("openid")}, - // }, - // URL: to.Ptr("aaa.com"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/DevToolPortals_CreateOrUpdate.json -func ExampleDevToolPortalsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevToolPortalsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", armappplatform.DevToolPortalResource{ - Properties: &armappplatform.DevToolPortalProperties{ - Features: &armappplatform.DevToolPortalFeatureSettings{ - ApplicationAccelerator: &armappplatform.DevToolPortalFeatureDetail{ - State: to.Ptr(armappplatform.DevToolPortalFeatureStateEnabled), - }, - ApplicationLiveView: &armappplatform.DevToolPortalFeatureDetail{ - State: to.Ptr(armappplatform.DevToolPortalFeatureStateEnabled), - }, - }, - Public: to.Ptr(true), - SsoProperties: &armappplatform.DevToolPortalSsoProperties{ - ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - ClientSecret: to.Ptr("xxxxx"), - MetadataURL: to.Ptr("https://login.microsoft.com/00000000-0000-0000-0000-000000000000/v2.0/.well-known/openid-configuration"), - Scopes: []*string{ - to.Ptr("openid")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DevToolPortalResource = armappplatform.DevToolPortalResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationLiveViews"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationLiveViews/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.DevToolPortalProperties{ - // Features: &armappplatform.DevToolPortalFeatureSettings{ - // ApplicationAccelerator: &armappplatform.DevToolPortalFeatureDetail{ - // Route: to.Ptr("create"), - // State: to.Ptr(armappplatform.DevToolPortalFeatureStateEnabled), - // }, - // ApplicationLiveView: &armappplatform.DevToolPortalFeatureDetail{ - // Route: to.Ptr("appliveview"), - // State: to.Ptr(armappplatform.DevToolPortalFeatureStateEnabled), - // }, - // }, - // Instances: []*armappplatform.DevToolPortalInstance{ - // { - // Name: to.Ptr("app-live-view-server-name"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.DevToolPortalProvisioningStateSucceeded), - // Public: to.Ptr(true), - // ResourceRequests: &armappplatform.DevToolPortalResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](1), - // Memory: to.Ptr("1Gi"), - // }, - // SsoProperties: &armappplatform.DevToolPortalSsoProperties{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // MetadataURL: to.Ptr("https://login.microsoft.com/00000000-0000-0000-0000-000000000000/v2.0/.well-known/openid-configuration"), - // Scopes: []*string{ - // to.Ptr("openid")}, - // }, - // URL: to.Ptr("aaa.com"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/DevToolPortal_Delete.json -func ExampleDevToolPortalsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevToolPortalsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", 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/appplatform/armappplatform/eurekaservers_client.go b/sdk/resourcemanager/appplatform/armappplatform/eurekaservers_client.go new file mode 100644 index 000000000000..07d37c096048 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/eurekaservers_client.go @@ -0,0 +1,300 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// EurekaServersClient contains the methods for the EurekaServers group. +// Don't use this type directly, use NewEurekaServersClient() instead. +type EurekaServersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewEurekaServersClient creates a new instance of EurekaServersClient with the specified values. +// - subscriptionID - Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewEurekaServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EurekaServersClient, error) { + cl, err := arm.NewClient(moduleName+".EurekaServersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &EurekaServersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Get the eureka server settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - options - EurekaServersClientGetOptions contains the optional parameters for the EurekaServersClient.Get method. +func (client *EurekaServersClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *EurekaServersClientGetOptions) (EurekaServersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return EurekaServersClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return EurekaServersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EurekaServersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *EurekaServersClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *EurekaServersClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-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 *EurekaServersClient) getHandleResponse(resp *http.Response) (EurekaServersClientGetResponse, error) { + result := EurekaServersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EurekaServerResource); err != nil { + return EurekaServersClientGetResponse{}, err + } + return result, nil +} + +// List - List the eureka server settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - options - EurekaServersClientListOptions contains the optional parameters for the EurekaServersClient.List method. +func (client *EurekaServersClient) List(ctx context.Context, resourceGroupName string, serviceName string, options *EurekaServersClientListOptions) (EurekaServersClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return EurekaServersClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return EurekaServersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EurekaServersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *EurekaServersClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *EurekaServersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-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 *EurekaServersClient) listHandleResponse(resp *http.Response) (EurekaServersClientListResponse, error) { + result := EurekaServersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EurekaServerResourceCollection); err != nil { + return EurekaServersClientListResponse{}, err + } + return result, nil +} + +// BeginUpdatePatch - Update the eureka server settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - eurekaServerResource - Parameters for the update operation +// - options - EurekaServersClientBeginUpdatePatchOptions contains the optional parameters for the EurekaServersClient.BeginUpdatePatch +// method. +func (client *EurekaServersClient) BeginUpdatePatch(ctx context.Context, resourceGroupName string, serviceName string, eurekaServerResource EurekaServerResource, options *EurekaServersClientBeginUpdatePatchOptions) (*runtime.Poller[EurekaServersClientUpdatePatchResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updatePatch(ctx, resourceGroupName, serviceName, eurekaServerResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[EurekaServersClientUpdatePatchResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[EurekaServersClientUpdatePatchResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdatePatch - Update the eureka server settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *EurekaServersClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, eurekaServerResource EurekaServerResource, options *EurekaServersClientBeginUpdatePatchOptions) (*http.Response, error) { + req, err := client.updatePatchCreateRequest(ctx, resourceGroupName, serviceName, eurekaServerResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updatePatchCreateRequest creates the UpdatePatch request. +func (client *EurekaServersClient) updatePatchCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, eurekaServerResource EurekaServerResource, options *EurekaServersClientBeginUpdatePatchOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eurekaServerResource) +} + +// BeginUpdatePut - Update the eureka server settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - eurekaServerResource - Parameters for the update operation +// - options - EurekaServersClientBeginUpdatePutOptions contains the optional parameters for the EurekaServersClient.BeginUpdatePut +// method. +func (client *EurekaServersClient) BeginUpdatePut(ctx context.Context, resourceGroupName string, serviceName string, eurekaServerResource EurekaServerResource, options *EurekaServersClientBeginUpdatePutOptions) (*runtime.Poller[EurekaServersClientUpdatePutResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updatePut(ctx, resourceGroupName, serviceName, eurekaServerResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[EurekaServersClientUpdatePutResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[EurekaServersClientUpdatePutResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdatePut - Update the eureka server settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *EurekaServersClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, eurekaServerResource EurekaServerResource, options *EurekaServersClientBeginUpdatePutOptions) (*http.Response, error) { + req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, eurekaServerResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updatePutCreateRequest creates the UpdatePut request. +func (client *EurekaServersClient) updatePutCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, eurekaServerResource EurekaServerResource, options *EurekaServersClientBeginUpdatePutOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/eurekaServers/default" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eurekaServerResource) +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go index 9acf6bfbaa10..d3c19eb3d9c7 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go @@ -48,7 +48,7 @@ func NewGatewayCustomDomainsClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Create or update the Spring Cloud Gateway custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -72,7 +72,7 @@ func (client *GatewayCustomDomainsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Create or update the Spring Cloud Gateway custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *GatewayCustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, gatewayCustomDomainResource GatewayCustomDomainResource, options *GatewayCustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource, options) if err != nil { @@ -116,7 +116,7 @@ func (client *GatewayCustomDomainsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, gatewayCustomDomainResource) @@ -125,7 +125,7 @@ func (client *GatewayCustomDomainsClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Delete the Spring Cloud Gateway custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -148,7 +148,7 @@ func (client *GatewayCustomDomainsClient) BeginDelete(ctx context.Context, resou // Delete - Delete the Spring Cloud Gateway custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *GatewayCustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, domainName, options) if err != nil { @@ -192,7 +192,7 @@ func (client *GatewayCustomDomainsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *GatewayCustomDomainsClient) deleteCreateRequest(ctx context.Contex // Get - Get the Spring Cloud Gateway custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -252,7 +252,7 @@ func (client *GatewayCustomDomainsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *GatewayCustomDomainsClient) getHandleResponse(resp *http.Response) // NewListPager - Handle requests to list all Spring Cloud Gateway custom domains. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -328,7 +328,7 @@ func (client *GatewayCustomDomainsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client_example_test.go deleted file mode 100644 index de37593b139c..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client_example_test.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/GatewayCustomDomains_Get.json -func ExampleGatewayCustomDomainsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGatewayCustomDomainsClient().Get(ctx, "myResourceGroup", "myservice", "default", "myDomainName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GatewayCustomDomainResource = armappplatform.GatewayCustomDomainResource{ - // Name: to.Ptr("myDomainName"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/gateways/domains"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default/domains/myDomainName"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.GatewayCustomDomainProperties{ - // Thumbprint: to.Ptr("*"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/GatewayCustomDomains_CreateOrUpdate.json -func ExampleGatewayCustomDomainsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGatewayCustomDomainsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", "myDomainName", armappplatform.GatewayCustomDomainResource{ - Properties: &armappplatform.GatewayCustomDomainProperties{ - Thumbprint: to.Ptr("*"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GatewayCustomDomainResource = armappplatform.GatewayCustomDomainResource{ - // Name: to.Ptr("myDomainName"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/gateways/domains"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default/domains/myDomainName"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.GatewayCustomDomainProperties{ - // Thumbprint: to.Ptr("*"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/GatewayCustomDomains_Delete.json -func ExampleGatewayCustomDomainsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGatewayCustomDomainsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", "myDomainName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/GatewayCustomDomains_List.json -func ExampleGatewayCustomDomainsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGatewayCustomDomainsClient().NewListPager("myResourceGroup", "myservice", "default", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GatewayCustomDomainResourceCollection = armappplatform.GatewayCustomDomainResourceCollection{ - // Value: []*armappplatform.GatewayCustomDomainResource{ - // { - // Name: to.Ptr("myDomain"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/gateways/domains"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default/domains/myDomain"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.GatewayCustomDomainProperties{ - // Thumbprint: to.Ptr("*"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client.go b/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client.go index 90d505522e67..d56cbdb2e36c 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client.go @@ -49,7 +49,7 @@ func NewGatewayRouteConfigsClient(subscriptionID string, credential azcore.Token // route configs. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -74,7 +74,7 @@ func (client *GatewayRouteConfigsClient) BeginCreateOrUpdate(ctx context.Context // configs. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *GatewayRouteConfigsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, gatewayRouteConfigResource GatewayRouteConfigResource, options *GatewayRouteConfigsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource, options) if err != nil { @@ -118,7 +118,7 @@ func (client *GatewayRouteConfigsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, gatewayRouteConfigResource) @@ -127,7 +127,7 @@ func (client *GatewayRouteConfigsClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete the Spring Cloud Gateway route config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -150,7 +150,7 @@ func (client *GatewayRouteConfigsClient) BeginDelete(ctx context.Context, resour // Delete - Delete the Spring Cloud Gateway route config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *GatewayRouteConfigsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, options) if err != nil { @@ -194,7 +194,7 @@ func (client *GatewayRouteConfigsClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +203,7 @@ func (client *GatewayRouteConfigsClient) deleteCreateRequest(ctx context.Context // Get - Get the Spring Cloud Gateway route configs. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -253,7 +253,7 @@ func (client *GatewayRouteConfigsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,7 @@ func (client *GatewayRouteConfigsClient) getHandleResponse(resp *http.Response) // NewListPager - Handle requests to list all Spring Cloud Gateway route configs. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -329,7 +329,7 @@ func (client *GatewayRouteConfigsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client_example_test.go deleted file mode 100644 index 493aebb6dbd4..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client_example_test.go +++ /dev/null @@ -1,223 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/GatewayRouteConfigs_Get.json -func ExampleGatewayRouteConfigsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGatewayRouteConfigsClient().Get(ctx, "myResourceGroup", "myservice", "default", "myRouteConfig", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GatewayRouteConfigResource = armappplatform.GatewayRouteConfigResource{ - // Name: to.Ptr("myRouteConfig"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/gateways/routeConfigs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default/routeConfigs/myRouteConfig"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.GatewayRouteConfigProperties{ - // AppResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp"), - // OpenAPI: &armappplatform.GatewayRouteConfigOpenAPIProperties{ - // URI: to.Ptr("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json"), - // }, - // ProvisioningState: to.Ptr(armappplatform.GatewayProvisioningStateSucceeded), - // Routes: []*armappplatform.GatewayAPIRoute{ - // { - // Filters: []*string{ - // to.Ptr("StripPrefix=2"), - // to.Ptr("RateLimit=1,1s")}, - // Predicates: []*string{ - // to.Ptr("Path=/api5/customer/**")}, - // SsoEnabled: to.Ptr(true), - // Title: to.Ptr("myApp route config"), - // }}, - // Protocol: to.Ptr(armappplatform.GatewayRouteConfigProtocolHTTPS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/GatewayRouteConfigs_CreateOrUpdate.json -func ExampleGatewayRouteConfigsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGatewayRouteConfigsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", "myRouteConfig", armappplatform.GatewayRouteConfigResource{ - Properties: &armappplatform.GatewayRouteConfigProperties{ - AppResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp"), - OpenAPI: &armappplatform.GatewayRouteConfigOpenAPIProperties{ - URI: to.Ptr("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json"), - }, - Routes: []*armappplatform.GatewayAPIRoute{ - { - Filters: []*string{ - to.Ptr("StripPrefix=2"), - to.Ptr("RateLimit=1,1s")}, - Predicates: []*string{ - to.Ptr("Path=/api5/customer/**")}, - SsoEnabled: to.Ptr(true), - Title: to.Ptr("myApp route config"), - }}, - Protocol: to.Ptr(armappplatform.GatewayRouteConfigProtocolHTTPS), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GatewayRouteConfigResource = armappplatform.GatewayRouteConfigResource{ - // Name: to.Ptr("myRouteConfig"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/gateways/routeConfigs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default/routeConfigs/myRouteConfig"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.GatewayRouteConfigProperties{ - // AppResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp"), - // OpenAPI: &armappplatform.GatewayRouteConfigOpenAPIProperties{ - // URI: to.Ptr("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json"), - // }, - // ProvisioningState: to.Ptr(armappplatform.GatewayProvisioningStateSucceeded), - // Routes: []*armappplatform.GatewayAPIRoute{ - // { - // Filters: []*string{ - // to.Ptr("StripPrefix=2"), - // to.Ptr("RateLimit=1,1s")}, - // Predicates: []*string{ - // to.Ptr("Path=/api5/customer/**")}, - // SsoEnabled: to.Ptr(true), - // Title: to.Ptr("myApp route config"), - // }}, - // Protocol: to.Ptr(armappplatform.GatewayRouteConfigProtocolHTTPS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/GatewayRouteConfigs_Delete.json -func ExampleGatewayRouteConfigsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGatewayRouteConfigsClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", "myRouteConfig", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/GatewayRouteConfigs_List.json -func ExampleGatewayRouteConfigsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGatewayRouteConfigsClient().NewListPager("myResourceGroup", "myservice", "default", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GatewayRouteConfigResourceCollection = armappplatform.GatewayRouteConfigResourceCollection{ - // Value: []*armappplatform.GatewayRouteConfigResource{ - // { - // Name: to.Ptr("myRouteConfig"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/gateways/routeConfigs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default/routeConfigs/myRouteConfig"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.GatewayRouteConfigProperties{ - // AppResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/apps/myApp"), - // OpenAPI: &armappplatform.GatewayRouteConfigOpenAPIProperties{ - // URI: to.Ptr("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.json"), - // }, - // ProvisioningState: to.Ptr(armappplatform.GatewayProvisioningStateSucceeded), - // Routes: []*armappplatform.GatewayAPIRoute{ - // { - // Filters: []*string{ - // to.Ptr("StripPrefix=2"), - // to.Ptr("RateLimit=1,1s")}, - // Predicates: []*string{ - // to.Ptr("Path=/api5/customer/**")}, - // SsoEnabled: to.Ptr(true), - // Title: to.Ptr("myApp route config"), - // }}, - // Protocol: to.Ptr(armappplatform.GatewayRouteConfigProtocolHTTPS), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/gateways_client.go b/sdk/resourcemanager/appplatform/armappplatform/gateways_client.go index 275f4933c785..be40fcd9ca52 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/gateways_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/gateways_client.go @@ -48,7 +48,7 @@ func NewGatewaysClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -71,7 +71,7 @@ func (client *GatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *GatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayResource GatewayResource, options *GatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, gatewayResource, options) if err != nil { @@ -111,7 +111,7 @@ func (client *GatewaysClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, gatewayResource) @@ -120,7 +120,7 @@ func (client *GatewaysClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Disable the default Spring Cloud Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -141,7 +141,7 @@ func (client *GatewaysClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Disable the default Spring Cloud Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *GatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) if err != nil { @@ -181,7 +181,7 @@ func (client *GatewaysClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *GatewaysClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the Spring Cloud Gateway and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -235,7 +235,7 @@ func (client *GatewaysClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +252,7 @@ func (client *GatewaysClient) getHandleResponse(resp *http.Response) (GatewaysCl // NewListPager - Handles requests to list all resources in a Service. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -305,7 +305,7 @@ func (client *GatewaysClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +323,7 @@ func (client *GatewaysClient) listHandleResponse(resp *http.Response) (GatewaysC // ListEnvSecrets - List sensitive environment variables of Spring Cloud Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -368,7 +368,7 @@ func (client *GatewaysClient) listEnvSecretsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -383,10 +383,82 @@ func (client *GatewaysClient) listEnvSecretsHandleResponse(resp *http.Response) return result, nil } +// BeginRestart - Restart the Spring Cloud Gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - gatewayName - The name of Spring Cloud Gateway. +// - options - GatewaysClientBeginRestartOptions contains the optional parameters for the GatewaysClient.BeginRestart method. +func (client *GatewaysClient) BeginRestart(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginRestartOptions) (*runtime.Poller[GatewaysClientRestartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.restart(ctx, resourceGroupName, serviceName, gatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GatewaysClientRestartResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[GatewaysClientRestartResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Restart - Restart the Spring Cloud Gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *GatewaysClient) restart(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginRestartOptions) (*http.Response, error) { + req, err := client.restartCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// restartCreateRequest creates the Restart request. +func (client *GatewaysClient) restartCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginRestartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/restart" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginUpdateCapacity - Operation to update an exiting Spring Cloud Gateway capacity. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -411,7 +483,7 @@ func (client *GatewaysClient) BeginUpdateCapacity(ctx context.Context, resourceG // UpdateCapacity - Operation to update an exiting Spring Cloud Gateway capacity. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *GatewaysClient) updateCapacity(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayCapacityResource SKUObject, options *GatewaysClientBeginUpdateCapacityOptions) (*http.Response, error) { req, err := client.updateCapacityCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, gatewayCapacityResource, options) if err != nil { @@ -451,7 +523,7 @@ func (client *GatewaysClient) updateCapacityCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, gatewayCapacityResource) @@ -460,7 +532,7 @@ func (client *GatewaysClient) updateCapacityCreateRequest(ctx context.Context, r // ValidateDomain - Check the domains are valid as well as not in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -506,7 +578,7 @@ func (client *GatewaysClient) validateDomainCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, validatePayload) diff --git a/sdk/resourcemanager/appplatform/armappplatform/gateways_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/gateways_client_example_test.go deleted file mode 100644 index 402dcf47af7c..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/gateways_client_example_test.go +++ /dev/null @@ -1,412 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Gateways_Get.json -func ExampleGatewaysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGatewaysClient().Get(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GatewayResource = armappplatform.GatewayResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/gateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.GatewayProperties{ - // Instances: []*armappplatform.GatewayInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // OperatorProperties: &armappplatform.GatewayOperatorProperties{ - // Instances: []*armappplatform.GatewayInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ResourceRequests: &armappplatform.GatewayOperatorResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](2), - // Memory: to.Ptr("1G"), - // }, - // }, - // ProvisioningState: to.Ptr(armappplatform.GatewayProvisioningStateSucceeded), - // Public: to.Ptr(true), - // ResourceRequests: &armappplatform.GatewayResourceRequests{ - // CPU: to.Ptr("1"), - // Memory: to.Ptr("1G"), - // }, - // URL: to.Ptr("test-url"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Gateways_CreateOrUpdate.json -func ExampleGatewaysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGatewaysClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", armappplatform.GatewayResource{ - Properties: &armappplatform.GatewayProperties{ - Public: to.Ptr(true), - ResourceRequests: &armappplatform.GatewayResourceRequests{ - CPU: to.Ptr("1"), - Memory: to.Ptr("1G"), - }, - }, - SKU: &armappplatform.SKU{ - Name: to.Ptr("E0"), - Capacity: to.Ptr[int32](2), - Tier: to.Ptr("Enterprise"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GatewayResource = armappplatform.GatewayResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/gateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.GatewayProperties{ - // Instances: []*armappplatform.GatewayInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // OperatorProperties: &armappplatform.GatewayOperatorProperties{ - // Instances: []*armappplatform.GatewayInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ResourceRequests: &armappplatform.GatewayOperatorResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](2), - // Memory: to.Ptr("1G"), - // }, - // }, - // ProvisioningState: to.Ptr(armappplatform.GatewayProvisioningStateSucceeded), - // Public: to.Ptr(true), - // ResourceRequests: &armappplatform.GatewayResourceRequests{ - // CPU: to.Ptr("1"), - // Memory: to.Ptr("1G"), - // }, - // URL: to.Ptr("test-url"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Gateway_Scale.json -func ExampleGatewaysClient_BeginUpdateCapacity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGatewaysClient().BeginUpdateCapacity(ctx, "myResourceGroup", "myservice", "default", armappplatform.SKUObject{ - SKU: &armappplatform.SKU{ - Name: to.Ptr("E0"), - Capacity: to.Ptr[int32](2), - Tier: to.Ptr("Enterprise"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GatewayResource = armappplatform.GatewayResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/gateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.GatewayProperties{ - // Instances: []*armappplatform.GatewayInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // OperatorProperties: &armappplatform.GatewayOperatorProperties{ - // Instances: []*armappplatform.GatewayInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ResourceRequests: &armappplatform.GatewayOperatorResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](2), - // Memory: to.Ptr("1G"), - // }, - // }, - // ProvisioningState: to.Ptr(armappplatform.GatewayProvisioningStateSucceeded), - // Public: to.Ptr(true), - // ResourceRequests: &armappplatform.GatewayResourceRequests{ - // CPU: to.Ptr("1"), - // Memory: to.Ptr("1G"), - // }, - // URL: to.Ptr("test-url"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Gateways_Delete.json -func ExampleGatewaysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGatewaysClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Gateways_ListEnvSecrets.json -func ExampleGatewaysClient_ListEnvSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGatewaysClient().ListEnvSecrets(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Value = map[string]*string{ - // "key": to.Ptr("value"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Gateways_List.json -func ExampleGatewaysClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGatewaysClient().NewListPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GatewayResourceCollection = armappplatform.GatewayResourceCollection{ - // Value: []*armappplatform.GatewayResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/gateways"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/gateways/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.GatewayProperties{ - // Instances: []*armappplatform.GatewayInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // OperatorProperties: &armappplatform.GatewayOperatorProperties{ - // Instances: []*armappplatform.GatewayInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ResourceRequests: &armappplatform.GatewayOperatorResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](2), - // Memory: to.Ptr("1G"), - // }, - // }, - // ProvisioningState: to.Ptr(armappplatform.GatewayProvisioningStateSucceeded), - // Public: to.Ptr(true), - // ResourceRequests: &armappplatform.GatewayResourceRequests{ - // CPU: to.Ptr("1"), - // Memory: to.Ptr("1G"), - // }, - // URL: to.Ptr("test-url"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Gateways_ValidateDomain.json -func ExampleGatewaysClient_ValidateDomain() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGatewaysClient().ValidateDomain(ctx, "myResourceGroup", "myservice", "default", armappplatform.CustomDomainValidatePayload{ - Name: to.Ptr("mydomain.io"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomDomainValidateResult = armappplatform.CustomDomainValidateResult{ - // IsValid: to.Ptr(false), - // Message: to.Ptr("Certificate is invalid, please check if it is a self signed cert or if it contains a suitable dns name"), - // } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/go.mod b/sdk/resourcemanager/appplatform/armappplatform/go.mod index f0e2aa6cad47..58aaeddb0360 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/go.mod +++ b/sdk/resourcemanager/appplatform/armappplatform/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappp go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/appplatform/armappplatform/go.sum b/sdk/resourcemanager/appplatform/armappplatform/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/go.sum +++ b/sdk/resourcemanager/appplatform/armappplatform/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= 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/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +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.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -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/appplatform/armappplatform/models.go b/sdk/resourcemanager/appplatform/armappplatform/models.go index 284ee43869f5..91ffbe6669ec 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/models.go +++ b/sdk/resourcemanager/appplatform/armappplatform/models.go @@ -202,6 +202,9 @@ type AcceleratorBasicAuthSetting struct { // REQUIRED; Username of git repository basic auth. Username *string + // Resource Id of CA certificate for https URL of Git repository. + CaCertResourceID *string + // Password of git repository basic auth. Password *string } @@ -237,6 +240,9 @@ type AcceleratorGitRepository struct { type AcceleratorPublicSetting struct { // REQUIRED; The type of the auth setting. AuthType *string + + // Resource Id of CA certificate for https URL of Git repository. + CaCertResourceID *string } // GetAcceleratorAuthSetting implements the AcceleratorAuthSettingClassification interface for type AcceleratorPublicSetting. @@ -274,6 +280,87 @@ type ActiveDeploymentCollection struct { ActiveDeploymentNames []*string } +// ApmProperties - Properties of an APM +type ApmProperties struct { + // REQUIRED; APM Type + Type *string + + // Non-sensitive properties for the APM + Properties map[string]*string + + // Sensitive properties for the APM + Secrets map[string]*string + + // READ-ONLY; State of the APM. + ProvisioningState *ApmProvisioningState +} + +// ApmReference - A reference to the APM +type ApmReference struct { + // REQUIRED; Resource Id of the APM + ResourceID *string +} + +// ApmResource - APM Resource object +type ApmResource struct { + // Properties of an APM + Properties *ApmProperties + + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string + + // READ-ONLY; The name of the resource. + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. + Type *string +} + +// ApmResourceCollection - Object that includes an array of APM resources and a possible link for next set +type ApmResourceCollection struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string + + // Collection of APM resources + Value []*ApmResource +} + +// ApmSecretKeys - Keys of APM sensitive properties +type ApmSecretKeys struct { + // Collection of the keys for the APM sensitive properties + Value []*string +} + +// ApmsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApmsClient.BeginCreateOrUpdate method. +type ApmsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApmsClientBeginDeleteOptions contains the optional parameters for the ApmsClient.BeginDelete method. +type ApmsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApmsClientGetOptions contains the optional parameters for the ApmsClient.Get method. +type ApmsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApmsClientListOptions contains the optional parameters for the ApmsClient.NewListPager method. +type ApmsClientListOptions struct { + // placeholder for future optional parameters +} + +// ApmsClientListSecretKeysOptions contains the optional parameters for the ApmsClient.ListSecretKeys method. +type ApmsClientListSecretKeysOptions struct { + // placeholder for future optional parameters +} + // AppResource - App resource payload type AppResource struct { // The Managed Identity type of the app resource @@ -342,6 +429,9 @@ type AppResourceProperties struct { // Additional App settings in vnet injection instance VnetAddons *AppVNetAddons + // The workload profile used for this app. Supported for Consumption + Dedicated plan. + WorkloadProfileName *string + // READ-ONLY; Fully qualified dns Name. Fqdn *string @@ -763,9 +853,15 @@ type BuildProperties struct { // The resource id of agent pool AgentPool *string + // The APMs for this build + Apms []*ApmReference + // The resource id of builder to build the source code Builder *string + // The CA Certificates for this build + Certificates []*CertificateReference + // The environment variables for this build Env map[string]*string @@ -840,6 +936,9 @@ type BuildResultProperties struct { // READ-ONLY; All of the build stage (init-container and container) resources in build pod. BuildStages []*BuildStageProperties + // READ-ONLY; The container registry image of this build result. + Image *string + // READ-ONLY; Provisioning state of the KPack build result ProvisioningState *BuildResultProvisioningState } @@ -979,6 +1078,20 @@ type BuildServiceBuilderClientListOptions struct { // placeholder for future optional parameters } +// BuildServiceClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildServiceClient.BeginCreateOrUpdate +// method. +type BuildServiceClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BuildServiceClientBeginDeleteBuildOptions contains the optional parameters for the BuildServiceClient.BeginDeleteBuild +// method. +type BuildServiceClientBeginDeleteBuildOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // BuildServiceClientCreateOrUpdateBuildOptions contains the optional parameters for the BuildServiceClient.CreateOrUpdateBuild // method. type BuildServiceClientCreateOrUpdateBuildOptions struct { @@ -1064,13 +1177,16 @@ type BuildServiceCollection struct { // BuildServiceProperties - Build service resource properties payload type BuildServiceProperties struct { - // The installed KPack version in this build service. - KPackVersion *string + // The resource id of the container registry used in this build service. + ContainerRegistry *string // The runtime resource configuration of this build service. ResourceRequests *BuildServicePropertiesResourceRequests - // READ-ONLY; Provisioning state of the KPack build result + // READ-ONLY; The installed KPack version in this build service. + KPackVersion *string + + // READ-ONLY; Provisioning state of the KPack build service ProvisioningState *BuildServiceProvisioningState } @@ -1272,6 +1388,12 @@ type CertificateProperties struct { // GetCertificateProperties implements the CertificatePropertiesClassification interface for type CertificateProperties. func (c *CertificateProperties) GetCertificateProperties() *CertificateProperties { return c } +// CertificateReference - A reference to the certificate +type CertificateReference struct { + // REQUIRED; Resource Id of the certificate + ResourceID *string +} + // CertificateResource - Certificate resource payload. type CertificateResource struct { // Properties of the certificate resource payload. @@ -1394,6 +1516,9 @@ type ConfigServerProperties struct { // Settings of config server. ConfigServer *ConfigServerSettings + // Enabled state of the config server. This is only used in Consumption tier. + EnabledState *ConfigServerEnabledState + // Error when apply config server settings. Error *Error @@ -1499,6 +1624,12 @@ type ConfigurationServiceGitRepository struct { // REQUIRED; URI of the repository URI *string + // Resource Id of CA certificate for https URL of Git repository. + CaCertResourceID *string + + // Git libraries used to support various repository providers + GitImplementation *GitImplementation + // Public sshKey of git repository. HostKey *string @@ -1532,6 +1663,9 @@ type ConfigurationServiceInstance struct { // ConfigurationServiceProperties - Application Configuration Service properties payload type ConfigurationServiceProperties struct { + // The generation of the Application Configuration Service. + Generation *ConfigurationServiceGeneration + // The settings of Application Configuration Service. Settings *ConfigurationServiceSettings @@ -1635,6 +1769,125 @@ type ContainerProbeSettings struct { DisableProbe *bool } +// ContainerRegistriesClientBeginCreateOrUpdateOptions contains the optional parameters for the ContainerRegistriesClient.BeginCreateOrUpdate +// method. +type ContainerRegistriesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ContainerRegistriesClientBeginDeleteOptions contains the optional parameters for the ContainerRegistriesClient.BeginDelete +// method. +type ContainerRegistriesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ContainerRegistriesClientBeginValidateOptions contains the optional parameters for the ContainerRegistriesClient.BeginValidate +// method. +type ContainerRegistriesClientBeginValidateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ContainerRegistriesClientGetOptions contains the optional parameters for the ContainerRegistriesClient.Get method. +type ContainerRegistriesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ContainerRegistriesClientListOptions contains the optional parameters for the ContainerRegistriesClient.NewListPager method. +type ContainerRegistriesClientListOptions struct { + // placeholder for future optional parameters +} + +// ContainerRegistryBasicCredentials - The basic authentication properties for the container registry resource. +type ContainerRegistryBasicCredentials struct { + // REQUIRED; The password of the Container Registry. + Password *string + + // REQUIRED; The login server of the Container Registry. + Server *string + + // REQUIRED; The credential type of the container registry credentials. + Type *string + + // REQUIRED; The username of the Container Registry. + Username *string +} + +// GetContainerRegistryCredentials implements the ContainerRegistryCredentialsClassification interface for type ContainerRegistryBasicCredentials. +func (c *ContainerRegistryBasicCredentials) GetContainerRegistryCredentials() *ContainerRegistryCredentials { + return &ContainerRegistryCredentials{ + Type: c.Type, + } +} + +// ContainerRegistryCredentialsClassification provides polymorphic access to related types. +// Call the interface's GetContainerRegistryCredentials() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ContainerRegistryBasicCredentials, *ContainerRegistryCredentials +type ContainerRegistryCredentialsClassification interface { + // GetContainerRegistryCredentials returns the ContainerRegistryCredentials content of the underlying type. + GetContainerRegistryCredentials() *ContainerRegistryCredentials +} + +// ContainerRegistryCredentials - The credential for the container registry resource. +type ContainerRegistryCredentials struct { + // REQUIRED; The credential type of the container registry credentials. + Type *string +} + +// GetContainerRegistryCredentials implements the ContainerRegistryCredentialsClassification interface for type ContainerRegistryCredentials. +func (c *ContainerRegistryCredentials) GetContainerRegistryCredentials() *ContainerRegistryCredentials { + return c +} + +// ContainerRegistryProperties - Container registry resource payload. +type ContainerRegistryProperties struct { + // REQUIRED; The credentials of the container registry resource. + Credentials ContainerRegistryCredentialsClassification + + // READ-ONLY; State of the Container Registry. + ProvisioningState *ContainerRegistryProvisioningState +} + +// ContainerRegistryResource - Container registry resource payload. +type ContainerRegistryResource struct { + // Properties of the container registry resource payload. + Properties *ContainerRegistryProperties + + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string + + // READ-ONLY; The name of the resource. + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. + Type *string +} + +// ContainerRegistryResourceCollection - Collection compose of container registry resources list and a possible link for next +// page. +type ContainerRegistryResourceCollection struct { + // The link to next page of storage list. + NextLink *string + + // The container registry resources list. + Value []*ContainerRegistryResource +} + +// ContainerRegistryValidateResult - Validation result for container registry properties +type ContainerRegistryValidateResult struct { + // Indicate if the container registry properties are valid + IsValid *bool + + // Detailed validation messages. + Message *string +} + // ContentCertificateProperties - Properties of certificate imported from key vault. type ContentCertificateProperties struct { // REQUIRED; The type of the certificate source. @@ -2025,6 +2278,9 @@ type DeploymentSettings struct { // Collection of addons AddonConfigs map[string]any + // Collection of ApmReferences + Apms []*ApmReference + // Container liveness and readiness probe settings ContainerProbeSettings *ContainerProbeSettings @@ -2316,6 +2572,69 @@ type Error struct { Message *string } +// EurekaServerProperties - Eureka server properties payload +type EurekaServerProperties struct { + // Enabled state of the eureka server. This is only used in Consumption tier. + EnabledState *EurekaServerEnabledState + + // Error when applying eureka server settings. + Error *Error + + // READ-ONLY; State of the eureka server. + ProvisioningState *EurekaServerState +} + +// EurekaServerResource - Eureka server resource +type EurekaServerResource struct { + // Properties of the eureka server resource + Properties *EurekaServerProperties + + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string + + // READ-ONLY; The name of the resource. + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. + Type *string +} + +// EurekaServerResourceCollection - Object that includes an array of Eureka server resources and a possible link for next +// set +type EurekaServerResourceCollection struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string + + // Collection of Eureka server resources + Value []*EurekaServerResource +} + +// EurekaServersClientBeginUpdatePatchOptions contains the optional parameters for the EurekaServersClient.BeginUpdatePatch +// method. +type EurekaServersClientBeginUpdatePatchOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EurekaServersClientBeginUpdatePutOptions contains the optional parameters for the EurekaServersClient.BeginUpdatePut method. +type EurekaServersClientBeginUpdatePutOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EurekaServersClientGetOptions contains the optional parameters for the EurekaServersClient.Get method. +type EurekaServersClientGetOptions struct { + // placeholder for future optional parameters +} + +// EurekaServersClientListOptions contains the optional parameters for the EurekaServersClient.List method. +type EurekaServersClientListOptions struct { + // placeholder for future optional parameters +} + // ExecAction describes a "run in container" action. type ExecAction struct { // REQUIRED; The type of the action to take to perform the health check. @@ -2398,6 +2717,9 @@ type GatewayCorsProperties struct { // by default. AllowedMethods []*string + // Allowed origin patterns to make cross-site requests. + AllowedOriginPatterns []*string + // Allowed origins to make cross-site requests. The special value * allows all domains. AllowedOrigins []*string @@ -2502,9 +2824,15 @@ type GatewayProperties struct { // API metadata property for Spring Cloud Gateway APIMetadataProperties *GatewayAPIMetadataProperties + // Collection of addons for Spring Cloud Gateway + AddonConfigs map[string]any + // Collection of APM type used in Spring Cloud Gateway ApmTypes []*ApmType + // Client-Certification Authentication. + ClientAuth *GatewayPropertiesClientAuth + // Cross-Origin Resource Sharing property CorsProperties *GatewayCorsProperties @@ -2536,6 +2864,15 @@ type GatewayProperties struct { URL *string } +// GatewayPropertiesClientAuth - Client-Certification Authentication. +type GatewayPropertiesClientAuth struct { + // Whether to enable certificate verification or not + CertificateVerification *GatewayCertificateVerification + + // Collection of certificate resource Ids in Azure Spring Apps. + Certificates []*string +} + // GatewayPropertiesEnvironmentVariables - Environment variables of Spring Cloud Gateway type GatewayPropertiesEnvironmentVariables struct { // Non-sensitive properties @@ -2683,6 +3020,12 @@ type GatewaysClientBeginDeleteOptions struct { ResumeToken string } +// GatewaysClientBeginRestartOptions contains the optional parameters for the GatewaysClient.BeginRestart method. +type GatewaysClientBeginRestartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // GatewaysClientBeginUpdateCapacityOptions contains the optional parameters for the GatewaysClient.BeginUpdateCapacity method. type GatewaysClientBeginUpdateCapacityOptions struct { // Resumes the LRO from the provided token. @@ -2745,6 +3088,12 @@ type GitPatternRepository struct { Username *string } +// GloballyEnabledApms - Globally enabled APMs payload +type GloballyEnabledApms struct { + // Collection of the globally enabled APMs + Value []*string +} + // HTTPGetAction describes an action based on HTTP Get requests. type HTTPGetAction struct { // REQUIRED; The type of the action to take to perform the health check. @@ -3752,6 +4101,10 @@ type ServiceSpecification struct { // ServiceVNetAddons - Additional Service settings in vnet injection instance type ServiceVNetAddons struct { + // Indicates whether the data plane components(log stream, app connect, remote debugging) in vnet injection instance could + // be accessed from internet. + DataPlanePublicEndpoint *bool + // Indicates whether the log stream in vnet injection instance could be accessed from internet. LogStreamPublicEndpoint *bool } @@ -3768,6 +4121,20 @@ type ServicesClientBeginDeleteOptions struct { ResumeToken string } +// ServicesClientBeginDisableApmGloballyOptions contains the optional parameters for the ServicesClient.BeginDisableApmGlobally +// method. +type ServicesClientBeginDisableApmGloballyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientBeginEnableApmGloballyOptions contains the optional parameters for the ServicesClient.BeginEnableApmGlobally +// method. +type ServicesClientBeginEnableApmGloballyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ServicesClientBeginStartOptions contains the optional parameters for the ServicesClient.BeginStart method. type ServicesClientBeginStartOptions struct { // Resumes the LRO from the provided token. @@ -3813,11 +4180,23 @@ type ServicesClientListBySubscriptionOptions struct { // placeholder for future optional parameters } +// ServicesClientListGloballyEnabledApmsOptions contains the optional parameters for the ServicesClient.ListGloballyEnabledApms +// method. +type ServicesClientListGloballyEnabledApmsOptions struct { + // placeholder for future optional parameters +} + // ServicesClientListOptions contains the optional parameters for the ServicesClient.NewListPager method. type ServicesClientListOptions struct { // placeholder for future optional parameters } +// ServicesClientListSupportedApmTypesOptions contains the optional parameters for the ServicesClient.NewListSupportedApmTypesPager +// method. +type ServicesClientListSupportedApmTypesOptions struct { + // placeholder for future optional parameters +} + // ServicesClientListTestKeysOptions contains the optional parameters for the ServicesClient.ListTestKeys method. type ServicesClientListTestKeysOptions struct { // placeholder for future optional parameters @@ -3974,6 +4353,21 @@ type StoragesClientListOptions struct { // placeholder for future optional parameters } +// SupportedApmType - Supported APM type +type SupportedApmType struct { + // The name of the supported APM type + Name *string +} + +// SupportedApmTypes - Supported APM types payload +type SupportedApmTypes struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string + + // Collection of the supported APM type + Value []*SupportedApmType +} + // SupportedBuildpackResource - Supported buildpack resource payload type SupportedBuildpackResource struct { // Supported buildpack resource properties diff --git a/sdk/resourcemanager/appplatform/armappplatform/models_serde.go b/sdk/resourcemanager/appplatform/armappplatform/models_serde.go index 9530c2fd6528..d2e215b0ddbc 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/models_serde.go +++ b/sdk/resourcemanager/appplatform/armappplatform/models_serde.go @@ -347,6 +347,7 @@ func (a *AcceleratorAuthSetting) UnmarshalJSON(data []byte) error { func (a AcceleratorBasicAuthSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["authType"] = "BasicAuth" + populate(objectMap, "caCertResourceId", a.CaCertResourceID) populate(objectMap, "password", a.Password) populate(objectMap, "username", a.Username) return json.Marshal(objectMap) @@ -364,6 +365,9 @@ func (a *AcceleratorBasicAuthSetting) UnmarshalJSON(data []byte) error { case "authType": err = unpopulate(val, "AuthType", &a.AuthType) delete(rawMsg, key) + case "caCertResourceId": + err = unpopulate(val, "CaCertResourceID", &a.CaCertResourceID) + delete(rawMsg, key) case "password": err = unpopulate(val, "Password", &a.Password) delete(rawMsg, key) @@ -429,6 +433,7 @@ func (a *AcceleratorGitRepository) UnmarshalJSON(data []byte) error { func (a AcceleratorPublicSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) objectMap["authType"] = "Public" + populate(objectMap, "caCertResourceId", a.CaCertResourceID) return json.Marshal(objectMap) } @@ -444,6 +449,9 @@ func (a *AcceleratorPublicSetting) UnmarshalJSON(data []byte) error { case "authType": err = unpopulate(val, "AuthType", &a.AuthType) delete(rawMsg, key) + case "caCertResourceId": + err = unpopulate(val, "CaCertResourceID", &a.CaCertResourceID) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -518,6 +526,173 @@ func (a *ActiveDeploymentCollection) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ApmProperties. +func (a ApmProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "secrets", a.Secrets) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApmProperties. +func (a *ApmProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &a.Secrets) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApmReference. +func (a ApmReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceId", a.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApmReference. +func (a *ApmReference) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceId": + err = unpopulate(val, "ResourceID", &a.ResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApmResource. +func (a ApmResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApmResource. +func (a *ApmResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApmResourceCollection. +func (a ApmResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApmResourceCollection. +func (a *ApmResourceCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApmSecretKeys. +func (a ApmSecretKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApmSecretKeys. +func (a *ApmSecretKeys) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AppResource. func (a AppResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -617,6 +792,7 @@ func (a AppResourceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "temporaryDisk", a.TemporaryDisk) populate(objectMap, "url", a.URL) populate(objectMap, "vnetAddons", a.VnetAddons) + populate(objectMap, "workloadProfileName", a.WorkloadProfileName) return json.Marshal(objectMap) } @@ -671,6 +847,9 @@ func (a *AppResourceProperties) UnmarshalJSON(data []byte) error { case "vnetAddons": err = unpopulate(val, "VnetAddons", &a.VnetAddons) delete(rawMsg, key) + case "workloadProfileName": + err = unpopulate(val, "WorkloadProfileName", &a.WorkloadProfileName) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -1465,7 +1644,9 @@ func (b *BuildCollection) UnmarshalJSON(data []byte) error { func (b BuildProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "agentPool", b.AgentPool) + populate(objectMap, "apms", b.Apms) populate(objectMap, "builder", b.Builder) + populate(objectMap, "certificates", b.Certificates) populate(objectMap, "env", b.Env) populate(objectMap, "provisioningState", b.ProvisioningState) populate(objectMap, "relativePath", b.RelativePath) @@ -1486,9 +1667,15 @@ func (b *BuildProperties) UnmarshalJSON(data []byte) error { case "agentPool": err = unpopulate(val, "AgentPool", &b.AgentPool) delete(rawMsg, key) + case "apms": + err = unpopulate(val, "Apms", &b.Apms) + delete(rawMsg, key) case "builder": err = unpopulate(val, "Builder", &b.Builder) delete(rawMsg, key) + case "certificates": + err = unpopulate(val, "Certificates", &b.Certificates) + delete(rawMsg, key) case "env": err = unpopulate(val, "Env", &b.Env) delete(rawMsg, key) @@ -1650,6 +1837,7 @@ func (b BuildResultProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "buildPodName", b.BuildPodName) populate(objectMap, "buildStages", b.BuildStages) populate(objectMap, "error", b.Error) + populate(objectMap, "image", b.Image) populate(objectMap, "name", b.Name) populate(objectMap, "provisioningState", b.ProvisioningState) return json.Marshal(objectMap) @@ -1673,6 +1861,9 @@ func (b *BuildResultProperties) UnmarshalJSON(data []byte) error { case "error": err = unpopulate(val, "Error", &b.Error) delete(rawMsg, key) + case "image": + err = unpopulate(val, "Image", &b.Image) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) @@ -1939,6 +2130,7 @@ func (b *BuildServiceCollection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BuildServiceProperties. func (b BuildServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "containerRegistry", b.ContainerRegistry) populate(objectMap, "kPackVersion", b.KPackVersion) populate(objectMap, "provisioningState", b.ProvisioningState) populate(objectMap, "resourceRequests", b.ResourceRequests) @@ -1954,6 +2146,9 @@ func (b *BuildServiceProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "containerRegistry": + err = unpopulate(val, "ContainerRegistry", &b.ContainerRegistry) + delete(rawMsg, key) case "kPackVersion": err = unpopulate(val, "KPackVersion", &b.KPackVersion) delete(rawMsg, key) @@ -2407,6 +2602,33 @@ func (c *CertificateProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CertificateReference. +func (c CertificateReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceId", c.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateReference. +func (c *CertificateReference) UnmarshalJSON(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 "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + 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 CertificateResource. func (c CertificateResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2615,6 +2837,7 @@ func (c *ConfigServerGitProperty) UnmarshalJSON(data []byte) error { func (c ConfigServerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "configServer", c.ConfigServer) + populate(objectMap, "enabledState", c.EnabledState) populate(objectMap, "error", c.Error) populate(objectMap, "provisioningState", c.ProvisioningState) return json.Marshal(objectMap) @@ -2632,6 +2855,9 @@ func (c *ConfigServerProperties) UnmarshalJSON(data []byte) error { case "configServer": err = unpopulate(val, "ConfigServer", &c.ConfigServer) delete(rawMsg, key) + case "enabledState": + err = unpopulate(val, "EnabledState", &c.EnabledState) + delete(rawMsg, key) case "error": err = unpopulate(val, "Error", &c.Error) delete(rawMsg, key) @@ -2843,6 +3069,8 @@ func (c *ConfigurationServiceGitPropertyValidateResult) UnmarshalJSON(data []byt // MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceGitRepository. func (c ConfigurationServiceGitRepository) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "caCertResourceId", c.CaCertResourceID) + populate(objectMap, "gitImplementation", c.GitImplementation) populate(objectMap, "hostKey", c.HostKey) populate(objectMap, "hostKeyAlgorithm", c.HostKeyAlgorithm) populate(objectMap, "label", c.Label) @@ -2866,6 +3094,12 @@ func (c *ConfigurationServiceGitRepository) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "caCertResourceId": + err = unpopulate(val, "CaCertResourceID", &c.CaCertResourceID) + delete(rawMsg, key) + case "gitImplementation": + err = unpopulate(val, "GitImplementation", &c.GitImplementation) + delete(rawMsg, key) case "hostKey": err = unpopulate(val, "HostKey", &c.HostKey) delete(rawMsg, key) @@ -2941,6 +3175,7 @@ func (c *ConfigurationServiceInstance) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceProperties. func (c ConfigurationServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "generation", c.Generation) populate(objectMap, "instances", c.Instances) populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "resourceRequests", c.ResourceRequests) @@ -2957,6 +3192,9 @@ func (c *ConfigurationServiceProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "generation": + err = unpopulate(val, "Generation", &c.Generation) + delete(rawMsg, key) case "instances": err = unpopulate(val, "Instances", &c.Instances) delete(rawMsg, key) @@ -3051,17 +3289,198 @@ func (c *ConfigurationServiceResourceCollection) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceResourceRequests. -func (c ConfigurationServiceResourceRequests) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceResourceRequests. +func (c ConfigurationServiceResourceRequests) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cpu", c.CPU) + populate(objectMap, "instanceCount", c.InstanceCount) + populate(objectMap, "memory", c.Memory) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceResourceRequests. +func (c *ConfigurationServiceResourceRequests) UnmarshalJSON(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 "cpu": + err = unpopulate(val, "CPU", &c.CPU) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &c.InstanceCount) + delete(rawMsg, key) + case "memory": + err = unpopulate(val, "Memory", &c.Memory) + 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 ConfigurationServiceSettings. +func (c ConfigurationServiceSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gitProperty", c.GitProperty) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceSettings. +func (c *ConfigurationServiceSettings) UnmarshalJSON(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 "gitProperty": + err = unpopulate(val, "GitProperty", &c.GitProperty) + 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 ConfigurationServiceSettingsValidateResult. +func (c ConfigurationServiceSettingsValidateResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gitPropertyValidationResult", c.GitPropertyValidationResult) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceSettingsValidateResult. +func (c *ConfigurationServiceSettingsValidateResult) UnmarshalJSON(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 "gitPropertyValidationResult": + err = unpopulate(val, "GitPropertyValidationResult", &c.GitPropertyValidationResult) + 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 ContainerProbeSettings. +func (c ContainerProbeSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "disableProbe", c.DisableProbe) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProbeSettings. +func (c *ContainerProbeSettings) UnmarshalJSON(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 "disableProbe": + err = unpopulate(val, "DisableProbe", &c.DisableProbe) + 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 ContainerRegistryBasicCredentials. +func (c ContainerRegistryBasicCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "password", c.Password) + populate(objectMap, "server", c.Server) + objectMap["type"] = "BasicAuth" + populate(objectMap, "username", c.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerRegistryBasicCredentials. +func (c *ContainerRegistryBasicCredentials) UnmarshalJSON(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 "password": + err = unpopulate(val, "Password", &c.Password) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &c.Server) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &c.Username) + 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 ContainerRegistryCredentials. +func (c ContainerRegistryCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["type"] = c.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerRegistryCredentials. +func (c *ContainerRegistryCredentials) UnmarshalJSON(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 "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryProperties. +func (c ContainerRegistryProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cpu", c.CPU) - populate(objectMap, "instanceCount", c.InstanceCount) - populate(objectMap, "memory", c.Memory) + populate(objectMap, "credentials", c.Credentials) + populate(objectMap, "provisioningState", c.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceResourceRequests. -func (c *ConfigurationServiceResourceRequests) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerRegistryProperties. +func (c *ContainerRegistryProperties) UnmarshalJSON(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) @@ -3069,14 +3488,11 @@ func (c *ConfigurationServiceResourceRequests) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "cpu": - err = unpopulate(val, "CPU", &c.CPU) + case "credentials": + c.Credentials, err = unmarshalContainerRegistryCredentialsClassification(val) delete(rawMsg, key) - case "instanceCount": - err = unpopulate(val, "InstanceCount", &c.InstanceCount) - delete(rawMsg, key) - case "memory": - err = unpopulate(val, "Memory", &c.Memory) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) } if err != nil { @@ -3086,15 +3502,19 @@ func (c *ConfigurationServiceResourceRequests) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceSettings. -func (c ConfigurationServiceSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryResource. +func (c ContainerRegistryResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "gitProperty", c.GitProperty) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceSettings. -func (c *ConfigurationServiceSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerRegistryResource. +func (c *ContainerRegistryResource) UnmarshalJSON(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) @@ -3102,8 +3522,20 @@ func (c *ConfigurationServiceSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "gitProperty": - err = unpopulate(val, "GitProperty", &c.GitProperty) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -3113,15 +3545,16 @@ func (c *ConfigurationServiceSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceSettingsValidateResult. -func (c ConfigurationServiceSettingsValidateResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryResourceCollection. +func (c ContainerRegistryResourceCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "gitPropertyValidationResult", c.GitPropertyValidationResult) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceSettingsValidateResult. -func (c *ConfigurationServiceSettingsValidateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerRegistryResourceCollection. +func (c *ContainerRegistryResourceCollection) UnmarshalJSON(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) @@ -3129,8 +3562,11 @@ func (c *ConfigurationServiceSettingsValidateResult) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "gitPropertyValidationResult": - err = unpopulate(val, "GitPropertyValidationResult", &c.GitPropertyValidationResult) + 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 { @@ -3140,15 +3576,16 @@ func (c *ConfigurationServiceSettingsValidateResult) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerProbeSettings. -func (c ContainerProbeSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryValidateResult. +func (c ContainerRegistryValidateResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "disableProbe", c.DisableProbe) + populate(objectMap, "isValid", c.IsValid) + populate(objectMap, "message", c.Message) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProbeSettings. -func (c *ContainerProbeSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerRegistryValidateResult. +func (c *ContainerRegistryValidateResult) UnmarshalJSON(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) @@ -3156,8 +3593,11 @@ func (c *ContainerProbeSettings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "disableProbe": - err = unpopulate(val, "DisableProbe", &c.DisableProbe) + case "isValid": + err = unpopulate(val, "IsValid", &c.IsValid) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) delete(rawMsg, key) } if err != nil { @@ -3951,6 +4391,7 @@ func (d *DeploymentResourceProperties) UnmarshalJSON(data []byte) error { func (d DeploymentSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "addonConfigs", d.AddonConfigs) + populate(objectMap, "apms", d.Apms) populate(objectMap, "containerProbeSettings", d.ContainerProbeSettings) populate(objectMap, "environmentVariables", d.EnvironmentVariables) populate(objectMap, "livenessProbe", d.LivenessProbe) @@ -3974,6 +4415,9 @@ func (d *DeploymentSettings) UnmarshalJSON(data []byte) error { case "addonConfigs": err = unpopulate(val, "AddonConfigs", &d.AddonConfigs) delete(rawMsg, key) + case "apms": + err = unpopulate(val, "Apms", &d.Apms) + delete(rawMsg, key) case "containerProbeSettings": err = unpopulate(val, "ContainerProbeSettings", &d.ContainerProbeSettings) delete(rawMsg, key) @@ -4364,6 +4808,115 @@ func (e *Error) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type EurekaServerProperties. +func (e EurekaServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabledState", e.EnabledState) + populate(objectMap, "error", e.Error) + populate(objectMap, "provisioningState", e.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EurekaServerProperties. +func (e *EurekaServerProperties) UnmarshalJSON(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 "enabledState": + err = unpopulate(val, "EnabledState", &e.EnabledState) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + 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 EurekaServerResource. +func (e EurekaServerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EurekaServerResource. +func (e *EurekaServerResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EurekaServerResourceCollection. +func (e EurekaServerResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EurekaServerResourceCollection. +func (e *EurekaServerResourceCollection) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ExecAction. func (e ExecAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4503,6 +5056,7 @@ func (g GatewayCorsProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "allowCredentials", g.AllowCredentials) populate(objectMap, "allowedHeaders", g.AllowedHeaders) populate(objectMap, "allowedMethods", g.AllowedMethods) + populate(objectMap, "allowedOriginPatterns", g.AllowedOriginPatterns) populate(objectMap, "allowedOrigins", g.AllowedOrigins) populate(objectMap, "exposedHeaders", g.ExposedHeaders) populate(objectMap, "maxAge", g.MaxAge) @@ -4527,6 +5081,9 @@ func (g *GatewayCorsProperties) UnmarshalJSON(data []byte) error { case "allowedMethods": err = unpopulate(val, "AllowedMethods", &g.AllowedMethods) delete(rawMsg, key) + case "allowedOriginPatterns": + err = unpopulate(val, "AllowedOriginPatterns", &g.AllowedOriginPatterns) + delete(rawMsg, key) case "allowedOrigins": err = unpopulate(val, "AllowedOrigins", &g.AllowedOrigins) delete(rawMsg, key) @@ -4746,7 +5303,9 @@ func (g *GatewayOperatorResourceRequests) UnmarshalJSON(data []byte) error { func (g GatewayProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "apiMetadataProperties", g.APIMetadataProperties) + populate(objectMap, "addonConfigs", g.AddonConfigs) populate(objectMap, "apmTypes", g.ApmTypes) + populate(objectMap, "clientAuth", g.ClientAuth) populate(objectMap, "corsProperties", g.CorsProperties) populate(objectMap, "environmentVariables", g.EnvironmentVariables) populate(objectMap, "httpsOnly", g.HTTPSOnly) @@ -4772,9 +5331,15 @@ func (g *GatewayProperties) UnmarshalJSON(data []byte) error { case "apiMetadataProperties": err = unpopulate(val, "APIMetadataProperties", &g.APIMetadataProperties) delete(rawMsg, key) + case "addonConfigs": + err = unpopulate(val, "AddonConfigs", &g.AddonConfigs) + delete(rawMsg, key) case "apmTypes": err = unpopulate(val, "ApmTypes", &g.ApmTypes) delete(rawMsg, key) + case "clientAuth": + err = unpopulate(val, "ClientAuth", &g.ClientAuth) + delete(rawMsg, key) case "corsProperties": err = unpopulate(val, "CorsProperties", &g.CorsProperties) delete(rawMsg, key) @@ -4813,6 +5378,37 @@ func (g *GatewayProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type GatewayPropertiesClientAuth. +func (g GatewayPropertiesClientAuth) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificateVerification", g.CertificateVerification) + populate(objectMap, "certificates", g.Certificates) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayPropertiesClientAuth. +func (g *GatewayPropertiesClientAuth) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "certificateVerification": + err = unpopulate(val, "CertificateVerification", &g.CertificateVerification) + delete(rawMsg, key) + case "certificates": + err = unpopulate(val, "Certificates", &g.Certificates) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type GatewayPropertiesEnvironmentVariables. func (g GatewayPropertiesEnvironmentVariables) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5176,6 +5772,33 @@ func (g *GitPatternRepository) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type GloballyEnabledApms. +func (g GloballyEnabledApms) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GloballyEnabledApms. +func (g *GloballyEnabledApms) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type HTTPGetAction. func (h HTTPGetAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -7485,6 +8108,7 @@ func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServiceVNetAddons. func (s ServiceVNetAddons) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "dataPlanePublicEndpoint", s.DataPlanePublicEndpoint) populate(objectMap, "logStreamPublicEndpoint", s.LogStreamPublicEndpoint) return json.Marshal(objectMap) } @@ -7498,6 +8122,9 @@ func (s *ServiceVNetAddons) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "dataPlanePublicEndpoint": + err = unpopulate(val, "DataPlanePublicEndpoint", &s.DataPlanePublicEndpoint) + delete(rawMsg, key) case "logStreamPublicEndpoint": err = unpopulate(val, "LogStreamPublicEndpoint", &s.LogStreamPublicEndpoint) delete(rawMsg, key) @@ -7758,6 +8385,64 @@ func (s *StorageResourceCollection) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SupportedApmType. +func (s SupportedApmType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedApmType. +func (s *SupportedApmType) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &s.Name) + 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 SupportedApmTypes. +func (s SupportedApmTypes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedApmTypes. +func (s *SupportedApmTypes) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + 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 SupportedBuildpackResource. func (s SupportedBuildpackResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go b/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go index 28608234a7fd..4a0f48672077 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go @@ -48,7 +48,7 @@ func NewMonitoringSettingsClient(subscriptionID string, credential azcore.TokenC // Get - Get the Monitoring Setting and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -88,7 +88,7 @@ func (client *MonitoringSettingsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +106,7 @@ func (client *MonitoringSettingsClient) getHandleResponse(resp *http.Response) ( // BeginUpdatePatch - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -128,7 +128,7 @@ func (client *MonitoringSettingsClient) BeginUpdatePatch(ctx context.Context, re // UpdatePatch - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *MonitoringSettingsClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, monitoringSettingResource MonitoringSettingResource, options *MonitoringSettingsClientBeginUpdatePatchOptions) (*http.Response, error) { req, err := client.updatePatchCreateRequest(ctx, resourceGroupName, serviceName, monitoringSettingResource, options) if err != nil { @@ -164,7 +164,7 @@ func (client *MonitoringSettingsClient) updatePatchCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, monitoringSettingResource) @@ -173,7 +173,7 @@ func (client *MonitoringSettingsClient) updatePatchCreateRequest(ctx context.Con // BeginUpdatePut - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -195,7 +195,7 @@ func (client *MonitoringSettingsClient) BeginUpdatePut(ctx context.Context, reso // UpdatePut - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *MonitoringSettingsClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, monitoringSettingResource MonitoringSettingResource, options *MonitoringSettingsClientBeginUpdatePutOptions) (*http.Response, error) { req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, monitoringSettingResource, options) if err != nil { @@ -231,7 +231,7 @@ func (client *MonitoringSettingsClient) updatePutCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, monitoringSettingResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client_example_test.go deleted file mode 100644 index dfe250e14d10..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client_example_test.go +++ /dev/null @@ -1,165 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/MonitoringSettings_Get.json -func ExampleMonitoringSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMonitoringSettingsClient().Get(ctx, "myResourceGroup", "myservice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitoringSettingResource = armappplatform.MonitoringSettingResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/monitoringSettings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/monitoringSettings/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.MonitoringSettingProperties{ - // AppInsightsAgentVersions: &armappplatform.ApplicationInsightsAgentVersions{ - // Java: to.Ptr("3.0.0"), - // }, - // AppInsightsInstrumentationKey: to.Ptr("00000000-0000-0000-0000-000000000000"), - // AppInsightsSamplingRate: to.Ptr[float64](10), - // ProvisioningState: to.Ptr(armappplatform.MonitoringSettingStateSucceeded), - // TraceEnabled: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/MonitoringSettings_UpdatePut.json -func ExampleMonitoringSettingsClient_BeginUpdatePut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMonitoringSettingsClient().BeginUpdatePut(ctx, "myResourceGroup", "myservice", armappplatform.MonitoringSettingResource{ - Properties: &armappplatform.MonitoringSettingProperties{ - AppInsightsInstrumentationKey: to.Ptr("00000000-0000-0000-0000-000000000000"), - AppInsightsSamplingRate: to.Ptr[float64](10), - TraceEnabled: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitoringSettingResource = armappplatform.MonitoringSettingResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/monitoringSettings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/monitoringSettings/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.MonitoringSettingProperties{ - // AppInsightsAgentVersions: &armappplatform.ApplicationInsightsAgentVersions{ - // Java: to.Ptr("3.0.0"), - // }, - // AppInsightsInstrumentationKey: to.Ptr("00000000-0000-0000-0000-000000000000"), - // AppInsightsSamplingRate: to.Ptr[float64](10), - // ProvisioningState: to.Ptr(armappplatform.MonitoringSettingStateSucceeded), - // TraceEnabled: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/MonitoringSettings_UpdatePatch.json -func ExampleMonitoringSettingsClient_BeginUpdatePatch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMonitoringSettingsClient().BeginUpdatePatch(ctx, "myResourceGroup", "myservice", armappplatform.MonitoringSettingResource{ - Properties: &armappplatform.MonitoringSettingProperties{ - AppInsightsInstrumentationKey: to.Ptr("00000000-0000-0000-0000-000000000000"), - AppInsightsSamplingRate: to.Ptr[float64](10), - TraceEnabled: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MonitoringSettingResource = armappplatform.MonitoringSettingResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/monitoringSettings"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/monitoringSettings/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.MonitoringSettingProperties{ - // AppInsightsAgentVersions: &armappplatform.ApplicationInsightsAgentVersions{ - // Java: to.Ptr("3.0.0"), - // }, - // AppInsightsInstrumentationKey: to.Ptr("00000000-0000-0000-0000-000000000000"), - // AppInsightsSamplingRate: to.Ptr[float64](10), - // ProvisioningState: to.Ptr(armappplatform.MonitoringSettingStateSucceeded), - // TraceEnabled: to.Ptr(true), - // }, - // } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/operations_client.go b/sdk/resourcemanager/appplatform/armappplatform/operations_client.go index f5b812a12486..d1653564ebb4 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/operations_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available REST API operations of the Microsoft.AppPlatform provider. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-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]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/operations_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/operations_client_example_test.go deleted file mode 100644 index 319176588a8d..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/operations_client_example_test.go +++ /dev/null @@ -1,59 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-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() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailableOperations = armappplatform.AvailableOperations{ - // Value: []*armappplatform.OperationDetail{ - // { - // Name: to.Ptr("Microsoft.AppPlatform/Spring/read"), - // Display: &armappplatform.OperationDisplay{ - // Description: to.Ptr("Create or Update Managed Applications"), - // Operation: to.Ptr("Create or Update Managed Applications"), - // Provider: to.Ptr("Microsoft Azure Distributed Managed Service for Spring"), - // Resource: to.Ptr("Managed Applications"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // Properties: &armappplatform.OperationProperties{ - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go b/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go index b56f75c8c26a..e42f5a08df61 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go +++ b/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go @@ -53,6 +53,24 @@ func unmarshalCertificatePropertiesClassification(rawMsg json.RawMessage) (Certi return b, json.Unmarshal(rawMsg, b) } +func unmarshalContainerRegistryCredentialsClassification(rawMsg json.RawMessage) (ContainerRegistryCredentialsClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ContainerRegistryCredentialsClassification + switch m["type"] { + case "BasicAuth": + b = &ContainerRegistryBasicCredentials{} + default: + b = &ContainerRegistryCredentials{} + } + return b, json.Unmarshal(rawMsg, b) +} + func unmarshalCustomPersistentDiskPropertiesClassification(rawMsg json.RawMessage) (CustomPersistentDiskPropertiesClassification, error) { if rawMsg == nil { return nil, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go b/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go index f14268b54554..ab853237c295 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go @@ -48,7 +48,7 @@ func NewPredefinedAcceleratorsClient(subscriptionID string, credential azcore.To // BeginDisable - Disable predefined accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -71,7 +71,7 @@ func (client *PredefinedAcceleratorsClient) BeginDisable(ctx context.Context, re // Disable - Disable predefined accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *PredefinedAcceleratorsClient) disable(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientBeginDisableOptions) (*http.Response, error) { req, err := client.disableCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, options) if err != nil { @@ -115,7 +115,7 @@ func (client *PredefinedAcceleratorsClient) disableCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,7 +124,7 @@ func (client *PredefinedAcceleratorsClient) disableCreateRequest(ctx context.Con // BeginEnable - Enable predefined accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -147,7 +147,7 @@ func (client *PredefinedAcceleratorsClient) BeginEnable(ctx context.Context, res // Enable - Enable predefined accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *PredefinedAcceleratorsClient) enable(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientBeginEnableOptions) (*http.Response, error) { req, err := client.enableCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, options) if err != nil { @@ -191,7 +191,7 @@ func (client *PredefinedAcceleratorsClient) enableCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +200,7 @@ func (client *PredefinedAcceleratorsClient) enableCreateRequest(ctx context.Cont // Get - Get the predefined accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -251,7 +251,7 @@ func (client *PredefinedAcceleratorsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *PredefinedAcceleratorsClient) getHandleResponse(resp *http.Respons // NewListPager - Handle requests to list all predefined accelerators. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -327,7 +327,7 @@ func (client *PredefinedAcceleratorsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client_example_test.go deleted file mode 100644 index 52d6faf01130..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client_example_test.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/PredefinedAccelerators_List.json -func ExamplePredefinedAcceleratorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPredefinedAcceleratorsClient().NewListPager("myResourceGroup", "myservice", "default", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PredefinedAcceleratorResourceCollection = armappplatform.PredefinedAcceleratorResourceCollection{ - // Value: []*armappplatform.PredefinedAcceleratorResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationAccelerators/predefinedAccelerators"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationAccelerators/default/predefinedAccelerators"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.PredefinedAcceleratorProperties{ - // Description: to.Ptr("acc-desc"), - // AcceleratorTags: []*string{ - // to.Ptr("tag-a"), - // to.Ptr("tag-b")}, - // DisplayName: to.Ptr("acc-name"), - // IconURL: to.Ptr("acc-icon"), - // ProvisioningState: to.Ptr(armappplatform.PredefinedAcceleratorProvisioningStateSucceeded), - // State: to.Ptr(armappplatform.PredefinedAcceleratorStateEnabled), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/PredefinedAccelerators_Get.json -func ExamplePredefinedAcceleratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPredefinedAcceleratorsClient().Get(ctx, "myResourceGroup", "myservice", "default", "acc-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PredefinedAcceleratorResource = armappplatform.PredefinedAcceleratorResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/applicationAccelerators/predefinedAccelerators"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/applicationAccelerators/default/predefinedAccelerators/acc-name"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.PredefinedAcceleratorProperties{ - // Description: to.Ptr("acc-desc"), - // AcceleratorTags: []*string{ - // to.Ptr("tag-a"), - // to.Ptr("tag-b")}, - // DisplayName: to.Ptr("acc-name"), - // IconURL: to.Ptr("acc-icon"), - // ProvisioningState: to.Ptr(armappplatform.PredefinedAcceleratorProvisioningStateSucceeded), - // State: to.Ptr(armappplatform.PredefinedAcceleratorStateEnabled), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Capacity: to.Ptr[int32](2), - // Tier: to.Ptr("Enterprise"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/PredefinedAccelerators_Disable.json -func ExamplePredefinedAcceleratorsClient_BeginDisable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPredefinedAcceleratorsClient().BeginDisable(ctx, "myResourceGroup", "myservice", "default", "acc-name", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/PredefinedAccelerators_Enable.json -func ExamplePredefinedAcceleratorsClient_BeginEnable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPredefinedAcceleratorsClient().BeginEnable(ctx, "myResourceGroup", "myservice", "default", "acc-name", 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/appplatform/armappplatform/response_types.go b/sdk/resourcemanager/appplatform/armappplatform/response_types.go index 22e617e496e4..7865513808f9 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/response_types.go +++ b/sdk/resourcemanager/appplatform/armappplatform/response_types.go @@ -54,6 +54,31 @@ type APIPortalsClientValidateDomainResponse struct { CustomDomainValidateResult } +// ApmsClientCreateOrUpdateResponse contains the response from method ApmsClient.BeginCreateOrUpdate. +type ApmsClientCreateOrUpdateResponse struct { + ApmResource +} + +// ApmsClientDeleteResponse contains the response from method ApmsClient.BeginDelete. +type ApmsClientDeleteResponse struct { + // placeholder for future response values +} + +// ApmsClientGetResponse contains the response from method ApmsClient.Get. +type ApmsClientGetResponse struct { + ApmResource +} + +// ApmsClientListResponse contains the response from method ApmsClient.NewListPager. +type ApmsClientListResponse struct { + ApmResourceCollection +} + +// ApmsClientListSecretKeysResponse contains the response from method ApmsClient.ListSecretKeys. +type ApmsClientListSecretKeysResponse struct { + ApmSecretKeys +} + // ApplicationAcceleratorsClientCreateOrUpdateResponse contains the response from method ApplicationAcceleratorsClient.BeginCreateOrUpdate. type ApplicationAcceleratorsClientCreateOrUpdateResponse struct { ApplicationAcceleratorResource @@ -204,6 +229,16 @@ type BuildServiceClientCreateOrUpdateBuildResponse struct { Build } +// BuildServiceClientCreateOrUpdateResponse contains the response from method BuildServiceClient.BeginCreateOrUpdate. +type BuildServiceClientCreateOrUpdateResponse struct { + BuildService +} + +// BuildServiceClientDeleteBuildResponse contains the response from method BuildServiceClient.BeginDeleteBuild. +type BuildServiceClientDeleteBuildResponse struct { + // placeholder for future response values +} + // BuildServiceClientGetBuildResponse contains the response from method BuildServiceClient.GetBuild. type BuildServiceClientGetBuildResponse struct { Build @@ -354,6 +389,31 @@ type ConfigurationServicesClientValidateResponse struct { ConfigurationServiceSettingsValidateResult } +// ContainerRegistriesClientCreateOrUpdateResponse contains the response from method ContainerRegistriesClient.BeginCreateOrUpdate. +type ContainerRegistriesClientCreateOrUpdateResponse struct { + ContainerRegistryResource +} + +// ContainerRegistriesClientDeleteResponse contains the response from method ContainerRegistriesClient.BeginDelete. +type ContainerRegistriesClientDeleteResponse struct { + // placeholder for future response values +} + +// ContainerRegistriesClientGetResponse contains the response from method ContainerRegistriesClient.Get. +type ContainerRegistriesClientGetResponse struct { + ContainerRegistryResource +} + +// ContainerRegistriesClientListResponse contains the response from method ContainerRegistriesClient.NewListPager. +type ContainerRegistriesClientListResponse struct { + ContainerRegistryResourceCollection +} + +// ContainerRegistriesClientValidateResponse contains the response from method ContainerRegistriesClient.BeginValidate. +type ContainerRegistriesClientValidateResponse struct { + ContainerRegistryValidateResult +} + // CustomDomainsClientCreateOrUpdateResponse contains the response from method CustomDomainsClient.BeginCreateOrUpdate. type CustomDomainsClientCreateOrUpdateResponse struct { CustomDomainResource @@ -504,6 +564,26 @@ type DevToolPortalsClientListResponse struct { DevToolPortalResourceCollection } +// EurekaServersClientGetResponse contains the response from method EurekaServersClient.Get. +type EurekaServersClientGetResponse struct { + EurekaServerResource +} + +// EurekaServersClientListResponse contains the response from method EurekaServersClient.List. +type EurekaServersClientListResponse struct { + EurekaServerResourceCollection +} + +// EurekaServersClientUpdatePatchResponse contains the response from method EurekaServersClient.BeginUpdatePatch. +type EurekaServersClientUpdatePatchResponse struct { + EurekaServerResource +} + +// EurekaServersClientUpdatePutResponse contains the response from method EurekaServersClient.BeginUpdatePut. +type EurekaServersClientUpdatePutResponse struct { + EurekaServerResource +} + // GatewayCustomDomainsClientCreateOrUpdateResponse contains the response from method GatewayCustomDomainsClient.BeginCreateOrUpdate. type GatewayCustomDomainsClientCreateOrUpdateResponse struct { GatewayCustomDomainResource @@ -570,6 +650,11 @@ type GatewaysClientListResponse struct { GatewayResourceCollection } +// GatewaysClientRestartResponse contains the response from method GatewaysClient.BeginRestart. +type GatewaysClientRestartResponse struct { + // placeholder for future response values +} + // GatewaysClientUpdateCapacityResponse contains the response from method GatewaysClient.BeginUpdateCapacity. type GatewaysClientUpdateCapacityResponse struct { GatewayResource @@ -665,11 +750,21 @@ type ServicesClientDeleteResponse struct { // placeholder for future response values } +// ServicesClientDisableApmGloballyResponse contains the response from method ServicesClient.BeginDisableApmGlobally. +type ServicesClientDisableApmGloballyResponse struct { + // placeholder for future response values +} + // ServicesClientDisableTestEndpointResponse contains the response from method ServicesClient.DisableTestEndpoint. type ServicesClientDisableTestEndpointResponse struct { // placeholder for future response values } +// ServicesClientEnableApmGloballyResponse contains the response from method ServicesClient.BeginEnableApmGlobally. +type ServicesClientEnableApmGloballyResponse struct { + // placeholder for future response values +} + // ServicesClientEnableTestEndpointResponse contains the response from method ServicesClient.EnableTestEndpoint. type ServicesClientEnableTestEndpointResponse struct { TestKeys @@ -685,11 +780,21 @@ type ServicesClientListBySubscriptionResponse struct { ServiceResourceList } +// ServicesClientListGloballyEnabledApmsResponse contains the response from method ServicesClient.ListGloballyEnabledApms. +type ServicesClientListGloballyEnabledApmsResponse struct { + GloballyEnabledApms +} + // ServicesClientListResponse contains the response from method ServicesClient.NewListPager. type ServicesClientListResponse struct { ServiceResourceList } +// ServicesClientListSupportedApmTypesResponse contains the response from method ServicesClient.NewListSupportedApmTypesPager. +type ServicesClientListSupportedApmTypesResponse struct { + SupportedApmTypes +} + // ServicesClientListTestKeysResponse contains the response from method ServicesClient.ListTestKeys. type ServicesClientListTestKeysResponse struct { TestKeys diff --git a/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go b/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go index ee6fdd183cd0..e668f6a0131f 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go @@ -41,7 +41,7 @@ func NewRuntimeVersionsClient(credential azcore.TokenCredential, options *arm.Cl // ListRuntimeVersions - Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - options - RuntimeVersionsClientListRuntimeVersionsOptions contains the optional parameters for the RuntimeVersionsClient.ListRuntimeVersions // method. func (client *RuntimeVersionsClient) ListRuntimeVersions(ctx context.Context, options *RuntimeVersionsClientListRuntimeVersionsOptions) (RuntimeVersionsClientListRuntimeVersionsResponse, error) { @@ -67,7 +67,7 @@ func (client *RuntimeVersionsClient) listRuntimeVersionsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client_example_test.go deleted file mode 100644 index c9cb5513973d..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client_example_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/RuntimeVersions_ListRuntimeVersions.json -func ExampleRuntimeVersionsClient_ListRuntimeVersions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRuntimeVersionsClient().ListRuntimeVersions(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailableRuntimeVersions = armappplatform.AvailableRuntimeVersions{ - // Value: []*armappplatform.SupportedRuntimeVersion{ - // { - // Platform: to.Ptr(armappplatform.SupportedRuntimePlatformJava), - // Value: to.Ptr(armappplatform.SupportedRuntimeValueJava8), - // Version: to.Ptr("8"), - // }, - // { - // Platform: to.Ptr(armappplatform.SupportedRuntimePlatformJava), - // Value: to.Ptr(armappplatform.SupportedRuntimeValueJava11), - // Version: to.Ptr("11"), - // }, - // { - // Platform: to.Ptr(armappplatform.SupportedRuntimePlatformJava), - // Value: to.Ptr(armappplatform.SupportedRuntimeValueJava17), - // Version: to.Ptr("17"), - // }, - // { - // Platform: to.Ptr(armappplatform.SupportedRuntimePlatformNETCore), - // Value: to.Ptr(armappplatform.SupportedRuntimeValueNetCore31), - // Version: to.Ptr("3.1"), - // }}, - // } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client.go b/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client.go index 0817d89a4c2d..00a59a2f1fc8 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client.go @@ -48,7 +48,7 @@ func NewServiceRegistriesClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Create the default Service Registry or update the existing Service Registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -70,7 +70,7 @@ func (client *ServiceRegistriesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Create the default Service Registry or update the existing Service Registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ServiceRegistriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, serviceRegistryName string, options *ServiceRegistriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, serviceRegistryName, options) if err != nil { @@ -110,7 +110,7 @@ func (client *ServiceRegistriesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +119,7 @@ func (client *ServiceRegistriesClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Disable the default Service Registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -141,7 +141,7 @@ func (client *ServiceRegistriesClient) BeginDelete(ctx context.Context, resource // Delete - Disable the default Service Registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ServiceRegistriesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, serviceRegistryName string, options *ServiceRegistriesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, serviceRegistryName, options) if err != nil { @@ -181,7 +181,7 @@ func (client *ServiceRegistriesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *ServiceRegistriesClient) deleteCreateRequest(ctx context.Context, // Get - Get the Service Registry and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -235,7 +235,7 @@ func (client *ServiceRegistriesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +252,7 @@ func (client *ServiceRegistriesClient) getHandleResponse(resp *http.Response) (S // NewListPager - Handles requests to list all resources in a Service. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -306,7 +306,7 @@ func (client *ServiceRegistriesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client_example_test.go deleted file mode 100644 index 5dc85c1292a4..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client_example_test.go +++ /dev/null @@ -1,201 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ServiceRegistries_Get.json -func ExampleServiceRegistriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServiceRegistriesClient().Get(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceRegistryResource = armappplatform.ServiceRegistryResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/serviceRegistries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ServiceRegistryProperties{ - // Instances: []*armappplatform.ServiceRegistryInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.ServiceRegistryProvisioningStateSucceeded), - // ResourceRequests: &armappplatform.ServiceRegistryResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](2), - // Memory: to.Ptr("1G"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ServiceRegistries_CreateOrUpdate.json -func ExampleServiceRegistriesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServiceRegistriesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceRegistryResource = armappplatform.ServiceRegistryResource{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/serviceRegistries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ServiceRegistryProperties{ - // Instances: []*armappplatform.ServiceRegistryInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.ServiceRegistryProvisioningStateSucceeded), - // ResourceRequests: &armappplatform.ServiceRegistryResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](2), - // Memory: to.Ptr("1G"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ServiceRegistries_Delete.json -func ExampleServiceRegistriesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServiceRegistriesClient().BeginDelete(ctx, "myResourceGroup", "myservice", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/ServiceRegistries_List.json -func ExampleServiceRegistriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServiceRegistriesClient().NewListPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceRegistryResourceCollection = armappplatform.ServiceRegistryResourceCollection{ - // Value: []*armappplatform.ServiceRegistryResource{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/serviceRegistries"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/default"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.ServiceRegistryProperties{ - // Instances: []*armappplatform.ServiceRegistryInstance{ - // { - // Name: to.Ptr("instance1"), - // Status: to.Ptr("Running"), - // }, - // { - // Name: to.Ptr("instance2"), - // Status: to.Ptr("Running"), - // }}, - // ProvisioningState: to.Ptr(armappplatform.ServiceRegistryProvisioningStateSucceeded), - // ResourceRequests: &armappplatform.ServiceRegistryResourceRequests{ - // CPU: to.Ptr("1"), - // InstanceCount: to.Ptr[int32](2), - // Memory: to.Ptr("1G"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/services_client.go b/sdk/resourcemanager/appplatform/armappplatform/services_client.go index 727d00e7822f..c5691eb89046 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/services_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/services_client.go @@ -48,7 +48,7 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Checks that the resource name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - location - the region // - availabilityParameters - Parameters supplied to the operation. // - options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability @@ -84,7 +84,7 @@ func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, availabilityParameters) @@ -102,7 +102,7 @@ func (client *ServicesClient) checkNameAvailabilityHandleResponse(resp *http.Res // BeginCreateOrUpdate - Create a new Service or update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -124,7 +124,7 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a new Service or update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, resource ServiceResource, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, resource, options) if err != nil { @@ -160,7 +160,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) @@ -169,7 +169,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Operation to delete a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -189,7 +189,7 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Operation to delete a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -225,16 +225,85 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// BeginDisableApmGlobally - Disable an APM globally. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - apm - The target APM for the disable operation +// - options - ServicesClientBeginDisableApmGloballyOptions contains the optional parameters for the ServicesClient.BeginDisableApmGlobally +// method. +func (client *ServicesClient) BeginDisableApmGlobally(ctx context.Context, resourceGroupName string, serviceName string, apm ApmReference, options *ServicesClientBeginDisableApmGloballyOptions) (*runtime.Poller[ServicesClientDisableApmGloballyResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.disableApmGlobally(ctx, resourceGroupName, serviceName, apm, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientDisableApmGloballyResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ServicesClientDisableApmGloballyResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// DisableApmGlobally - Disable an APM globally. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *ServicesClient) disableApmGlobally(ctx context.Context, resourceGroupName string, serviceName string, apm ApmReference, options *ServicesClientBeginDisableApmGloballyOptions) (*http.Response, error) { + req, err := client.disableApmGloballyCreateRequest(ctx, resourceGroupName, serviceName, apm, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// disableApmGloballyCreateRequest creates the DisableApmGlobally request. +func (client *ServicesClient) disableApmGloballyCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apm ApmReference, options *ServicesClientBeginDisableApmGloballyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/disableApmGlobally" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, apm) +} + // DisableTestEndpoint - Disable test endpoint functionality for a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -275,16 +344,85 @@ func (client *ServicesClient) disableTestEndpointCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// BeginEnableApmGlobally - Enable an APM globally. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - apm - The target APM for the enable operation +// - options - ServicesClientBeginEnableApmGloballyOptions contains the optional parameters for the ServicesClient.BeginEnableApmGlobally +// method. +func (client *ServicesClient) BeginEnableApmGlobally(ctx context.Context, resourceGroupName string, serviceName string, apm ApmReference, options *ServicesClientBeginEnableApmGloballyOptions) (*runtime.Poller[ServicesClientEnableApmGloballyResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.enableApmGlobally(ctx, resourceGroupName, serviceName, apm, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientEnableApmGloballyResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[ServicesClientEnableApmGloballyResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// EnableApmGlobally - Enable an APM globally. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +func (client *ServicesClient) enableApmGlobally(ctx context.Context, resourceGroupName string, serviceName string, apm ApmReference, options *ServicesClientBeginEnableApmGloballyOptions) (*http.Response, error) { + req, err := client.enableApmGloballyCreateRequest(ctx, resourceGroupName, serviceName, apm, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// enableApmGloballyCreateRequest creates the EnableApmGlobally request. +func (client *ServicesClient) enableApmGloballyCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apm ApmReference, options *ServicesClientBeginEnableApmGloballyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/enableApmGlobally" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, apm) +} + // EnableTestEndpoint - Enable test endpoint functionality for a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -325,7 +463,7 @@ func (client *ServicesClient) enableTestEndpointCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -343,7 +481,7 @@ func (client *ServicesClient) enableTestEndpointHandleResponse(resp *http.Respon // Get - Get a Service and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -383,7 +521,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -400,7 +538,7 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // NewListPager - Handles requests to list all resources in a resource group. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - options - ServicesClientListOptions contains the optional parameters for the ServicesClient.NewListPager method. @@ -448,7 +586,7 @@ func (client *ServicesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -465,7 +603,7 @@ func (client *ServicesClient) listHandleResponse(resp *http.Response) (ServicesC // NewListBySubscriptionPager - Handles requests to list all resources in a subscription. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager // method. func (client *ServicesClient) NewListBySubscriptionPager(options *ServicesClientListBySubscriptionOptions) *runtime.Pager[ServicesClientListBySubscriptionResponse] { @@ -508,7 +646,7 @@ func (client *ServicesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -523,10 +661,140 @@ func (client *ServicesClient) listBySubscriptionHandleResponse(resp *http.Respon return result, nil } +// ListGloballyEnabledApms - List globally enabled APMs for a Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - options - ServicesClientListGloballyEnabledApmsOptions contains the optional parameters for the ServicesClient.ListGloballyEnabledApms +// method. +func (client *ServicesClient) ListGloballyEnabledApms(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientListGloballyEnabledApmsOptions) (ServicesClientListGloballyEnabledApmsResponse, error) { + req, err := client.listGloballyEnabledApmsCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return ServicesClientListGloballyEnabledApmsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServicesClientListGloballyEnabledApmsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServicesClientListGloballyEnabledApmsResponse{}, runtime.NewResponseError(resp) + } + return client.listGloballyEnabledApmsHandleResponse(resp) +} + +// listGloballyEnabledApmsCreateRequest creates the ListGloballyEnabledApms request. +func (client *ServicesClient) listGloballyEnabledApmsCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientListGloballyEnabledApmsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/listGloballyEnabledApms" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listGloballyEnabledApmsHandleResponse handles the ListGloballyEnabledApms response. +func (client *ServicesClient) listGloballyEnabledApmsHandleResponse(resp *http.Response) (ServicesClientListGloballyEnabledApmsResponse, error) { + result := ServicesClientListGloballyEnabledApmsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GloballyEnabledApms); err != nil { + return ServicesClientListGloballyEnabledApmsResponse{}, err + } + return result, nil +} + +// NewListSupportedApmTypesPager - List supported APM types for a Service. +// +// Generated from API version 2023-05-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - options - ServicesClientListSupportedApmTypesOptions contains the optional parameters for the ServicesClient.NewListSupportedApmTypesPager +// method. +func (client *ServicesClient) NewListSupportedApmTypesPager(resourceGroupName string, serviceName string, options *ServicesClientListSupportedApmTypesOptions) *runtime.Pager[ServicesClientListSupportedApmTypesResponse] { + return runtime.NewPager(runtime.PagingHandler[ServicesClientListSupportedApmTypesResponse]{ + More: func(page ServicesClientListSupportedApmTypesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServicesClientListSupportedApmTypesResponse) (ServicesClientListSupportedApmTypesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listSupportedApmTypesCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ServicesClientListSupportedApmTypesResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServicesClientListSupportedApmTypesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServicesClientListSupportedApmTypesResponse{}, runtime.NewResponseError(resp) + } + return client.listSupportedApmTypesHandleResponse(resp) + }, + }) +} + +// listSupportedApmTypesCreateRequest creates the ListSupportedApmTypes request. +func (client *ServicesClient) listSupportedApmTypesCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientListSupportedApmTypesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedApmTypes" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSupportedApmTypesHandleResponse handles the ListSupportedApmTypes response. +func (client *ServicesClient) listSupportedApmTypesHandleResponse(resp *http.Response) (ServicesClientListSupportedApmTypesResponse, error) { + result := ServicesClientListSupportedApmTypesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SupportedApmTypes); err != nil { + return ServicesClientListSupportedApmTypesResponse{}, err + } + return result, nil +} + // ListTestKeys - List test keys for a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -566,7 +834,7 @@ func (client *ServicesClient) listTestKeysCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -584,7 +852,7 @@ func (client *ServicesClient) listTestKeysHandleResponse(resp *http.Response) (S // RegenerateTestKey - Regenerate a test key for a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -626,7 +894,7 @@ func (client *ServicesClient) regenerateTestKeyCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regenerateTestKeyRequest) @@ -644,7 +912,7 @@ func (client *ServicesClient) regenerateTestKeyHandleResponse(resp *http.Respons // BeginStart - Start a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -664,7 +932,7 @@ func (client *ServicesClient) BeginStart(ctx context.Context, resourceGroupName // Start - Start a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ServicesClient) start(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -700,7 +968,7 @@ func (client *ServicesClient) startCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -709,7 +977,7 @@ func (client *ServicesClient) startCreateRequest(ctx context.Context, resourceGr // BeginStop - Stop a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -729,7 +997,7 @@ func (client *ServicesClient) BeginStop(ctx context.Context, resourceGroupName s // Stop - Stop a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ServicesClient) stop(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -765,7 +1033,7 @@ func (client *ServicesClient) stopCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -774,7 +1042,7 @@ func (client *ServicesClient) stopCreateRequest(ctx context.Context, resourceGro // BeginUpdate - Operation to update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -795,7 +1063,7 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Operation to update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *ServicesClient) update(ctx context.Context, resourceGroupName string, serviceName string, resource ServiceResource, options *ServicesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, resource, options) if err != nil { @@ -831,7 +1099,7 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/services_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/services_client_example_test.go deleted file mode 100644 index 8314b4ba21e7..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/services_client_example_test.go +++ /dev/null @@ -1,1026 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_Get.json -func ExampleServicesClient_Get_servicesGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Get(ctx, "myResourceGroup", "myservice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceResource = armappplatform.ServiceResource{ - // Name: to.Ptr("myservice"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armappplatform.ClusterResourceProperties{ - // NetworkProfile: &armappplatform.NetworkProfile{ - // IngressConfig: &armappplatform.IngressConfig{ - // ReadTimeoutInSeconds: to.Ptr[int32](300), - // }, - // OutboundIPs: &armappplatform.NetworkProfileOutboundIPs{ - // PublicIPs: []*string{ - // to.Ptr("20.39.3.173"), - // to.Ptr("40.64.67.13")}, - // }, - // RequiredTraffics: []*armappplatform.RequiredTraffic{ - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](1194), - // Protocol: to.Ptr("UDP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](9000), - // Protocol: to.Ptr("TCP"), - // }}, - // }, - // ProvisioningState: to.Ptr(armappplatform.ProvisioningStateSucceeded), - // ServiceID: to.Ptr("12345678abcd1234abcd12345678abcd"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_Get_Consumption.json -func ExampleServicesClient_Get_servicesGetConsumption() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Get(ctx, "myResourceGroup", "myservice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceResource = armappplatform.ServiceResource{ - // Name: to.Ptr("myservice"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armappplatform.ClusterResourceProperties{ - // InfraResourceGroup: to.Ptr("myenvironment_SpringApps_12345678abcd1234abcd12345678abcd"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.App/managedEnvironments/myenvironment"), - // ProvisioningState: to.Ptr(armappplatform.ProvisioningStateSucceeded), - // ServiceID: to.Ptr("12345678abcd1234abcd12345678abcd"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Tier: to.Ptr("StandardGen2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_CreateOrUpdate.json -func ExampleServicesClient_BeginCreateOrUpdate_servicesCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", armappplatform.ServiceResource{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armappplatform.ClusterResourceProperties{}, - SKU: &armappplatform.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceResource = armappplatform.ServiceResource{ - // Name: to.Ptr("myservice"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armappplatform.ClusterResourceProperties{ - // NetworkProfile: &armappplatform.NetworkProfile{ - // OutboundIPs: &armappplatform.NetworkProfileOutboundIPs{ - // PublicIPs: []*string{ - // to.Ptr("20.39.3.173"), - // to.Ptr("40.64.67.13")}, - // }, - // RequiredTraffics: []*armappplatform.RequiredTraffic{ - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](1194), - // Protocol: to.Ptr("UDP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](9000), - // Protocol: to.Ptr("TCP"), - // }}, - // }, - // ProvisioningState: to.Ptr(armappplatform.ProvisioningStateSucceeded), - // ServiceID: to.Ptr("12345678abcd1234abcd12345678abcd"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_CreateOrUpdate_Consumption.json -func ExampleServicesClient_BeginCreateOrUpdate_servicesCreateOrUpdateConsumption() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", armappplatform.ServiceResource{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armappplatform.ClusterResourceProperties{ - ManagedEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.App/managedEnvironments/myenvironment"), - }, - SKU: &armappplatform.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("StandardGen2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceResource = armappplatform.ServiceResource{ - // Name: to.Ptr("myservice"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armappplatform.ClusterResourceProperties{ - // InfraResourceGroup: to.Ptr("myenvironment_SpringApps_12345678abcd1234abcd12345678abcd"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.App/managedEnvironments/myenvironment"), - // ProvisioningState: to.Ptr(armappplatform.ProvisioningStateSucceeded), - // ServiceID: to.Ptr("12345678abcd1234abcd12345678abcd"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Tier: to.Ptr("StandardGen2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_CreateOrUpdate_Enterprise.json -func ExampleServicesClient_BeginCreateOrUpdate_servicesCreateOrUpdateEnterprise() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", armappplatform.ServiceResource{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armappplatform.ClusterResourceProperties{ - MarketplaceResource: &armappplatform.MarketplaceResource{ - Plan: to.Ptr("tanzu-asc-ent-mtr"), - Product: to.Ptr("azure-spring-cloud-vmware-tanzu-2"), - Publisher: to.Ptr("vmware-inc"), - }, - }, - SKU: &armappplatform.SKU{ - Name: to.Ptr("E0"), - Tier: to.Ptr("Enterprise"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceResource = armappplatform.ServiceResource{ - // Name: to.Ptr("myservice"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armappplatform.ClusterResourceProperties{ - // MarketplaceResource: &armappplatform.MarketplaceResource{ - // Plan: to.Ptr("tanzu-asc-ent-mtr"), - // Product: to.Ptr("azure-spring-cloud-vmware-tanzu-2"), - // Publisher: to.Ptr("vmware-inc"), - // }, - // NetworkProfile: &armappplatform.NetworkProfile{ - // OutboundIPs: &armappplatform.NetworkProfileOutboundIPs{ - // PublicIPs: []*string{ - // to.Ptr("20.39.3.173"), - // to.Ptr("40.64.67.13")}, - // }, - // RequiredTraffics: []*armappplatform.RequiredTraffic{ - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](1194), - // Protocol: to.Ptr("UDP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](9000), - // Protocol: to.Ptr("TCP"), - // }}, - // }, - // ProvisioningState: to.Ptr(armappplatform.ProvisioningStateSucceeded), - // ServiceID: to.Ptr("12345678abcd1234abcd12345678abcd"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("E0"), - // Tier: to.Ptr("Enterprise"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_CreateOrUpdate_VNetInjection.json -func ExampleServicesClient_BeginCreateOrUpdate_servicesCreateOrUpdateVNetInjection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", armappplatform.ServiceResource{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armappplatform.ClusterResourceProperties{ - NetworkProfile: &armappplatform.NetworkProfile{ - AppNetworkResourceGroup: to.Ptr("my-app-network-rg"), - AppSubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/apps"), - IngressConfig: &armappplatform.IngressConfig{ - ReadTimeoutInSeconds: to.Ptr[int32](300), - }, - ServiceCidr: to.Ptr("10.8.0.0/16,10.244.0.0/16,10.245.0.1/16"), - ServiceRuntimeNetworkResourceGroup: to.Ptr("my-service-runtime-network-rg"), - ServiceRuntimeSubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime"), - }, - VnetAddons: &armappplatform.ServiceVNetAddons{ - LogStreamPublicEndpoint: to.Ptr(true), - }, - }, - SKU: &armappplatform.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceResource = armappplatform.ServiceResource{ - // Name: to.Ptr("myservice"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armappplatform.ClusterResourceProperties{ - // NetworkProfile: &armappplatform.NetworkProfile{ - // AppNetworkResourceGroup: to.Ptr("my-app-network-rg"), - // AppSubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/apps"), - // OutboundIPs: &armappplatform.NetworkProfileOutboundIPs{ - // PublicIPs: []*string{ - // to.Ptr("40.64.67.13")}, - // }, - // RequiredTraffics: []*armappplatform.RequiredTraffic{ - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](1194), - // Protocol: to.Ptr("UDP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](9000), - // Protocol: to.Ptr("TCP"), - // }}, - // ServiceCidr: to.Ptr("10.8.0.0/16,10.244.0.0/16,10.245.0.1/16"), - // ServiceRuntimeNetworkResourceGroup: to.Ptr("my-service-runtime-network-rg"), - // ServiceRuntimeSubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime"), - // }, - // ProvisioningState: to.Ptr(armappplatform.ProvisioningStateSucceeded), - // ServiceID: to.Ptr("12345678abcd1234abcd12345678abcd"), - // VnetAddons: &armappplatform.ServiceVNetAddons{ - // LogStreamPublicEndpoint: to.Ptr(true), - // }, - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_Delete.json -func ExampleServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginDelete(ctx, "myResourceGroup", "myservice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_Update.json -func ExampleServicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginUpdate(ctx, "myResourceGroup", "myservice", armappplatform.ServiceResource{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armappplatform.ClusterResourceProperties{}, - SKU: &armappplatform.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServiceResource = armappplatform.ServiceResource{ - // Name: to.Ptr("myservice"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armappplatform.ClusterResourceProperties{ - // NetworkProfile: &armappplatform.NetworkProfile{ - // OutboundIPs: &armappplatform.NetworkProfileOutboundIPs{ - // PublicIPs: []*string{ - // to.Ptr("20.39.3.173"), - // to.Ptr("40.64.67.13")}, - // }, - // RequiredTraffics: []*armappplatform.RequiredTraffic{ - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](1194), - // Protocol: to.Ptr("UDP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](9000), - // Protocol: to.Ptr("TCP"), - // }}, - // }, - // ProvisioningState: to.Ptr(armappplatform.ProvisioningStateSucceeded), - // ServiceID: to.Ptr("12345678abcd1234abcd12345678abcd"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_ListTestKeys.json -func ExampleServicesClient_ListTestKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().ListTestKeys(ctx, "myResourceGroup", "myservice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TestKeys = armappplatform.TestKeys{ - // Enabled: to.Ptr(true), - // PrimaryKey: to.Ptr(""), - // PrimaryTestEndpoint: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // SecondaryTestEndpoint: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_RegenerateTestKey.json -func ExampleServicesClient_RegenerateTestKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().RegenerateTestKey(ctx, "myResourceGroup", "myservice", armappplatform.RegenerateTestKeyRequestPayload{ - KeyType: to.Ptr(armappplatform.TestKeyTypePrimary), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TestKeys = armappplatform.TestKeys{ - // Enabled: to.Ptr(true), - // PrimaryKey: to.Ptr(""), - // PrimaryTestEndpoint: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // SecondaryTestEndpoint: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_DisableTestEndpoint.json -func ExampleServicesClient_DisableTestEndpoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewServicesClient().DisableTestEndpoint(ctx, "myResourceGroup", "myservice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_EnableTestEndpoint.json -func ExampleServicesClient_EnableTestEndpoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().EnableTestEndpoint(ctx, "myResourceGroup", "myservice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TestKeys = armappplatform.TestKeys{ - // Enabled: to.Ptr(true), - // PrimaryKey: to.Ptr(""), - // PrimaryTestEndpoint: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // SecondaryTestEndpoint: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_Stop.json -func ExampleServicesClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginStop(ctx, "myResourceGroup", "myservice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_Start.json -func ExampleServicesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginStart(ctx, "myResourceGroup", "myservice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_CheckNameAvailability.json -func ExampleServicesClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().CheckNameAvailability(ctx, "eastus", armappplatform.NameAvailabilityParameters{ - Name: to.Ptr("myservice"), - Type: to.Ptr("Microsoft.AppPlatform/Spring"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NameAvailability = armappplatform.NameAvailability{ - // Message: to.Ptr("The name is already used."), - // NameAvailable: to.Ptr(false), - // Reason: to.Ptr("AlreadyExists"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_ListBySubscription.json -func ExampleServicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceResourceList = armappplatform.ServiceResourceList{ - // Value: []*armappplatform.ServiceResource{ - // { - // Name: to.Ptr("myservice"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armappplatform.ClusterResourceProperties{ - // NetworkProfile: &armappplatform.NetworkProfile{ - // IngressConfig: &armappplatform.IngressConfig{ - // ReadTimeoutInSeconds: to.Ptr[int32](300), - // }, - // OutboundIPs: &armappplatform.NetworkProfileOutboundIPs{ - // PublicIPs: []*string{ - // to.Ptr("20.39.3.173"), - // to.Ptr("40.64.67.13")}, - // }, - // RequiredTraffics: []*armappplatform.RequiredTraffic{ - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](1194), - // Protocol: to.Ptr("UDP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](9000), - // Protocol: to.Ptr("TCP"), - // }}, - // }, - // ProvisioningState: to.Ptr(armappplatform.ProvisioningStateSucceeded), - // ServiceID: to.Ptr("12345678abcd1234abcd12345678abcd"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("myservice1"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice1"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armappplatform.ClusterResourceProperties{ - // InfraResourceGroup: to.Ptr("myenvironment_SpringApps_12345678abcd1234abcd12345678abc1"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.App/managedEnvironments/myenvironment"), - // ProvisioningState: to.Ptr(armappplatform.ProvisioningStateSucceeded), - // ServiceID: to.Ptr("12345678abcd1234abcd12345678abc1"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Tier: to.Ptr("StandardGen2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Services_List.json -func ExampleServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceResourceList = armappplatform.ServiceResourceList{ - // Value: []*armappplatform.ServiceResource{ - // { - // Name: to.Ptr("myservice"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armappplatform.ClusterResourceProperties{ - // NetworkProfile: &armappplatform.NetworkProfile{ - // IngressConfig: &armappplatform.IngressConfig{ - // ReadTimeoutInSeconds: to.Ptr[int32](300), - // }, - // OutboundIPs: &armappplatform.NetworkProfileOutboundIPs{ - // PublicIPs: []*string{ - // to.Ptr("20.39.3.173"), - // to.Ptr("40.64.67.13")}, - // }, - // RequiredTraffics: []*armappplatform.RequiredTraffic{ - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](443), - // Protocol: to.Ptr("TCP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](1194), - // Protocol: to.Ptr("UDP"), - // }, - // { - // Direction: to.Ptr(armappplatform.TrafficDirectionOutbound), - // IPs: []*string{ - // to.Ptr("20.62.211.25"), - // to.Ptr("52.188.47.226")}, - // Port: to.Ptr[int32](9000), - // Protocol: to.Ptr("TCP"), - // }}, - // }, - // ProvisioningState: to.Ptr(armappplatform.ProvisioningStateSucceeded), - // ServiceID: to.Ptr("12345678abcd1234abcd12345678abcd"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("myservice1"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice1"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("value1"), - // }, - // Properties: &armappplatform.ClusterResourceProperties{ - // InfraResourceGroup: to.Ptr("myenvironment_SpringApps_12345678abcd1234abcd12345678abc1"), - // ManagedEnvironmentID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.App/managedEnvironments/myenvironment"), - // ProvisioningState: to.Ptr(armappplatform.ProvisioningStateSucceeded), - // ServiceID: to.Ptr("12345678abcd1234abcd12345678abc1"), - // }, - // SKU: &armappplatform.SKU{ - // Name: to.Ptr("S0"), - // Tier: to.Ptr("StandardGen2"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/skus_client.go b/sdk/resourcemanager/appplatform/armappplatform/skus_client.go index eb178fb7e147..acb10cca7255 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/skus_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/skus_client.go @@ -47,7 +47,7 @@ func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, opt // NewListPager - Lists all of the available skus of the Microsoft.AppPlatform provider. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - options - SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method. func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SKUsClientListResponse]{ @@ -89,7 +89,7 @@ func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/skus_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/skus_client_example_test.go deleted file mode 100644 index e7275f6ebf7a..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/skus_client_example_test.go +++ /dev/null @@ -1,69 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Skus_List.json -func ExampleSKUsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSKUsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceSKUCollection = armappplatform.ResourceSKUCollection{ - // Value: []*armappplatform.ResourceSKU{ - // { - // Name: to.Ptr("B0"), - // Capacity: &armappplatform.SKUCapacity{ - // Default: to.Ptr[int32](1), - // Maximum: to.Ptr[int32](20), - // Minimum: to.Ptr[int32](1), - // ScaleType: to.Ptr(armappplatform.SKUScaleTypeAutomatic), - // }, - // LocationInfo: []*armappplatform.ResourceSKULocationInfo{ - // { - // Location: to.Ptr("eastus"), - // ZoneDetails: []*armappplatform.ResourceSKUZoneDetails{ - // }, - // Zones: []*string{ - // }, - // }}, - // Locations: []*string{ - // to.Ptr("eastus")}, - // ResourceType: to.Ptr("Spring"), - // Restrictions: []*armappplatform.ResourceSKURestrictions{ - // }, - // Tier: to.Ptr("Basic"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/storages_client.go b/sdk/resourcemanager/appplatform/armappplatform/storages_client.go index 425aba62994a..74bc2c5f10f6 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/storages_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/storages_client.go @@ -48,7 +48,7 @@ func NewStoragesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update storage resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -71,7 +71,7 @@ func (client *StoragesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update storage resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *StoragesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, storageName string, storageResource StorageResource, options *StoragesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, storageName, storageResource, options) if err != nil { @@ -111,7 +111,7 @@ func (client *StoragesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, storageResource) @@ -120,7 +120,7 @@ func (client *StoragesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete the storage resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -141,7 +141,7 @@ func (client *StoragesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete the storage resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview func (client *StoragesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, storageName, options) if err != nil { @@ -181,7 +181,7 @@ func (client *StoragesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *StoragesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the storage resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -235,7 +235,7 @@ func (client *StoragesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +252,7 @@ func (client *StoragesClient) getHandleResponse(resp *http.Response) (StoragesCl // NewListPager - List all the storages of one Azure Spring Apps resource. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2023-05-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -305,7 +305,7 @@ func (client *StoragesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/storages_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/storages_client_example_test.go deleted file mode 100644 index 176c20d890fc..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/storages_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armappplatform_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/appplatform/armappplatform/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Storages_Get.json -func ExampleStoragesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStoragesClient().Get(ctx, "myResourceGroup", "myservice", "mystorage", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageResource = armappplatform.StorageResource{ - // Name: to.Ptr("mystorage"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/storages"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/storages/mystorage"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.StorageAccount{ - // StorageType: to.Ptr(armappplatform.StorageTypeStorageAccount), - // AccountName: to.Ptr("storage-account-name"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Storages_CreateOrUpdate.json -func ExampleStoragesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStoragesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "mystorage", armappplatform.StorageResource{ - Properties: &armappplatform.StorageAccount{ - StorageType: to.Ptr(armappplatform.StorageTypeStorageAccount), - AccountKey: to.Ptr("account-key-of-storage-account"), - AccountName: to.Ptr("storage-account-name"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageResource = armappplatform.StorageResource{ - // Name: to.Ptr("mystorage"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/storages"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/storages/mystorage"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.StorageAccount{ - // StorageType: to.Ptr(armappplatform.StorageTypeStorageAccount), - // AccountName: to.Ptr("storage-account-name"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Storages_Delete.json -func ExampleStoragesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStoragesClient().BeginDelete(ctx, "myResourceGroup", "myservice", "mystorage", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1f22d4dbd99b0fe347ad79e79d4eb1ed44a87291/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2023-01-01-preview/examples/Storages_List.json -func ExampleStoragesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armappplatform.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStoragesClient().NewListPager("myResourceGroup", "myservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.StorageResourceCollection = armappplatform.StorageResourceCollection{ - // Value: []*armappplatform.StorageResource{ - // { - // Name: to.Ptr("mystorage"), - // Type: to.Ptr("Microsoft.AppPlatform/Spring/storages"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/storages/mystorage"), - // SystemData: &armappplatform.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:16:03.944Z"); return t}()), - // CreatedBy: to.Ptr("sample-user"), - // CreatedByType: to.Ptr(armappplatform.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-11T03:17:03.944Z"); return t}()), - // LastModifiedBy: to.Ptr("sample-user"), - // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), - // }, - // Properties: &armappplatform.StorageAccount{ - // StorageType: to.Ptr(armappplatform.StorageTypeStorageAccount), - // AccountName: to.Ptr("storage-account-name"), - // }, - // }}, - // } - } -}