diff --git a/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md b/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md index 79bfba8a6bbe..ffd87f6e42da 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md +++ b/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md @@ -1,5 +1,95 @@ # Release History +## 2.0.0-beta.2 (2023-08-16) +### Breaking Changes + +- Field `Instances`, `ResourceRequests` of struct `DevToolPortalProperties` has been removed + +### 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 `Frequency` with values `FrequencyWeekly` +- New enum type `GatewayCertificateVerification` with values `GatewayCertificateVerificationDisabled`, `GatewayCertificateVerificationEnabled` +- New enum type `GitImplementation` with values `GitImplementationGoGit`, `GitImplementationLibgit2` +- New enum type `WeekDay` with values `WeekDayFriday`, `WeekDayMonday`, `WeekDaySaturday`, `WeekDaySunday`, `WeekDayThursday`, `WeekDayTuesday`, `WeekDayWednesday` +- 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 `*ConfigurationServicesClient.BeginValidateResource(context.Context, string, string, string, ConfigurationServiceResource, *ConfigurationServicesClientBeginValidateResourceOptions) (*runtime.Poller[ConfigurationServicesClientValidateResourceResponse], error)` +- 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 `*MaintenanceScheduleConfiguration.GetMaintenanceScheduleConfiguration() *MaintenanceScheduleConfiguration` +- 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.BeginFlushVnetDNSSetting(context.Context, string, string, *ServicesClientBeginFlushVnetDNSSettingOptions) (*runtime.Poller[ServicesClientFlushVnetDNSSettingResponse], error)` +- New function `*ServicesClient.ListGloballyEnabledApms(context.Context, string, string, *ServicesClientListGloballyEnabledApmsOptions) (ServicesClientListGloballyEnabledApmsResponse, error)` +- New function `*ServicesClient.NewListSupportedApmTypesPager(string, string, *ServicesClientListSupportedApmTypesOptions) *runtime.Pager[ServicesClientListSupportedApmTypesResponse]` +- New function `*WarUploadedUserSourceInfo.GetUploadedUserSourceInfo() *UploadedUserSourceInfo` +- New function `*WarUploadedUserSourceInfo.GetUserSourceInfo() *UserSourceInfo` +- New function `*WeeklyMaintenanceScheduleConfiguration.GetMaintenanceScheduleConfiguration() *MaintenanceScheduleConfiguration` +- 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 `DevToolPortalComponent` +- New struct `EurekaServerProperties` +- New struct `EurekaServerResource` +- New struct `EurekaServerResourceCollection` +- New struct `GatewayPropertiesClientAuth` +- New struct `GloballyEnabledApms` +- New struct `SupportedApmType` +- New struct `SupportedApmTypes` +- New struct `WarUploadedUserSourceInfo` +- New struct `WeeklyMaintenanceScheduleConfiguration` +- 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 `MaintenanceScheduleConfiguration` in struct `ClusterResourceProperties` +- 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 `Components` in struct `DevToolPortalProperties` +- 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..50bae22ef3eb 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -63,7 +62,8 @@ func (client *APIPortalCustomDomainsClient) BeginCreateOrUpdate(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller[APIPortalCustomDomainsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[APIPortalCustomDomainsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[APIPortalCustomDomainsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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-09-01-preview func (client *APIPortalCustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, apiPortalCustomDomainResource APIPortalCustomDomainResource, options *APIPortalCustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -116,16 +118,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, apiPortalCustomDomainResource) + if err := runtime.MarshalAsJSON(req, apiPortalCustomDomainResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -139,7 +144,8 @@ func (client *APIPortalCustomDomainsClient) BeginDelete(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller[APIPortalCustomDomainsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[APIPortalCustomDomainsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[APIPortalCustomDomainsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -148,20 +154,22 @@ 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-09-01-preview func (client *APIPortalCustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, domainName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -192,7 +200,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +209,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-09-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. @@ -210,18 +218,21 @@ func (client *APIPortalCustomDomainsClient) deleteCreateRequest(ctx context.Cont // - options - APIPortalCustomDomainsClientGetOptions contains the optional parameters for the APIPortalCustomDomainsClient.Get // method. func (client *APIPortalCustomDomainsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientGetOptions) (APIPortalCustomDomainsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, domainName, options) if err != nil { return APIPortalCustomDomainsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIPortalCustomDomainsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIPortalCustomDomainsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIPortalCustomDomainsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -252,7 +263,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +280,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-09-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 +339,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-09-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..a9ec71ba74ad 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/apiportals_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/apiportals_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -62,7 +61,8 @@ func (client *APIPortalsClient) BeginCreateOrUpdate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[APIPortalsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[APIPortalsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[APIPortalsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ 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-09-01-preview func (client *APIPortalsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, apiPortalResource APIPortalResource, options *APIPortalsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, apiPortalResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, apiPortalResource) + if err := runtime.MarshalAsJSON(req, apiPortalResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -132,7 +137,8 @@ func (client *APIPortalsClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller[APIPortalsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[APIPortalsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[APIPortalsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -141,20 +147,22 @@ 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-09-01-preview func (client *APIPortalsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,7 +189,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,25 +198,28 @@ 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-09-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. // - apiPortalName - The name of API portal. // - options - APIPortalsClientGetOptions contains the optional parameters for the APIPortalsClient.Get method. func (client *APIPortalsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientGetOptions) (APIPortalsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, options) if err != nil { return APIPortalsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIPortalsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIPortalsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIPortalsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -235,7 +246,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +263,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-09-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 +316,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +334,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-09-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. @@ -332,18 +343,21 @@ func (client *APIPortalsClient) listHandleResponse(resp *http.Response) (APIPort // - options - APIPortalsClientValidateDomainOptions contains the optional parameters for the APIPortalsClient.ValidateDomain // method. func (client *APIPortalsClient) ValidateDomain(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, validatePayload CustomDomainValidatePayload, options *APIPortalsClientValidateDomainOptions) (APIPortalsClientValidateDomainResponse, error) { + var err error req, err := client.validateDomainCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, validatePayload, options) if err != nil { return APIPortalsClientValidateDomainResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return APIPortalsClientValidateDomainResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APIPortalsClientValidateDomainResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APIPortalsClientValidateDomainResponse{}, err } - return client.validateDomainHandleResponse(resp) + resp, err := client.validateDomainHandleResponse(httpResp) + return resp, err } // validateDomainCreateRequest creates the ValidateDomain request. @@ -370,10 +384,13 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, validatePayload) + if err := runtime.MarshalAsJSON(req, validatePayload); err != nil { + return nil, err + } + return req, nil } // validateDomainHandleResponse handles the ValidateDomain response. 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..b11b8917ab25 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/apms_client.go @@ -0,0 +1,400 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package 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-09-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 + } + poller, err := runtime.NewPoller[ApmsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } 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-09-01-preview +func (client *ApmsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apmName string, apmResource ApmResource, options *ApmsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apmName, apmResource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *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-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, apmResource); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Operation to delete an APM +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApmsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } 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-09-01-preview +func (client *ApmsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, apmName string, options *ApmsClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apmName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, 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-09-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-09-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) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apmName, options) + if err != nil { + return ApmsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApmsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApmsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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-09-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-09-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-09-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-09-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) { + var err error + req, err := client.listSecretKeysCreateRequest(ctx, resourceGroupName, serviceName, apmName, options) + if err != nil { + return ApmsClientListSecretKeysResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApmsClientListSecretKeysResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApmsClientListSecretKeysResponse{}, err + } + resp, err := client.listSecretKeysHandleResponse(httpResp) + return resp, err +} + +// 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-09-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..b7bae1b23283 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -62,7 +61,8 @@ func (client *ApplicationAcceleratorsClient) BeginCreateOrUpdate(ctx context.Con if err != nil { return nil, err } - return runtime.NewPoller[ApplicationAcceleratorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationAcceleratorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationAcceleratorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ 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-09-01-preview func (client *ApplicationAcceleratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, applicationAcceleratorResource ApplicationAcceleratorResource, options *ApplicationAcceleratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, applicationAcceleratorResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, applicationAcceleratorResource) + if err := runtime.MarshalAsJSON(req, applicationAcceleratorResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -133,7 +138,8 @@ func (client *ApplicationAcceleratorsClient) BeginDelete(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller[ApplicationAcceleratorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationAcceleratorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationAcceleratorsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,20 +148,22 @@ 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-09-01-preview func (client *ApplicationAcceleratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, options *ApplicationAcceleratorsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -182,7 +190,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +199,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-09-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. @@ -199,18 +207,21 @@ func (client *ApplicationAcceleratorsClient) deleteCreateRequest(ctx context.Con // - options - ApplicationAcceleratorsClientGetOptions contains the optional parameters for the ApplicationAcceleratorsClient.Get // method. func (client *ApplicationAcceleratorsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, options *ApplicationAcceleratorsClientGetOptions) (ApplicationAcceleratorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, options) if err != nil { return ApplicationAcceleratorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationAcceleratorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationAcceleratorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApplicationAcceleratorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -237,7 +248,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +265,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-09-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 +319,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-09-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..adbe4899e708 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -62,7 +61,8 @@ func (client *ApplicationLiveViewsClient) BeginCreateOrUpdate(ctx context.Contex if err != nil { return nil, err } - return runtime.NewPoller[ApplicationLiveViewsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationLiveViewsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationLiveViewsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ 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-09-01-preview func (client *ApplicationLiveViewsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, applicationLiveViewResource ApplicationLiveViewResource, options *ApplicationLiveViewsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, applicationLiveViewName, applicationLiveViewResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, applicationLiveViewResource) + if err := runtime.MarshalAsJSON(req, applicationLiveViewResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -133,7 +138,8 @@ func (client *ApplicationLiveViewsClient) BeginDelete(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller[ApplicationLiveViewsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ApplicationLiveViewsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ApplicationLiveViewsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,20 +148,22 @@ 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-09-01-preview func (client *ApplicationLiveViewsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, options *ApplicationLiveViewsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, applicationLiveViewName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -182,7 +190,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +199,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-09-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. @@ -199,18 +207,21 @@ func (client *ApplicationLiveViewsClient) deleteCreateRequest(ctx context.Contex // - options - ApplicationLiveViewsClientGetOptions contains the optional parameters for the ApplicationLiveViewsClient.Get // method. func (client *ApplicationLiveViewsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, options *ApplicationLiveViewsClientGetOptions) (ApplicationLiveViewsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, applicationLiveViewName, options) if err != nil { return ApplicationLiveViewsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationLiveViewsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationLiveViewsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApplicationLiveViewsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -237,7 +248,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +265,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-09-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 +319,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-09-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..62c3b2127704 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/apps_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/apps_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -62,7 +61,8 @@ func (client *AppsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[AppsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[AppsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[AppsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ 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-09-01-preview func (client *AppsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource AppResource, options *AppsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, appResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, appResource) + if err := runtime.MarshalAsJSON(req, appResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -132,7 +137,8 @@ func (client *AppsClient) BeginDelete(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - return runtime.NewPoller[AppsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[AppsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[AppsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -141,20 +147,22 @@ 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-09-01-preview func (client *AppsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, options *AppsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,7 +189,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,25 +198,28 @@ 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-09-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. // - appName - The name of the App resource. // - options - AppsClientGetOptions contains the optional parameters for the AppsClient.Get method. func (client *AppsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, appName string, options *AppsClientGetOptions) (AppsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, appName, options) if err != nil { return AppsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AppsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AppsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AppsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -235,7 +246,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-09-01-preview") if options != nil && options.SyncStatus != nil { reqQP.Set("syncStatus", *options.SyncStatus) } @@ -256,7 +267,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-09-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,18 +275,21 @@ func (client *AppsClient) getHandleResponse(resp *http.Response) (AppsClientGetR // - options - AppsClientGetResourceUploadURLOptions contains the optional parameters for the AppsClient.GetResourceUploadURL // method. func (client *AppsClient) GetResourceUploadURL(ctx context.Context, resourceGroupName string, serviceName string, appName string, options *AppsClientGetResourceUploadURLOptions) (AppsClientGetResourceUploadURLResponse, error) { + var err error req, err := client.getResourceUploadURLCreateRequest(ctx, resourceGroupName, serviceName, appName, options) if err != nil { return AppsClientGetResourceUploadURLResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AppsClientGetResourceUploadURLResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AppsClientGetResourceUploadURLResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AppsClientGetResourceUploadURLResponse{}, err } - return client.getResourceUploadURLHandleResponse(resp) + resp, err := client.getResourceUploadURLHandleResponse(httpResp) + return resp, err } // getResourceUploadURLCreateRequest creates the GetResourceUploadURL request. @@ -302,7 +316,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -319,7 +333,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-09-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 +386,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,7 +404,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-09-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. @@ -404,7 +418,8 @@ func (client *AppsClient) BeginSetActiveDeployments(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[AppsClientSetActiveDeploymentsResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[AppsClientSetActiveDeploymentsResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[AppsClientSetActiveDeploymentsResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -413,20 +428,22 @@ 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-09-01-preview func (client *AppsClient) setActiveDeployments(ctx context.Context, resourceGroupName string, serviceName string, appName string, activeDeploymentCollection ActiveDeploymentCollection, options *AppsClientBeginSetActiveDeploymentsOptions) (*http.Response, error) { + var err error req, err := client.setActiveDeploymentsCreateRequest(ctx, resourceGroupName, serviceName, appName, activeDeploymentCollection, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // setActiveDeploymentsCreateRequest creates the SetActiveDeployments request. @@ -453,16 +470,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, activeDeploymentCollection) + if err := runtime.MarshalAsJSON(req, activeDeploymentCollection); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -475,7 +495,8 @@ func (client *AppsClient) BeginUpdate(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - return runtime.NewPoller[AppsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[AppsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[AppsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -484,20 +505,22 @@ 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-09-01-preview func (client *AppsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource AppResource, options *AppsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, appResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -524,16 +547,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, appResource) + if err := runtime.MarshalAsJSON(req, appResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -541,18 +567,21 @@ func (client *AppsClient) updateCreateRequest(ctx context.Context, resourceGroup // - validatePayload - Custom domain payload to be validated // - options - AppsClientValidateDomainOptions contains the optional parameters for the AppsClient.ValidateDomain method. func (client *AppsClient) ValidateDomain(ctx context.Context, resourceGroupName string, serviceName string, appName string, validatePayload CustomDomainValidatePayload, options *AppsClientValidateDomainOptions) (AppsClientValidateDomainResponse, error) { + var err error req, err := client.validateDomainCreateRequest(ctx, resourceGroupName, serviceName, appName, validatePayload, options) if err != nil { return AppsClientValidateDomainResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AppsClientValidateDomainResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AppsClientValidateDomainResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AppsClientValidateDomainResponse{}, err } - return client.validateDomainHandleResponse(resp) + resp, err := client.validateDomainHandleResponse(httpResp) + return resp, err } // validateDomainCreateRequest creates the ValidateDomain request. @@ -579,10 +608,13 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, validatePayload) + if err := runtime.MarshalAsJSON(req, validatePayload); err != nil { + return nil, err + } + return req, nil } // validateDomainHandleResponse handles the ValidateDomain response. 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..6f6b71325a6d 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/bindings_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/bindings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -63,7 +62,8 @@ func (client *BindingsClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[BindingsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[BindingsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[BindingsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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-09-01-preview func (client *BindingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, bindingResource BindingResource, options *BindingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, bindingResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -116,16 +118,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, bindingResource) + if err := runtime.MarshalAsJSON(req, bindingResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -138,7 +143,8 @@ func (client *BindingsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[BindingsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[BindingsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[BindingsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -147,20 +153,22 @@ 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-09-01-preview func (client *BindingsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, options *BindingsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -191,7 +199,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +208,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-09-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. @@ -208,18 +216,21 @@ func (client *BindingsClient) deleteCreateRequest(ctx context.Context, resourceG // - bindingName - The name of the Binding resource. // - options - BindingsClientGetOptions contains the optional parameters for the BindingsClient.Get method. func (client *BindingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, options *BindingsClientGetOptions) (BindingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, options) if err != nil { return BindingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BindingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BindingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BindingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -250,7 +261,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +278,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-09-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 +336,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -343,7 +354,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-09-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. @@ -357,7 +368,8 @@ func (client *BindingsClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[BindingsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[BindingsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[BindingsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -366,20 +378,22 @@ 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-09-01-preview func (client *BindingsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, bindingResource BindingResource, options *BindingsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, bindingResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -410,8 +424,11 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, bindingResource) + if err := runtime.MarshalAsJSON(req, bindingResource); err != nil { + return nil, err + } + return req, nil } 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..c8e478a7970e 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -64,7 +63,8 @@ func (client *BuildpackBindingClient) BeginCreateOrUpdate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[BuildpackBindingClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[BuildpackBindingClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[BuildpackBindingClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,20 +73,22 @@ 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-09-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) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, buildpackBinding, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -121,16 +123,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, buildpackBinding) + if err := runtime.MarshalAsJSON(req, buildpackBinding); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -145,7 +150,8 @@ func (client *BuildpackBindingClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[BuildpackBindingClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[BuildpackBindingClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[BuildpackBindingClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -154,20 +160,22 @@ 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-09-01-preview func (client *BuildpackBindingClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, buildpackBindingName string, options *BuildpackBindingClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -202,7 +210,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +219,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-09-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. @@ -220,18 +228,21 @@ func (client *BuildpackBindingClient) deleteCreateRequest(ctx context.Context, r // - buildpackBindingName - The name of the Buildpack Binding Name // - options - BuildpackBindingClientGetOptions contains the optional parameters for the BuildpackBindingClient.Get method. func (client *BuildpackBindingClient) Get(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, buildpackBindingName string, options *BuildpackBindingClientGetOptions) (BuildpackBindingClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, options) if err != nil { return BuildpackBindingClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildpackBindingClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildpackBindingClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildpackBindingClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -266,7 +277,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +294,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-09-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 +358,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,7 +375,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-09-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 +429,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-09-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..290309e21858 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildservice_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildservice_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -45,10 +44,90 @@ 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-09-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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildServiceClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } 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-09-01-preview +func (client *BuildServiceClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildService BuildService, options *BuildServiceClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, buildService, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *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-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, buildService); err != nil { + return nil, err + } + return req, nil +} + // 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-09-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. @@ -58,18 +137,21 @@ func NewBuildServiceClient(subscriptionID string, credential azcore.TokenCredent // - options - BuildServiceClientCreateOrUpdateBuildOptions contains the optional parameters for the BuildServiceClient.CreateOrUpdateBuild // method. func (client *BuildServiceClient) CreateOrUpdateBuild(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildName string, buildParam Build, options *BuildServiceClientCreateOrUpdateBuildOptions) (BuildServiceClientCreateOrUpdateBuildResponse, error) { + var err error req, err := client.createOrUpdateBuildCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, buildName, buildParam, options) if err != nil { return BuildServiceClientCreateOrUpdateBuildResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceClientCreateOrUpdateBuildResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return BuildServiceClientCreateOrUpdateBuildResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return BuildServiceClientCreateOrUpdateBuildResponse{}, err } - return client.createOrUpdateBuildHandleResponse(resp) + resp, err := client.createOrUpdateBuildHandleResponse(httpResp) + return resp, err } // createOrUpdateBuildCreateRequest creates the CreateOrUpdateBuild request. @@ -100,10 +182,13 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, buildParam) + if err := runtime.MarshalAsJSON(req, buildParam); err != nil { + return nil, err + } + return req, nil } // createOrUpdateBuildHandleResponse handles the CreateOrUpdateBuild response. @@ -115,10 +200,91 @@ 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-09-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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildServiceClientDeleteBuildResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } 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-09-01-preview +func (client *BuildServiceClient) deleteBuild(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildName string, options *BuildServiceClientBeginDeleteBuildOptions) (*http.Response, error) { + var err error + req, err := client.deleteBuildCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, buildName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, 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-09-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-09-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. @@ -126,18 +292,21 @@ func (client *BuildServiceClient) createOrUpdateBuildHandleResponse(resp *http.R // - buildName - The name of the build resource. // - options - BuildServiceClientGetBuildOptions contains the optional parameters for the BuildServiceClient.GetBuild method. func (client *BuildServiceClient) GetBuild(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildName string, options *BuildServiceClientGetBuildOptions) (BuildServiceClientGetBuildResponse, error) { + var err error req, err := client.getBuildCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, buildName, options) if err != nil { return BuildServiceClientGetBuildResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceClientGetBuildResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildServiceClientGetBuildResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildServiceClientGetBuildResponse{}, err } - return client.getBuildHandleResponse(resp) + resp, err := client.getBuildHandleResponse(httpResp) + return resp, err } // getBuildCreateRequest creates the GetBuild request. @@ -168,7 +337,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +355,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-09-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. @@ -196,18 +365,21 @@ func (client *BuildServiceClient) getBuildHandleResponse(resp *http.Response) (B // - options - BuildServiceClientGetBuildResultOptions contains the optional parameters for the BuildServiceClient.GetBuildResult // method. func (client *BuildServiceClient) GetBuildResult(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildName string, buildResultName string, options *BuildServiceClientGetBuildResultOptions) (BuildServiceClientGetBuildResultResponse, error) { + var err error req, err := client.getBuildResultCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, buildName, buildResultName, options) if err != nil { return BuildServiceClientGetBuildResultResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceClientGetBuildResultResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildServiceClientGetBuildResultResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildServiceClientGetBuildResultResponse{}, err } - return client.getBuildResultHandleResponse(resp) + resp, err := client.getBuildResultHandleResponse(httpResp) + return resp, err } // getBuildResultCreateRequest creates the GetBuildResult request. @@ -242,7 +414,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,7 +432,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-09-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. @@ -270,18 +442,21 @@ func (client *BuildServiceClient) getBuildResultHandleResponse(resp *http.Respon // - options - BuildServiceClientGetBuildResultLogOptions contains the optional parameters for the BuildServiceClient.GetBuildResultLog // method. func (client *BuildServiceClient) GetBuildResultLog(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildName string, buildResultName string, options *BuildServiceClientGetBuildResultLogOptions) (BuildServiceClientGetBuildResultLogResponse, error) { + var err error req, err := client.getBuildResultLogCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, buildName, buildResultName, options) if err != nil { return BuildServiceClientGetBuildResultLogResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceClientGetBuildResultLogResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildServiceClientGetBuildResultLogResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildServiceClientGetBuildResultLogResponse{}, err } - return client.getBuildResultLogHandleResponse(resp) + resp, err := client.getBuildResultLogHandleResponse(httpResp) + return resp, err } // getBuildResultLogCreateRequest creates the GetBuildResultLog request. @@ -316,7 +491,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,7 +509,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-09-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. @@ -342,18 +517,21 @@ func (client *BuildServiceClient) getBuildResultLogHandleResponse(resp *http.Res // - options - BuildServiceClientGetBuildServiceOptions contains the optional parameters for the BuildServiceClient.GetBuildService // method. func (client *BuildServiceClient) GetBuildService(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, options *BuildServiceClientGetBuildServiceOptions) (BuildServiceClientGetBuildServiceResponse, error) { + var err error req, err := client.getBuildServiceCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, options) if err != nil { return BuildServiceClientGetBuildServiceResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceClientGetBuildServiceResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildServiceClientGetBuildServiceResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildServiceClientGetBuildServiceResponse{}, err } - return client.getBuildServiceHandleResponse(resp) + resp, err := client.getBuildServiceHandleResponse(httpResp) + return resp, err } // getBuildServiceCreateRequest creates the GetBuildService request. @@ -380,7 +558,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -398,7 +576,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-09-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. @@ -406,18 +584,21 @@ func (client *BuildServiceClient) getBuildServiceHandleResponse(resp *http.Respo // - options - BuildServiceClientGetResourceUploadURLOptions contains the optional parameters for the BuildServiceClient.GetResourceUploadURL // method. func (client *BuildServiceClient) GetResourceUploadURL(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, options *BuildServiceClientGetResourceUploadURLOptions) (BuildServiceClientGetResourceUploadURLResponse, error) { + var err error req, err := client.getResourceUploadURLCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, options) if err != nil { return BuildServiceClientGetResourceUploadURLResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceClientGetResourceUploadURLResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildServiceClientGetResourceUploadURLResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildServiceClientGetResourceUploadURLResponse{}, err } - return client.getResourceUploadURLHandleResponse(resp) + resp, err := client.getResourceUploadURLHandleResponse(httpResp) + return resp, err } // getResourceUploadURLCreateRequest creates the GetResourceUploadURL request. @@ -444,7 +625,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -462,7 +643,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-09-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. @@ -471,18 +652,21 @@ func (client *BuildServiceClient) getResourceUploadURLHandleResponse(resp *http. // - options - BuildServiceClientGetSupportedBuildpackOptions contains the optional parameters for the BuildServiceClient.GetSupportedBuildpack // method. func (client *BuildServiceClient) GetSupportedBuildpack(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildpackName string, options *BuildServiceClientGetSupportedBuildpackOptions) (BuildServiceClientGetSupportedBuildpackResponse, error) { + var err error req, err := client.getSupportedBuildpackCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, buildpackName, options) if err != nil { return BuildServiceClientGetSupportedBuildpackResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceClientGetSupportedBuildpackResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildServiceClientGetSupportedBuildpackResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildServiceClientGetSupportedBuildpackResponse{}, err } - return client.getSupportedBuildpackHandleResponse(resp) + resp, err := client.getSupportedBuildpackHandleResponse(httpResp) + return resp, err } // getSupportedBuildpackCreateRequest creates the GetSupportedBuildpack request. @@ -513,7 +697,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -531,7 +715,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-09-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. @@ -540,18 +724,21 @@ func (client *BuildServiceClient) getSupportedBuildpackHandleResponse(resp *http // - options - BuildServiceClientGetSupportedStackOptions contains the optional parameters for the BuildServiceClient.GetSupportedStack // method. func (client *BuildServiceClient) GetSupportedStack(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, stackName string, options *BuildServiceClientGetSupportedStackOptions) (BuildServiceClientGetSupportedStackResponse, error) { + var err error req, err := client.getSupportedStackCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, stackName, options) if err != nil { return BuildServiceClientGetSupportedStackResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceClientGetSupportedStackResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildServiceClientGetSupportedStackResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildServiceClientGetSupportedStackResponse{}, err } - return client.getSupportedStackHandleResponse(resp) + resp, err := client.getSupportedStackHandleResponse(httpResp) + return resp, err } // getSupportedStackCreateRequest creates the GetSupportedStack request. @@ -582,7 +769,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -599,7 +786,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-09-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 +850,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -680,7 +867,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-09-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 +921,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -751,7 +938,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-09-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 +997,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -828,7 +1015,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-09-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. @@ -836,18 +1023,21 @@ func (client *BuildServiceClient) listBuildsHandleResponse(resp *http.Response) // - options - BuildServiceClientListSupportedBuildpacksOptions contains the optional parameters for the BuildServiceClient.ListSupportedBuildpacks // method. func (client *BuildServiceClient) ListSupportedBuildpacks(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, options *BuildServiceClientListSupportedBuildpacksOptions) (BuildServiceClientListSupportedBuildpacksResponse, error) { + var err error req, err := client.listSupportedBuildpacksCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, options) if err != nil { return BuildServiceClientListSupportedBuildpacksResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceClientListSupportedBuildpacksResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildServiceClientListSupportedBuildpacksResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildServiceClientListSupportedBuildpacksResponse{}, err } - return client.listSupportedBuildpacksHandleResponse(resp) + resp, err := client.listSupportedBuildpacksHandleResponse(httpResp) + return resp, err } // listSupportedBuildpacksCreateRequest creates the ListSupportedBuildpacks request. @@ -874,7 +1064,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -892,7 +1082,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-09-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. @@ -900,18 +1090,21 @@ func (client *BuildServiceClient) listSupportedBuildpacksHandleResponse(resp *ht // - options - BuildServiceClientListSupportedStacksOptions contains the optional parameters for the BuildServiceClient.ListSupportedStacks // method. func (client *BuildServiceClient) ListSupportedStacks(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, options *BuildServiceClientListSupportedStacksOptions) (BuildServiceClientListSupportedStacksResponse, error) { + var err error req, err := client.listSupportedStacksCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, options) if err != nil { return BuildServiceClientListSupportedStacksResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceClientListSupportedStacksResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildServiceClientListSupportedStacksResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildServiceClientListSupportedStacksResponse{}, err } - return client.listSupportedStacksHandleResponse(resp) + resp, err := client.listSupportedStacksHandleResponse(httpResp) + return resp, err } // listSupportedStacksCreateRequest creates the ListSupportedStacks request. @@ -938,7 +1131,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-09-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..89949d41c35e 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -57,18 +56,21 @@ func NewBuildServiceAgentPoolClient(subscriptionID string, credential azcore.Tok // - options - BuildServiceAgentPoolClientGetOptions contains the optional parameters for the BuildServiceAgentPoolClient.Get // method. func (client *BuildServiceAgentPoolClient) Get(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, agentPoolName string, options *BuildServiceAgentPoolClientGetOptions) (BuildServiceAgentPoolClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, agentPoolName, options) if err != nil { return BuildServiceAgentPoolClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceAgentPoolClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildServiceAgentPoolClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildServiceAgentPoolClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -99,7 +101,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +118,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-09-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 +177,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +195,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-09-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. @@ -208,7 +210,8 @@ func (client *BuildServiceAgentPoolClient) BeginUpdatePut(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller[BuildServiceAgentPoolClientUpdatePutResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[BuildServiceAgentPoolClientUpdatePutResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[BuildServiceAgentPoolClientUpdatePutResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -217,20 +220,22 @@ 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-09-01-preview func (client *BuildServiceAgentPoolClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, agentPoolName string, agentPoolResource BuildServiceAgentPoolResource, options *BuildServiceAgentPoolClientBeginUpdatePutOptions) (*http.Response, error) { + var err error req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updatePutCreateRequest creates the UpdatePut request. @@ -261,8 +266,11 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, agentPoolResource) + if err := runtime.MarshalAsJSON(req, agentPoolResource); err != nil { + return nil, err + } + return req, nil } 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..fd8050f2d826 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -63,7 +62,8 @@ func (client *BuildServiceBuilderClient) BeginCreateOrUpdate(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller[BuildServiceBuilderClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[BuildServiceBuilderClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[BuildServiceBuilderClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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-09-01-preview func (client *BuildServiceBuilderClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, builderResource BuilderResource, options *BuildServiceBuilderClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, builderResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -116,16 +118,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, builderResource) + if err := runtime.MarshalAsJSON(req, builderResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -139,7 +144,8 @@ func (client *BuildServiceBuilderClient) BeginDelete(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[BuildServiceBuilderClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[BuildServiceBuilderClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[BuildServiceBuilderClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -148,20 +154,22 @@ 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-09-01-preview func (client *BuildServiceBuilderClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, options *BuildServiceBuilderClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -192,7 +200,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +209,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-09-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. @@ -209,18 +217,21 @@ func (client *BuildServiceBuilderClient) deleteCreateRequest(ctx context.Context // - builderName - The name of the builder resource. // - options - BuildServiceBuilderClientGetOptions contains the optional parameters for the BuildServiceBuilderClient.Get method. func (client *BuildServiceBuilderClient) Get(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, options *BuildServiceBuilderClientGetOptions) (BuildServiceBuilderClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, options) if err != nil { return BuildServiceBuilderClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceBuilderClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildServiceBuilderClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildServiceBuilderClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -251,7 +262,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +279,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-09-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 +338,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +356,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-09-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. @@ -354,18 +365,21 @@ func (client *BuildServiceBuilderClient) listHandleResponse(resp *http.Response) // - options - BuildServiceBuilderClientListDeploymentsOptions contains the optional parameters for the BuildServiceBuilderClient.ListDeployments // method. func (client *BuildServiceBuilderClient) ListDeployments(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, options *BuildServiceBuilderClientListDeploymentsOptions) (BuildServiceBuilderClientListDeploymentsResponse, error) { + var err error req, err := client.listDeploymentsCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, options) if err != nil { return BuildServiceBuilderClientListDeploymentsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BuildServiceBuilderClientListDeploymentsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BuildServiceBuilderClientListDeploymentsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BuildServiceBuilderClientListDeploymentsResponse{}, err } - return client.listDeploymentsHandleResponse(resp) + resp, err := client.listDeploymentsHandleResponse(httpResp) + return resp, err } // listDeploymentsCreateRequest creates the ListDeployments request. @@ -396,7 +410,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-09-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..4453a83cebc8 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/certificates_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/certificates_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -62,7 +61,8 @@ func (client *CertificatesClient) BeginCreateOrUpdate(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller[CertificatesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[CertificatesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[CertificatesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ 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-09-01-preview func (client *CertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, certificateName string, certificateResource CertificateResource, options *CertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, certificateName, certificateResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, certificateResource) + if err := runtime.MarshalAsJSON(req, certificateResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -133,7 +138,8 @@ func (client *CertificatesClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[CertificatesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[CertificatesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[CertificatesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,20 +148,22 @@ 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-09-01-preview func (client *CertificatesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, certificateName string, options *CertificatesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, certificateName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -182,7 +190,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,25 +199,28 @@ 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-09-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. // - certificateName - The name of the certificate resource. // - options - CertificatesClientGetOptions contains the optional parameters for the CertificatesClient.Get method. func (client *CertificatesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, certificateName string, options *CertificatesClientGetOptions) (CertificatesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, certificateName, options) if err != nil { return CertificatesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CertificatesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CertificatesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CertificatesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -236,7 +247,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +264,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-09-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 +317,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-09-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..32ee6c13cc6f 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/client_factory.go +++ b/sdk/resourcemanager/appplatform/armappplatform/client_factory.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -39,23 +38,23 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewServicesClient() *ServicesClient { - subClient, _ := NewServicesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPIPortalCustomDomainsClient() *APIPortalCustomDomainsClient { + subClient, _ := NewAPIPortalCustomDomainsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewConfigServersClient() *ConfigServersClient { - subClient, _ := NewConfigServersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPIPortalsClient() *APIPortalsClient { + subClient, _ := NewAPIPortalsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewConfigurationServicesClient() *ConfigurationServicesClient { - subClient, _ := NewConfigurationServicesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewApmsClient() *ApmsClient { + subClient, _ := NewApmsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServiceRegistriesClient() *ServiceRegistriesClient { - subClient, _ := NewServiceRegistriesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewApplicationAcceleratorsClient() *ApplicationAcceleratorsClient { + subClient, _ := NewApplicationAcceleratorsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -64,18 +63,18 @@ func (c *ClientFactory) NewApplicationLiveViewsClient() *ApplicationLiveViewsCli return subClient } -func (c *ClientFactory) NewDevToolPortalsClient() *DevToolPortalsClient { - subClient, _ := NewDevToolPortalsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAppsClient() *AppsClient { + subClient, _ := NewAppsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBuildServiceClient() *BuildServiceClient { - subClient, _ := NewBuildServiceClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBindingsClient() *BindingsClient { + subClient, _ := NewBindingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBuildpackBindingClient() *BuildpackBindingClient { - subClient, _ := NewBuildpackBindingClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBuildServiceAgentPoolClient() *BuildServiceAgentPoolClient { + subClient, _ := NewBuildServiceAgentPoolClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -84,33 +83,33 @@ func (c *ClientFactory) NewBuildServiceBuilderClient() *BuildServiceBuilderClien return subClient } -func (c *ClientFactory) NewBuildServiceAgentPoolClient() *BuildServiceAgentPoolClient { - subClient, _ := NewBuildServiceAgentPoolClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBuildServiceClient() *BuildServiceClient { + subClient, _ := NewBuildServiceClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewMonitoringSettingsClient() *MonitoringSettingsClient { - subClient, _ := NewMonitoringSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBuildpackBindingClient() *BuildpackBindingClient { + subClient, _ := NewBuildpackBindingClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAppsClient() *AppsClient { - subClient, _ := NewAppsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCertificatesClient() *CertificatesClient { + subClient, _ := NewCertificatesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBindingsClient() *BindingsClient { - subClient, _ := NewBindingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewConfigServersClient() *ConfigServersClient { + subClient, _ := NewConfigServersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewStoragesClient() *StoragesClient { - subClient, _ := NewStoragesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewConfigurationServicesClient() *ConfigurationServicesClient { + subClient, _ := NewConfigurationServicesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCertificatesClient() *CertificatesClient { - subClient, _ := NewCertificatesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewContainerRegistriesClient() *ContainerRegistriesClient { + subClient, _ := NewContainerRegistriesClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -119,23 +118,33 @@ func (c *ClientFactory) NewCustomDomainsClient() *CustomDomainsClient { return subClient } +func (c *ClientFactory) NewCustomizedAcceleratorsClient() *CustomizedAcceleratorsClient { + subClient, _ := NewCustomizedAcceleratorsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewDeploymentsClient() *DeploymentsClient { subClient, _ := NewDeploymentsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewDevToolPortalsClient() *DevToolPortalsClient { + subClient, _ := NewDevToolPortalsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRuntimeVersionsClient() *RuntimeVersionsClient { - subClient, _ := NewRuntimeVersionsClient(c.credential, c.options) +func (c *ClientFactory) NewEurekaServersClient() *EurekaServersClient { + subClient, _ := NewEurekaServersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSKUsClient() *SKUsClient { - subClient, _ := NewSKUsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGatewayCustomDomainsClient() *GatewayCustomDomainsClient { + subClient, _ := NewGatewayCustomDomainsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewGatewayRouteConfigsClient() *GatewayRouteConfigsClient { + subClient, _ := NewGatewayRouteConfigsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -144,37 +153,42 @@ func (c *ClientFactory) NewGatewaysClient() *GatewaysClient { return subClient } -func (c *ClientFactory) NewGatewayRouteConfigsClient() *GatewayRouteConfigsClient { - subClient, _ := NewGatewayRouteConfigsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewMonitoringSettingsClient() *MonitoringSettingsClient { + subClient, _ := NewMonitoringSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewGatewayCustomDomainsClient() *GatewayCustomDomainsClient { - subClient, _ := NewGatewayCustomDomainsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewAPIPortalsClient() *APIPortalsClient { - subClient, _ := NewAPIPortalsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPredefinedAcceleratorsClient() *PredefinedAcceleratorsClient { + subClient, _ := NewPredefinedAcceleratorsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAPIPortalCustomDomainsClient() *APIPortalCustomDomainsClient { - subClient, _ := NewAPIPortalCustomDomainsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRuntimeVersionsClient() *RuntimeVersionsClient { + subClient, _ := NewRuntimeVersionsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewApplicationAcceleratorsClient() *ApplicationAcceleratorsClient { - subClient, _ := NewApplicationAcceleratorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSKUsClient() *SKUsClient { + subClient, _ := NewSKUsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCustomizedAcceleratorsClient() *CustomizedAcceleratorsClient { - subClient, _ := NewCustomizedAcceleratorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServiceRegistriesClient() *ServiceRegistriesClient { + subClient, _ := NewServiceRegistriesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPredefinedAcceleratorsClient() *PredefinedAcceleratorsClient { - subClient, _ := NewPredefinedAcceleratorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServicesClient() *ServicesClient { + subClient, _ := NewServicesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewStoragesClient() *StoragesClient { + subClient, _ := NewStoragesClient(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..c87beccce4aa 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,24 +47,27 @@ 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-09-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 - ConfigServersClientGetOptions contains the optional parameters for the ConfigServersClient.Get method. func (client *ConfigServersClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *ConfigServersClientGetOptions) (ConfigServersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return ConfigServersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ConfigServersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConfigServersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConfigServersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -88,7 +90,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +108,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-09-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. @@ -119,7 +121,8 @@ func (client *ConfigServersClient) BeginUpdatePatch(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[ConfigServersClientUpdatePatchResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ConfigServersClientUpdatePatchResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ConfigServersClientUpdatePatchResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -128,20 +131,22 @@ 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-09-01-preview func (client *ConfigServersClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, configServerResource ConfigServerResource, options *ConfigServersClientBeginUpdatePatchOptions) (*http.Response, error) { + var err error req, err := client.updatePatchCreateRequest(ctx, resourceGroupName, serviceName, configServerResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updatePatchCreateRequest creates the UpdatePatch request. @@ -164,16 +169,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, configServerResource) + if err := runtime.MarshalAsJSON(req, configServerResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -186,7 +194,8 @@ func (client *ConfigServersClient) BeginUpdatePut(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[ConfigServersClientUpdatePutResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ConfigServersClientUpdatePutResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ConfigServersClientUpdatePutResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -195,20 +204,22 @@ 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-09-01-preview func (client *ConfigServersClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, configServerResource ConfigServerResource, options *ConfigServersClientBeginUpdatePutOptions) (*http.Response, error) { + var err error req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, configServerResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updatePutCreateRequest creates the UpdatePut request. @@ -231,16 +242,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, configServerResource) + if err := runtime.MarshalAsJSON(req, configServerResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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,9 +267,10 @@ func (client *ConfigServersClient) BeginValidate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigServersClientValidateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigServersClientValidateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ConfigServersClientValidateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -264,20 +279,22 @@ 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-09-01-preview func (client *ConfigServersClient) validate(ctx context.Context, resourceGroupName string, serviceName string, configServerSettings ConfigServerSettings, options *ConfigServersClientBeginValidateOptions) (*http.Response, error) { + var err error req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, configServerSettings, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // validateCreateRequest creates the Validate request. @@ -300,8 +317,11 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, configServerSettings) + if err := runtime.MarshalAsJSON(req, configServerSettings); err != nil { + return nil, err + } + return req, nil } 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..30e778aaaa87 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -49,7 +48,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-09-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. @@ -63,7 +62,8 @@ func (client *ConfigurationServicesClient) BeginCreateOrUpdate(ctx context.Conte if err != nil { return nil, err } - return runtime.NewPoller[ConfigurationServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ConfigurationServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ConfigurationServicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,20 +73,22 @@ 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-09-01-preview func (client *ConfigurationServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, configurationServiceResource ConfigurationServiceResource, options *ConfigurationServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -113,16 +115,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, configurationServiceResource) + if err := runtime.MarshalAsJSON(req, configurationServiceResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -135,7 +140,8 @@ func (client *ConfigurationServicesClient) BeginDelete(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller[ConfigurationServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ConfigurationServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ConfigurationServicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -144,20 +150,22 @@ 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-09-01-preview func (client *ConfigurationServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, options *ConfigurationServicesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -184,7 +192,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +201,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-09-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. @@ -201,18 +209,21 @@ func (client *ConfigurationServicesClient) deleteCreateRequest(ctx context.Conte // - options - ConfigurationServicesClientGetOptions contains the optional parameters for the ConfigurationServicesClient.Get // method. func (client *ConfigurationServicesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, options *ConfigurationServicesClientGetOptions) (ConfigurationServicesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, options) if err != nil { return ConfigurationServicesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ConfigurationServicesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConfigurationServicesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConfigurationServicesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -239,7 +250,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,7 +267,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-09-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 +321,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,7 +339,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-09-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. @@ -342,9 +353,10 @@ func (client *ConfigurationServicesClient) BeginValidate(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationServicesClientValidateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationServicesClientValidateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ConfigurationServicesClientValidateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -353,20 +365,22 @@ 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-09-01-preview func (client *ConfigurationServicesClient) validate(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, settings ConfigurationServiceSettings, options *ConfigurationServicesClientBeginValidateOptions) (*http.Response, error) { + var err error req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, settings, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // validateCreateRequest creates the Validate request. @@ -393,8 +407,91 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, settings) + if err := runtime.MarshalAsJSON(req, settings); err != nil { + return nil, err + } + return req, nil +} + +// BeginValidateResource - Check if the Application Configuration Service resource is valid. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-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. +// - configurationServiceName - The name of Application Configuration Service. +// - configurationServiceResource - Application Configuration Service resource to be validated +// - options - ConfigurationServicesClientBeginValidateResourceOptions contains the optional parameters for the ConfigurationServicesClient.BeginValidateResource +// method. +func (client *ConfigurationServicesClient) BeginValidateResource(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, configurationServiceResource ConfigurationServiceResource, options *ConfigurationServicesClientBeginValidateResourceOptions) (*runtime.Poller[ConfigurationServicesClientValidateResourceResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.validateResource(ctx, resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationServicesClientValidateResourceResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ConfigurationServicesClientValidateResourceResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// ValidateResource - Check if the Application Configuration Service resource is valid. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01-preview +func (client *ConfigurationServicesClient) validateResource(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, configurationServiceResource ConfigurationServiceResource, options *ConfigurationServicesClientBeginValidateResourceOptions) (*http.Response, error) { + var err error + req, err := client.validateResourceCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// validateResourceCreateRequest creates the ValidateResource request. +func (client *ConfigurationServicesClient) validateResourceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, configurationServiceResource ConfigurationServiceResource, options *ConfigurationServicesClientBeginValidateResourceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/configurationServices/{configurationServiceName}/validateResource" + 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 configurationServiceName == "" { + return nil, errors.New("parameter configurationServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationServiceName}", url.PathEscape(configurationServiceName)) + 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-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, configurationServiceResource); err != nil { + return nil, err + } + return req, nil } 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..8ccfd2c718cb 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/constants.go +++ b/sdk/resourcemanager/appplatform/armappplatform/constants.go @@ -3,15 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. 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 +49,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 +249,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 +337,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 +377,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 +415,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 +599,76 @@ 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, + } +} + +// Frequency - The frequency to run the maintenance job +type Frequency string + +const ( + FrequencyWeekly Frequency = "Weekly" +) + +// PossibleFrequencyValues returns the possible values for the Frequency const type. +func PossibleFrequencyValues() []Frequency { + return []Frequency{ + FrequencyWeekly, + } +} + +// 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 +707,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:// @@ -944,3 +1111,29 @@ func PossibleTypeValues() []Type { TypeAzureFileVolume, } } + +// WeekDay - The day to run the maintenance job +type WeekDay string + +const ( + WeekDayFriday WeekDay = "Friday" + WeekDayMonday WeekDay = "Monday" + WeekDaySaturday WeekDay = "Saturday" + WeekDaySunday WeekDay = "Sunday" + WeekDayThursday WeekDay = "Thursday" + WeekDayTuesday WeekDay = "Tuesday" + WeekDayWednesday WeekDay = "Wednesday" +) + +// PossibleWeekDayValues returns the possible values for the WeekDay const type. +func PossibleWeekDayValues() []WeekDay { + return []WeekDay{ + WeekDayFriday, + WeekDayMonday, + WeekDaySaturday, + WeekDaySunday, + WeekDayThursday, + WeekDayTuesday, + WeekDayWednesday, + } +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/containerregistries_client.go b/sdk/resourcemanager/appplatform/armappplatform/containerregistries_client.go new file mode 100644 index 000000000000..807041cd42e1 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/containerregistries_client.go @@ -0,0 +1,418 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package 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-09-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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerRegistriesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } 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-09-01-preview +func (client *ContainerRegistriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, containerRegistryResource ContainerRegistryResource, options *ContainerRegistriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, containerRegistryName, containerRegistryResource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *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-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, containerRegistryResource); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Delete a container registry resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerRegistriesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } 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-09-01-preview +func (client *ContainerRegistriesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, options *ContainerRegistriesClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, containerRegistryName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, 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-09-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-09-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) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, containerRegistryName, options) + if err != nil { + return ContainerRegistriesClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ContainerRegistriesClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ContainerRegistriesClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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-09-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-09-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-09-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-09-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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ContainerRegistriesClientValidateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } 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-09-01-preview +func (client *ContainerRegistriesClient) validate(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, containerRegistryProperties ContainerRegistryProperties, options *ContainerRegistriesClientBeginValidateOptions) (*http.Response, error) { + var err error + req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, containerRegistryName, containerRegistryProperties, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// 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-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, containerRegistryProperties); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go index b772e4d460c5..c9d0911db6f2 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -63,7 +62,8 @@ func (client *CustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller[CustomDomainsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[CustomDomainsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[CustomDomainsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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-09-01-preview func (client *CustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, domainName string, domainResource CustomDomainResource, options *CustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, domainResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -116,16 +118,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, domainResource) + if err := runtime.MarshalAsJSON(req, domainResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -139,7 +144,8 @@ func (client *CustomDomainsClient) BeginDelete(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[CustomDomainsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[CustomDomainsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[CustomDomainsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -148,20 +154,22 @@ 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-09-01-preview func (client *CustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, domainName string, options *CustomDomainsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -192,7 +200,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +209,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-09-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. @@ -209,18 +217,21 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso // - domainName - The name of the custom domain resource. // - options - CustomDomainsClientGetOptions contains the optional parameters for the CustomDomainsClient.Get method. func (client *CustomDomainsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, appName string, domainName string, options *CustomDomainsClientGetOptions) (CustomDomainsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, options) if err != nil { return CustomDomainsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CustomDomainsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CustomDomainsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CustomDomainsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -251,7 +262,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +279,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-09-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 +337,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -344,7 +355,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-09-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. @@ -359,7 +370,8 @@ func (client *CustomDomainsClient) BeginUpdate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[CustomDomainsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[CustomDomainsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[CustomDomainsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -368,20 +380,22 @@ 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-09-01-preview func (client *CustomDomainsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, domainName string, domainResource CustomDomainResource, options *CustomDomainsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, domainResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -412,8 +426,11 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, domainResource) + if err := runtime.MarshalAsJSON(req, domainResource); err != nil { + return nil, err + } + return req, nil } 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..e99c3ead9b21 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -63,7 +62,8 @@ func (client *CustomizedAcceleratorsClient) BeginCreateOrUpdate(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller[CustomizedAcceleratorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[CustomizedAcceleratorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[CustomizedAcceleratorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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-09-01-preview func (client *CustomizedAcceleratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, customizedAcceleratorResource CustomizedAcceleratorResource, options *CustomizedAcceleratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, customizedAcceleratorResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -116,16 +118,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, customizedAcceleratorResource) + if err := runtime.MarshalAsJSON(req, customizedAcceleratorResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -139,7 +144,8 @@ func (client *CustomizedAcceleratorsClient) BeginDelete(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller[CustomizedAcceleratorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[CustomizedAcceleratorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[CustomizedAcceleratorsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -148,20 +154,22 @@ 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-09-01-preview func (client *CustomizedAcceleratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, options *CustomizedAcceleratorsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -192,7 +200,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +209,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-09-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. @@ -210,18 +218,21 @@ func (client *CustomizedAcceleratorsClient) deleteCreateRequest(ctx context.Cont // - options - CustomizedAcceleratorsClientGetOptions contains the optional parameters for the CustomizedAcceleratorsClient.Get // method. func (client *CustomizedAcceleratorsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, options *CustomizedAcceleratorsClientGetOptions) (CustomizedAcceleratorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, options) if err != nil { return CustomizedAcceleratorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CustomizedAcceleratorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CustomizedAcceleratorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CustomizedAcceleratorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -252,7 +263,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +280,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-09-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 +339,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -346,7 +357,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-09-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. @@ -356,18 +367,21 @@ func (client *CustomizedAcceleratorsClient) listHandleResponse(resp *http.Respon // - options - CustomizedAcceleratorsClientValidateOptions contains the optional parameters for the CustomizedAcceleratorsClient.Validate // method. func (client *CustomizedAcceleratorsClient) Validate(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, properties CustomizedAcceleratorProperties, options *CustomizedAcceleratorsClientValidateOptions) (CustomizedAcceleratorsClientValidateResponse, error) { + var err error req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, properties, options) if err != nil { return CustomizedAcceleratorsClientValidateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CustomizedAcceleratorsClientValidateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return CustomizedAcceleratorsClientValidateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return CustomizedAcceleratorsClientValidateResponse{}, err } - return client.validateHandleResponse(resp) + resp, err := client.validateHandleResponse(httpResp) + return resp, err } // validateCreateRequest creates the Validate request. @@ -398,10 +412,13 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, properties) + if err := runtime.MarshalAsJSON(req, properties); err != nil { + return nil, err + } + return req, nil } // validateHandleResponse handles the Validate response. 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..46a603f4cc65 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/deployments_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/deployments_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -63,7 +62,8 @@ func (client *DeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[DeploymentsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DeploymentsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeploymentsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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-09-01-preview func (client *DeploymentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, deploymentResource DeploymentResource, options *DeploymentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, deploymentResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -116,16 +118,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, deploymentResource) + if err := runtime.MarshalAsJSON(req, deploymentResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -138,7 +143,8 @@ func (client *DeploymentsClient) BeginDelete(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller[DeploymentsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DeploymentsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeploymentsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -147,20 +153,22 @@ 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-09-01-preview func (client *DeploymentsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -191,7 +199,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +208,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-09-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. @@ -214,7 +222,8 @@ func (client *DeploymentsClient) BeginDisableRemoteDebugging(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller[DeploymentsClientDisableRemoteDebuggingResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DeploymentsClientDisableRemoteDebuggingResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeploymentsClientDisableRemoteDebuggingResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -223,20 +232,22 @@ 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-09-01-preview func (client *DeploymentsClient) disableRemoteDebugging(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginDisableRemoteDebuggingOptions) (*http.Response, error) { + var err error req, err := client.disableRemoteDebuggingCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // disableRemoteDebuggingCreateRequest creates the DisableRemoteDebugging request. @@ -267,7 +278,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +287,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-09-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. @@ -290,7 +301,8 @@ func (client *DeploymentsClient) BeginEnableRemoteDebugging(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[DeploymentsClientEnableRemoteDebuggingResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DeploymentsClientEnableRemoteDebuggingResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeploymentsClientEnableRemoteDebuggingResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -299,20 +311,22 @@ 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-09-01-preview func (client *DeploymentsClient) enableRemoteDebugging(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginEnableRemoteDebuggingOptions) (*http.Response, error) { + var err error req, err := client.enableRemoteDebuggingCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // enableRemoteDebuggingCreateRequest creates the EnableRemoteDebugging request. @@ -343,11 +357,14 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.RemoteDebuggingPayload != nil { - return req, runtime.MarshalAsJSON(req, *options.RemoteDebuggingPayload) + if err := runtime.MarshalAsJSON(req, *options.RemoteDebuggingPayload); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -355,7 +372,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-09-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 +387,8 @@ func (client *DeploymentsClient) BeginGenerateHeapDump(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller[DeploymentsClientGenerateHeapDumpResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DeploymentsClientGenerateHeapDumpResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeploymentsClientGenerateHeapDumpResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -379,20 +397,22 @@ 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-09-01-preview func (client *DeploymentsClient) generateHeapDump(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, diagnosticParameters DiagnosticParameters, options *DeploymentsClientBeginGenerateHeapDumpOptions) (*http.Response, error) { + var err error req, err := client.generateHeapDumpCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // generateHeapDumpCreateRequest creates the GenerateHeapDump request. @@ -423,16 +443,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, diagnosticParameters) + if err := runtime.MarshalAsJSON(req, diagnosticParameters); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -447,7 +470,8 @@ func (client *DeploymentsClient) BeginGenerateThreadDump(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller[DeploymentsClientGenerateThreadDumpResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DeploymentsClientGenerateThreadDumpResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeploymentsClientGenerateThreadDumpResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -456,20 +480,22 @@ 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-09-01-preview func (client *DeploymentsClient) generateThreadDump(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, diagnosticParameters DiagnosticParameters, options *DeploymentsClientBeginGenerateThreadDumpOptions) (*http.Response, error) { + var err error req, err := client.generateThreadDumpCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // generateThreadDumpCreateRequest creates the GenerateThreadDump request. @@ -500,16 +526,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, diagnosticParameters) + if err := runtime.MarshalAsJSON(req, diagnosticParameters); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -517,18 +546,21 @@ func (client *DeploymentsClient) generateThreadDumpCreateRequest(ctx context.Con // - deploymentName - The name of the Deployment resource. // - options - DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method. func (client *DeploymentsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientGetOptions) (DeploymentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { return DeploymentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DeploymentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DeploymentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DeploymentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -559,7 +591,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -577,7 +609,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-09-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. @@ -586,18 +618,21 @@ func (client *DeploymentsClient) getHandleResponse(resp *http.Response) (Deploym // - options - DeploymentsClientGetLogFileURLOptions contains the optional parameters for the DeploymentsClient.GetLogFileURL // method. func (client *DeploymentsClient) GetLogFileURL(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientGetLogFileURLOptions) (DeploymentsClientGetLogFileURLResponse, error) { + var err error req, err := client.getLogFileURLCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { return DeploymentsClientGetLogFileURLResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DeploymentsClientGetLogFileURLResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return DeploymentsClientGetLogFileURLResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DeploymentsClientGetLogFileURLResponse{}, err } - return client.getLogFileURLHandleResponse(resp) + resp, err := client.getLogFileURLHandleResponse(httpResp) + return resp, err } // getLogFileURLCreateRequest creates the GetLogFileURL request. @@ -628,7 +663,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -646,7 +681,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-09-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. @@ -655,18 +690,21 @@ func (client *DeploymentsClient) getLogFileURLHandleResponse(resp *http.Response // - options - DeploymentsClientGetRemoteDebuggingConfigOptions contains the optional parameters for the DeploymentsClient.GetRemoteDebuggingConfig // method. func (client *DeploymentsClient) GetRemoteDebuggingConfig(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientGetRemoteDebuggingConfigOptions) (DeploymentsClientGetRemoteDebuggingConfigResponse, error) { + var err error req, err := client.getRemoteDebuggingConfigCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { return DeploymentsClientGetRemoteDebuggingConfigResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DeploymentsClientGetRemoteDebuggingConfigResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DeploymentsClientGetRemoteDebuggingConfigResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DeploymentsClientGetRemoteDebuggingConfigResponse{}, err } - return client.getRemoteDebuggingConfigHandleResponse(resp) + resp, err := client.getRemoteDebuggingConfigHandleResponse(httpResp) + return resp, err } // getRemoteDebuggingConfigCreateRequest creates the GetRemoteDebuggingConfig request. @@ -697,7 +735,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -714,7 +752,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-09-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 +810,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-09-01-preview") if options != nil && options.Version != nil { for _, qv := range options.Version { reqQP.Add("version", qv) @@ -794,7 +832,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-09-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 +886,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-09-01-preview") if options != nil && options.Version != nil { for _, qv := range options.Version { reqQP.Add("version", qv) @@ -871,7 +909,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-09-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. @@ -885,7 +923,8 @@ func (client *DeploymentsClient) BeginRestart(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[DeploymentsClientRestartResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DeploymentsClientRestartResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeploymentsClientRestartResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -894,20 +933,22 @@ 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-09-01-preview func (client *DeploymentsClient) restart(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginRestartOptions) (*http.Response, error) { + var err error req, err := client.restartCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // restartCreateRequest creates the Restart request. @@ -938,7 +979,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -947,7 +988,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-09-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. @@ -960,7 +1001,8 @@ func (client *DeploymentsClient) BeginStart(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller[DeploymentsClientStartResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DeploymentsClientStartResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeploymentsClientStartResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -969,20 +1011,22 @@ 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-09-01-preview func (client *DeploymentsClient) start(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginStartOptions) (*http.Response, error) { + var err error req, err := client.startCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // startCreateRequest creates the Start request. @@ -1013,7 +1057,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1022,7 +1066,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-09-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. @@ -1037,7 +1081,8 @@ func (client *DeploymentsClient) BeginStartJFR(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller[DeploymentsClientStartJFRResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DeploymentsClientStartJFRResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeploymentsClientStartJFRResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1046,20 +1091,22 @@ 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-09-01-preview func (client *DeploymentsClient) startJFR(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, diagnosticParameters DiagnosticParameters, options *DeploymentsClientBeginStartJFROptions) (*http.Response, error) { + var err error req, err := client.startJFRCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // startJFRCreateRequest creates the StartJFR request. @@ -1090,16 +1137,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, diagnosticParameters) + if err := runtime.MarshalAsJSON(req, diagnosticParameters); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -1112,7 +1162,8 @@ func (client *DeploymentsClient) BeginStop(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[DeploymentsClientStopResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DeploymentsClientStopResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeploymentsClientStopResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1121,20 +1172,22 @@ 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-09-01-preview func (client *DeploymentsClient) stop(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginStopOptions) (*http.Response, error) { + var err error req, err := client.stopCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // stopCreateRequest creates the Stop request. @@ -1165,7 +1218,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1174,7 +1227,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-09-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. @@ -1188,7 +1241,8 @@ func (client *DeploymentsClient) BeginUpdate(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller[DeploymentsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DeploymentsClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DeploymentsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1197,20 +1251,22 @@ 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-09-01-preview func (client *DeploymentsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, deploymentResource DeploymentResource, options *DeploymentsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, deploymentResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -1241,8 +1297,11 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, deploymentResource) + if err := runtime.MarshalAsJSON(req, deploymentResource); err != nil { + return nil, err + } + return req, nil } 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..1b2b44881a0b 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -62,7 +61,8 @@ func (client *DevToolPortalsClient) BeginCreateOrUpdate(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller[DevToolPortalsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DevToolPortalsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DevToolPortalsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ 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-09-01-preview func (client *DevToolPortalsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, devToolPortalResource DevToolPortalResource, options *DevToolPortalsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, devToolPortalName, devToolPortalResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, devToolPortalResource) + if err := runtime.MarshalAsJSON(req, devToolPortalResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -133,7 +138,8 @@ func (client *DevToolPortalsClient) BeginDelete(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller[DevToolPortalsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[DevToolPortalsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[DevToolPortalsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,20 +148,22 @@ 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-09-01-preview func (client *DevToolPortalsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, options *DevToolPortalsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, devToolPortalName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -182,7 +190,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,25 +199,28 @@ 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-09-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. // - devToolPortalName - The name of Dev Tool Portal. // - options - DevToolPortalsClientGetOptions contains the optional parameters for the DevToolPortalsClient.Get method. func (client *DevToolPortalsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, options *DevToolPortalsClientGetOptions) (DevToolPortalsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, devToolPortalName, options) if err != nil { return DevToolPortalsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DevToolPortalsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DevToolPortalsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DevToolPortalsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -236,7 +247,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,7 +264,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-09-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 +317,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-09-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..7f69606fd21f --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/eurekaservers_client.go @@ -0,0 +1,317 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package 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-09-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) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return EurekaServersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return EurekaServersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EurekaServersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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-09-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-09-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) { + var err error + req, err := client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return EurekaServersClientListResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return EurekaServersClientListResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return EurekaServersClientListResponse{}, err + } + resp, err := client.listHandleResponse(httpResp) + return resp, err +} + +// 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-09-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-09-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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[EurekaServersClientUpdatePatchResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } 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-09-01-preview +func (client *EurekaServersClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, eurekaServerResource EurekaServerResource, options *EurekaServersClientBeginUpdatePatchOptions) (*http.Response, error) { + var err error + req, err := client.updatePatchCreateRequest(ctx, resourceGroupName, serviceName, eurekaServerResource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// 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-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, eurekaServerResource); err != nil { + return nil, err + } + return req, nil +} + +// BeginUpdatePut - Update the eureka server settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[EurekaServersClientUpdatePutResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } 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-09-01-preview +func (client *EurekaServersClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, eurekaServerResource EurekaServerResource, options *EurekaServersClientBeginUpdatePutOptions) (*http.Response, error) { + var err error + req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, eurekaServerResource, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// 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-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, eurekaServerResource); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go index 9acf6bfbaa10..c6c91caed023 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -63,7 +62,8 @@ func (client *GatewayCustomDomainsClient) BeginCreateOrUpdate(ctx context.Contex if err != nil { return nil, err } - return runtime.NewPoller[GatewayCustomDomainsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[GatewayCustomDomainsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[GatewayCustomDomainsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ 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-09-01-preview func (client *GatewayCustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, gatewayCustomDomainResource GatewayCustomDomainResource, options *GatewayCustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -116,16 +118,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, gatewayCustomDomainResource) + if err := runtime.MarshalAsJSON(req, gatewayCustomDomainResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -139,7 +144,8 @@ func (client *GatewayCustomDomainsClient) BeginDelete(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller[GatewayCustomDomainsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[GatewayCustomDomainsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[GatewayCustomDomainsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -148,20 +154,22 @@ 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-09-01-preview func (client *GatewayCustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, domainName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -192,7 +200,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +209,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-09-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. @@ -210,18 +218,21 @@ func (client *GatewayCustomDomainsClient) deleteCreateRequest(ctx context.Contex // - options - GatewayCustomDomainsClientGetOptions contains the optional parameters for the GatewayCustomDomainsClient.Get // method. func (client *GatewayCustomDomainsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientGetOptions) (GatewayCustomDomainsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, domainName, options) if err != nil { return GatewayCustomDomainsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayCustomDomainsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewayCustomDomainsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewayCustomDomainsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -252,7 +263,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +280,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-09-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 +339,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-09-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..50c73bcb8b10 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -49,7 +48,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-09-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. @@ -64,7 +63,8 @@ func (client *GatewayRouteConfigsClient) BeginCreateOrUpdate(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller[GatewayRouteConfigsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[GatewayRouteConfigsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[GatewayRouteConfigsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,20 +74,22 @@ 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-09-01-preview func (client *GatewayRouteConfigsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, gatewayRouteConfigResource GatewayRouteConfigResource, options *GatewayRouteConfigsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -118,16 +120,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, gatewayRouteConfigResource) + if err := runtime.MarshalAsJSON(req, gatewayRouteConfigResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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 +146,8 @@ func (client *GatewayRouteConfigsClient) BeginDelete(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[GatewayRouteConfigsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[GatewayRouteConfigsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[GatewayRouteConfigsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -150,20 +156,22 @@ 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-09-01-preview func (client *GatewayRouteConfigsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -194,7 +202,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +211,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-09-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. @@ -211,18 +219,21 @@ func (client *GatewayRouteConfigsClient) deleteCreateRequest(ctx context.Context // - routeConfigName - The name of the Spring Cloud Gateway route config. // - options - GatewayRouteConfigsClientGetOptions contains the optional parameters for the GatewayRouteConfigsClient.Get method. func (client *GatewayRouteConfigsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientGetOptions) (GatewayRouteConfigsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, options) if err != nil { return GatewayRouteConfigsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewayRouteConfigsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewayRouteConfigsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewayRouteConfigsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -253,7 +264,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +281,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-09-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 +340,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-09-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..d2f7e999b190 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/gateways_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/gateways_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -62,7 +61,8 @@ func (client *GatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[GatewaysClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[GatewaysClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[GatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ 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-09-01-preview func (client *GatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayResource GatewayResource, options *GatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, gatewayResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, gatewayResource) + if err := runtime.MarshalAsJSON(req, gatewayResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -132,7 +137,8 @@ func (client *GatewaysClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[GatewaysClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[GatewaysClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[GatewaysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -141,20 +147,22 @@ 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-09-01-preview func (client *GatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,7 +189,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,25 +198,28 @@ 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-09-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 - GatewaysClientGetOptions contains the optional parameters for the GatewaysClient.Get method. func (client *GatewaysClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientGetOptions) (GatewaysClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) if err != nil { return GatewaysClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewaysClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewaysClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewaysClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -235,7 +246,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +263,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-09-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 +316,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,25 +334,28 @@ 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-09-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 - GatewaysClientListEnvSecretsOptions contains the optional parameters for the GatewaysClient.ListEnvSecrets method. func (client *GatewaysClient) ListEnvSecrets(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientListEnvSecretsOptions) (GatewaysClientListEnvSecretsResponse, error) { + var err error req, err := client.listEnvSecretsCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) if err != nil { return GatewaysClientListEnvSecretsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewaysClientListEnvSecretsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewaysClientListEnvSecretsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewaysClientListEnvSecretsResponse{}, err } - return client.listEnvSecretsHandleResponse(resp) + resp, err := client.listEnvSecretsHandleResponse(httpResp) + return resp, err } // listEnvSecretsCreateRequest creates the ListEnvSecrets request. @@ -368,7 +382,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -383,10 +397,85 @@ 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-09-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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GatewaysClientRestartResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } 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-09-01-preview +func (client *GatewaysClient) restart(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginRestartOptions) (*http.Response, error) { + var err error + req, err := client.restartCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// 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-09-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-09-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. @@ -400,9 +489,10 @@ func (client *GatewaysClient) BeginUpdateCapacity(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GatewaysClientUpdateCapacityResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GatewaysClientUpdateCapacityResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[GatewaysClientUpdateCapacityResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -411,20 +501,22 @@ 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-09-01-preview func (client *GatewaysClient) updateCapacity(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayCapacityResource SKUObject, options *GatewaysClientBeginUpdateCapacityOptions) (*http.Response, error) { + var err error req, err := client.updateCapacityCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, gatewayCapacityResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCapacityCreateRequest creates the UpdateCapacity request. @@ -451,16 +543,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, gatewayCapacityResource) + if err := runtime.MarshalAsJSON(req, gatewayCapacityResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -468,18 +563,21 @@ func (client *GatewaysClient) updateCapacityCreateRequest(ctx context.Context, r // - validatePayload - Custom domain payload to be validated // - options - GatewaysClientValidateDomainOptions contains the optional parameters for the GatewaysClient.ValidateDomain method. func (client *GatewaysClient) ValidateDomain(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, validatePayload CustomDomainValidatePayload, options *GatewaysClientValidateDomainOptions) (GatewaysClientValidateDomainResponse, error) { + var err error req, err := client.validateDomainCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, validatePayload, options) if err != nil { return GatewaysClientValidateDomainResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GatewaysClientValidateDomainResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GatewaysClientValidateDomainResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GatewaysClientValidateDomainResponse{}, err } - return client.validateDomainHandleResponse(resp) + resp, err := client.validateDomainHandleResponse(httpResp) + return resp, err } // validateDomainCreateRequest creates the ValidateDomain request. @@ -506,10 +604,13 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, validatePayload) + if err := runtime.MarshalAsJSON(req, validatePayload); err != nil { + return nil, err + } + return req, nil } // validateDomainHandleResponse handles the ValidateDomain response. 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 698ec94d85a4..a9cd83ed4521 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/go.mod +++ b/sdk/resourcemanager/appplatform/armappplatform/go.mod @@ -3,14 +3,14 @@ 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 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/stretchr/testify v1.7.0 ) require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -21,9 +21,9 @@ require ( github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/crypto v0.6.0 // 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 + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect gopkg.in/yaml.v2 v2.4.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 6e2c77825a2c..93fdfc2850cd 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/go.sum +++ b/sdk/resourcemanager/appplatform/armappplatform/go.sum @@ -1,9 +1,9 @@ -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/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= 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/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2/go.mod h1:FbdwsQ2EzwvXxOPcMFYO8ogEc9uMMIj3YkmCdXdAFmk= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8= @@ -31,13 +31,13 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 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/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= 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= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/sdk/resourcemanager/appplatform/armappplatform/interfaces.go b/sdk/resourcemanager/appplatform/armappplatform/interfaces.go new file mode 100644 index 000000000000..a50dd97d08cd --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/interfaces.go @@ -0,0 +1,93 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armappplatform + +// AcceleratorAuthSettingClassification provides polymorphic access to related types. +// Call the interface's GetAcceleratorAuthSetting() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AcceleratorAuthSetting, *AcceleratorBasicAuthSetting, *AcceleratorPublicSetting, *AcceleratorSSHSetting +type AcceleratorAuthSettingClassification interface { + // GetAcceleratorAuthSetting returns the AcceleratorAuthSetting content of the underlying type. + GetAcceleratorAuthSetting() *AcceleratorAuthSetting +} + +// CertificatePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetCertificateProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CertificateProperties, *ContentCertificateProperties, *KeyVaultCertificateProperties +type CertificatePropertiesClassification interface { + // GetCertificateProperties returns the CertificateProperties content of the underlying type. + GetCertificateProperties() *CertificateProperties +} + +// 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 +} + +// CustomPersistentDiskPropertiesClassification provides polymorphic access to related types. +// Call the interface's GetCustomPersistentDiskProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureFileVolume, *CustomPersistentDiskProperties +type CustomPersistentDiskPropertiesClassification interface { + // GetCustomPersistentDiskProperties returns the CustomPersistentDiskProperties content of the underlying type. + GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties +} + +// MaintenanceScheduleConfigurationClassification provides polymorphic access to related types. +// Call the interface's GetMaintenanceScheduleConfiguration() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *MaintenanceScheduleConfiguration, *WeeklyMaintenanceScheduleConfiguration +type MaintenanceScheduleConfigurationClassification interface { + // GetMaintenanceScheduleConfiguration returns the MaintenanceScheduleConfiguration content of the underlying type. + GetMaintenanceScheduleConfiguration() *MaintenanceScheduleConfiguration +} + +// ProbeActionClassification provides polymorphic access to related types. +// Call the interface's GetProbeAction() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ExecAction, *HTTPGetAction, *ProbeAction, *TCPSocketAction +type ProbeActionClassification interface { + // GetProbeAction returns the ProbeAction content of the underlying type. + GetProbeAction() *ProbeAction +} + +// StoragePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetStorageProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *StorageAccount, *StorageProperties +type StoragePropertiesClassification interface { + // GetStorageProperties returns the StorageProperties content of the underlying type. + GetStorageProperties() *StorageProperties +} + +// UploadedUserSourceInfoClassification provides polymorphic access to related types. +// Call the interface's GetUploadedUserSourceInfo() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *JarUploadedUserSourceInfo, *NetCoreZipUploadedUserSourceInfo, *SourceUploadedUserSourceInfo, *UploadedUserSourceInfo, +// - *WarUploadedUserSourceInfo +type UploadedUserSourceInfoClassification interface { + UserSourceInfoClassification + // GetUploadedUserSourceInfo returns the UploadedUserSourceInfo content of the underlying type. + GetUploadedUserSourceInfo() *UploadedUserSourceInfo +} + +// UserSourceInfoClassification provides polymorphic access to related types. +// Call the interface's GetUserSourceInfo() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *BuildResultUserSourceInfo, *CustomContainerUserSourceInfo, *JarUploadedUserSourceInfo, *NetCoreZipUploadedUserSourceInfo, +// - *SourceUploadedUserSourceInfo, *UploadedUserSourceInfo, *UserSourceInfo, *WarUploadedUserSourceInfo +type UserSourceInfoClassification interface { + // GetUserSourceInfo returns the UserSourceInfo content of the underlying type. + GetUserSourceInfo() *UserSourceInfo +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/models.go b/sdk/resourcemanager/appplatform/armappplatform/models.go index 284ee43869f5..20b05c4dc7c4 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/models.go +++ b/sdk/resourcemanager/appplatform/armappplatform/models.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -45,31 +44,6 @@ type APIPortalCustomDomainResourceCollection struct { Value []*APIPortalCustomDomainResource } -// APIPortalCustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the APIPortalCustomDomainsClient.BeginCreateOrUpdate -// method. -type APIPortalCustomDomainsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// APIPortalCustomDomainsClientBeginDeleteOptions contains the optional parameters for the APIPortalCustomDomainsClient.BeginDelete -// method. -type APIPortalCustomDomainsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// APIPortalCustomDomainsClientGetOptions contains the optional parameters for the APIPortalCustomDomainsClient.Get method. -type APIPortalCustomDomainsClientGetOptions struct { - // placeholder for future optional parameters -} - -// APIPortalCustomDomainsClientListOptions contains the optional parameters for the APIPortalCustomDomainsClient.NewListPager -// method. -type APIPortalCustomDomainsClientListOptions struct { - // placeholder for future optional parameters -} - // APIPortalInstance - Collection of instances belong to the API portal type APIPortalInstance struct { // READ-ONLY; Name of the API portal instance @@ -148,43 +122,6 @@ type APIPortalResourceRequests struct { Memory *string } -// APIPortalsClientBeginCreateOrUpdateOptions contains the optional parameters for the APIPortalsClient.BeginCreateOrUpdate -// method. -type APIPortalsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// APIPortalsClientBeginDeleteOptions contains the optional parameters for the APIPortalsClient.BeginDelete method. -type APIPortalsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// APIPortalsClientGetOptions contains the optional parameters for the APIPortalsClient.Get method. -type APIPortalsClientGetOptions struct { - // placeholder for future optional parameters -} - -// APIPortalsClientListOptions contains the optional parameters for the APIPortalsClient.NewListPager method. -type APIPortalsClientListOptions struct { - // placeholder for future optional parameters -} - -// APIPortalsClientValidateDomainOptions contains the optional parameters for the APIPortalsClient.ValidateDomain method. -type APIPortalsClientValidateDomainOptions struct { - // placeholder for future optional parameters -} - -// AcceleratorAuthSettingClassification provides polymorphic access to related types. -// Call the interface's GetAcceleratorAuthSetting() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AcceleratorAuthSetting, *AcceleratorBasicAuthSetting, *AcceleratorPublicSetting, *AcceleratorSSHSetting -type AcceleratorAuthSettingClassification interface { - // GetAcceleratorAuthSetting returns the AcceleratorAuthSetting content of the underlying type. - GetAcceleratorAuthSetting() *AcceleratorAuthSetting -} - // AcceleratorAuthSetting - Auth setting payload. type AcceleratorAuthSetting struct { // REQUIRED; The type of the auth setting. @@ -202,6 +139,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 +177,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 +217,60 @@ 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 +} + // AppResource - App resource payload type AppResource struct { // The Managed Identity type of the app resource @@ -342,6 +339,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 @@ -430,31 +430,6 @@ type ApplicationAcceleratorResourceRequests struct { Memory *string } -// ApplicationAcceleratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationAcceleratorsClient.BeginCreateOrUpdate -// method. -type ApplicationAcceleratorsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationAcceleratorsClientBeginDeleteOptions contains the optional parameters for the ApplicationAcceleratorsClient.BeginDelete -// method. -type ApplicationAcceleratorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationAcceleratorsClientGetOptions contains the optional parameters for the ApplicationAcceleratorsClient.Get method. -type ApplicationAcceleratorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ApplicationAcceleratorsClientListOptions contains the optional parameters for the ApplicationAcceleratorsClient.NewListPager -// method. -type ApplicationAcceleratorsClientListOptions struct { - // placeholder for future optional parameters -} - // ApplicationInsightsAgentVersions - Application Insights agent versions properties payload type ApplicationInsightsAgentVersions struct { // READ-ONLY; Indicates the version of application insight java agent @@ -532,77 +507,6 @@ type ApplicationLiveViewResourceRequests struct { Memory *string } -// ApplicationLiveViewsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationLiveViewsClient.BeginCreateOrUpdate -// method. -type ApplicationLiveViewsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationLiveViewsClientBeginDeleteOptions contains the optional parameters for the ApplicationLiveViewsClient.BeginDelete -// method. -type ApplicationLiveViewsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ApplicationLiveViewsClientGetOptions contains the optional parameters for the ApplicationLiveViewsClient.Get method. -type ApplicationLiveViewsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ApplicationLiveViewsClientListOptions contains the optional parameters for the ApplicationLiveViewsClient.NewListPager -// method. -type ApplicationLiveViewsClientListOptions struct { - // placeholder for future optional parameters -} - -// AppsClientBeginCreateOrUpdateOptions contains the optional parameters for the AppsClient.BeginCreateOrUpdate method. -type AppsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AppsClientBeginDeleteOptions contains the optional parameters for the AppsClient.BeginDelete method. -type AppsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AppsClientBeginSetActiveDeploymentsOptions contains the optional parameters for the AppsClient.BeginSetActiveDeployments -// method. -type AppsClientBeginSetActiveDeploymentsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AppsClientBeginUpdateOptions contains the optional parameters for the AppsClient.BeginUpdate method. -type AppsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AppsClientGetOptions contains the optional parameters for the AppsClient.Get method. -type AppsClientGetOptions struct { - // Indicates whether sync status - SyncStatus *string -} - -// AppsClientGetResourceUploadURLOptions contains the optional parameters for the AppsClient.GetResourceUploadURL method. -type AppsClientGetResourceUploadURLOptions struct { - // placeholder for future optional parameters -} - -// AppsClientListOptions contains the optional parameters for the AppsClient.NewListPager method. -type AppsClientListOptions struct { - // placeholder for future optional parameters -} - -// AppsClientValidateDomainOptions contains the optional parameters for the AppsClient.ValidateDomain method. -type AppsClientValidateDomainOptions struct { - // placeholder for future optional parameters -} - // AvailableOperations - Available operations of the service type AvailableOperations struct { // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. @@ -641,11 +545,11 @@ type AzureFileVolume struct { // GetCustomPersistentDiskProperties implements the CustomPersistentDiskPropertiesClassification interface for type AzureFileVolume. func (a *AzureFileVolume) GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties { return &CustomPersistentDiskProperties{ - Type: a.Type, - MountPath: a.MountPath, - ReadOnly: a.ReadOnly, EnableSubPath: a.EnableSubPath, MountOptions: a.MountOptions, + MountPath: a.MountPath, + ReadOnly: a.ReadOnly, + Type: a.Type, } } @@ -703,34 +607,6 @@ type BindingResourceProperties struct { UpdatedAt *string } -// BindingsClientBeginCreateOrUpdateOptions contains the optional parameters for the BindingsClient.BeginCreateOrUpdate method. -type BindingsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BindingsClientBeginDeleteOptions contains the optional parameters for the BindingsClient.BeginDelete method. -type BindingsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BindingsClientBeginUpdateOptions contains the optional parameters for the BindingsClient.BeginUpdate method. -type BindingsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BindingsClientGetOptions contains the optional parameters for the BindingsClient.Get method. -type BindingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// BindingsClientListOptions contains the optional parameters for the BindingsClient.NewListPager method. -type BindingsClientListOptions struct { - // placeholder for future optional parameters -} - // Build resource payload type Build struct { // Properties of the build resource @@ -763,9 +639,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 +722,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 } @@ -882,24 +767,6 @@ type BuildService struct { Type *string } -// BuildServiceAgentPoolClientBeginUpdatePutOptions contains the optional parameters for the BuildServiceAgentPoolClient.BeginUpdatePut -// method. -type BuildServiceAgentPoolClientBeginUpdatePutOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BuildServiceAgentPoolClientGetOptions contains the optional parameters for the BuildServiceAgentPoolClient.Get method. -type BuildServiceAgentPoolClientGetOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceAgentPoolClientListOptions contains the optional parameters for the BuildServiceAgentPoolClient.NewListPager -// method. -type BuildServiceAgentPoolClientListOptions struct { - // placeholder for future optional parameters -} - // BuildServiceAgentPoolProperties - Build service agent pool properties type BuildServiceAgentPoolProperties struct { // build service agent pool size properties @@ -949,110 +816,6 @@ type BuildServiceAgentPoolSizeProperties struct { Memory *string } -// BuildServiceBuilderClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildServiceBuilderClient.BeginCreateOrUpdate -// method. -type BuildServiceBuilderClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BuildServiceBuilderClientBeginDeleteOptions contains the optional parameters for the BuildServiceBuilderClient.BeginDelete -// method. -type BuildServiceBuilderClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BuildServiceBuilderClientGetOptions contains the optional parameters for the BuildServiceBuilderClient.Get method. -type BuildServiceBuilderClientGetOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceBuilderClientListDeploymentsOptions contains the optional parameters for the BuildServiceBuilderClient.ListDeployments -// method. -type BuildServiceBuilderClientListDeploymentsOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceBuilderClientListOptions contains the optional parameters for the BuildServiceBuilderClient.NewListPager method. -type BuildServiceBuilderClientListOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientCreateOrUpdateBuildOptions contains the optional parameters for the BuildServiceClient.CreateOrUpdateBuild -// method. -type BuildServiceClientCreateOrUpdateBuildOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientGetBuildOptions contains the optional parameters for the BuildServiceClient.GetBuild method. -type BuildServiceClientGetBuildOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientGetBuildResultLogOptions contains the optional parameters for the BuildServiceClient.GetBuildResultLog -// method. -type BuildServiceClientGetBuildResultLogOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientGetBuildResultOptions contains the optional parameters for the BuildServiceClient.GetBuildResult method. -type BuildServiceClientGetBuildResultOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientGetBuildServiceOptions contains the optional parameters for the BuildServiceClient.GetBuildService method. -type BuildServiceClientGetBuildServiceOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientGetResourceUploadURLOptions contains the optional parameters for the BuildServiceClient.GetResourceUploadURL -// method. -type BuildServiceClientGetResourceUploadURLOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientGetSupportedBuildpackOptions contains the optional parameters for the BuildServiceClient.GetSupportedBuildpack -// method. -type BuildServiceClientGetSupportedBuildpackOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientGetSupportedStackOptions contains the optional parameters for the BuildServiceClient.GetSupportedStack -// method. -type BuildServiceClientGetSupportedStackOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientListBuildResultsOptions contains the optional parameters for the BuildServiceClient.NewListBuildResultsPager -// method. -type BuildServiceClientListBuildResultsOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientListBuildServicesOptions contains the optional parameters for the BuildServiceClient.NewListBuildServicesPager -// method. -type BuildServiceClientListBuildServicesOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientListBuildsOptions contains the optional parameters for the BuildServiceClient.NewListBuildsPager method. -type BuildServiceClientListBuildsOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientListSupportedBuildpacksOptions contains the optional parameters for the BuildServiceClient.ListSupportedBuildpacks -// method. -type BuildServiceClientListSupportedBuildpacksOptions struct { - // placeholder for future optional parameters -} - -// BuildServiceClientListSupportedStacksOptions contains the optional parameters for the BuildServiceClient.ListSupportedStacks -// method. -type BuildServiceClientListSupportedStacksOptions struct { - // placeholder for future optional parameters -} - // BuildServiceCollection - Object that includes an array of Build service resources and a possible link for next set type BuildServiceCollection struct { // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. @@ -1064,13 +827,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 } @@ -1137,35 +903,6 @@ type BuilderResourceCollection struct { Value []*BuilderResource } -// BuildpackBindingClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildpackBindingClient.BeginCreateOrUpdate -// method. -type BuildpackBindingClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BuildpackBindingClientBeginDeleteOptions contains the optional parameters for the BuildpackBindingClient.BeginDelete method. -type BuildpackBindingClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BuildpackBindingClientGetOptions contains the optional parameters for the BuildpackBindingClient.Get method. -type BuildpackBindingClientGetOptions struct { - // placeholder for future optional parameters -} - -// BuildpackBindingClientListForClusterOptions contains the optional parameters for the BuildpackBindingClient.NewListForClusterPager -// method. -type BuildpackBindingClientListForClusterOptions struct { - // placeholder for future optional parameters -} - -// BuildpackBindingClientListOptions contains the optional parameters for the BuildpackBindingClient.NewListPager method. -type BuildpackBindingClientListOptions struct { - // placeholder for future optional parameters -} - // BuildpackBindingLaunchProperties - Buildpack Binding Launch Properties type BuildpackBindingLaunchProperties struct { // Non-sensitive properties for launchProperties @@ -1230,15 +967,6 @@ type BuildpacksGroupProperties struct { Name *string } -// CertificatePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetCertificateProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *CertificateProperties, *ContentCertificateProperties, *KeyVaultCertificateProperties -type CertificatePropertiesClassification interface { - // GetCertificateProperties returns the CertificateProperties content of the underlying type. - GetCertificateProperties() *CertificateProperties -} - // CertificateProperties - Certificate resource payload. type CertificateProperties struct { // REQUIRED; The type of the certificate source. @@ -1272,6 +1000,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. @@ -1299,34 +1033,14 @@ type CertificateResourceCollection struct { Value []*CertificateResource } -// CertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the CertificatesClient.BeginCreateOrUpdate -// method. -type CertificatesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CertificatesClientBeginDeleteOptions contains the optional parameters for the CertificatesClient.BeginDelete method. -type CertificatesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CertificatesClientGetOptions contains the optional parameters for the CertificatesClient.Get method. -type CertificatesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CertificatesClientListOptions contains the optional parameters for the CertificatesClient.NewListPager method. -type CertificatesClientListOptions struct { - // placeholder for future optional parameters -} - // ClusterResourceProperties - Service properties payload type ClusterResourceProperties struct { // The name of the resource group that contains the infrastructure resources InfraResourceGroup *string + // Additional Service settings for planned maintenance + MaintenanceScheduleConfiguration MaintenanceScheduleConfigurationClassification + // The resource Id of the Managed Environment that the Spring Apps instance builds on ManagedEnvironmentID *string @@ -1349,7 +1063,7 @@ type ClusterResourceProperties struct { // READ-ONLY; Provisioning state of the Service ProvisioningState *ProvisioningState - // READ-ONLY; ServiceInstanceEntity GUID which uniquely identifies a created resource + // READ-ONLY; ServiceInstanceEntity Id which uniquely identifies a created resource ServiceID *string // READ-ONLY; Version of the Service @@ -1394,6 +1108,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 @@ -1446,30 +1163,6 @@ type ConfigServerSettingsValidateResult struct { IsValid *bool } -// ConfigServersClientBeginUpdatePatchOptions contains the optional parameters for the ConfigServersClient.BeginUpdatePatch -// method. -type ConfigServersClientBeginUpdatePatchOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConfigServersClientBeginUpdatePutOptions contains the optional parameters for the ConfigServersClient.BeginUpdatePut method. -type ConfigServersClientBeginUpdatePutOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConfigServersClientBeginValidateOptions contains the optional parameters for the ConfigServersClient.BeginValidate method. -type ConfigServersClientBeginValidateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ConfigServersClientGetOptions contains the optional parameters for the ConfigServersClient.Get method. -type ConfigServersClientGetOptions struct { - // placeholder for future optional parameters -} - // ConfigurationServiceGitProperty - Property of git environment. type ConfigurationServiceGitProperty struct { // Repositories of Application Configuration Service git property. @@ -1499,6 +1192,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 +1231,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 @@ -1597,42 +1299,89 @@ type ConfigurationServiceSettingsValidateResult struct { GitPropertyValidationResult *ConfigurationServiceGitPropertyValidateResult } -// ConfigurationServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationServicesClient.BeginCreateOrUpdate -// method. -type ConfigurationServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// ContainerProbeSettings - Container liveness and readiness probe settings +type ContainerProbeSettings struct { + // Indicates whether disable the liveness and readiness probe + DisableProbe *bool } -// ConfigurationServicesClientBeginDeleteOptions contains the optional parameters for the ConfigurationServicesClient.BeginDelete -// method. -type ConfigurationServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// 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 } -// ConfigurationServicesClientBeginValidateOptions contains the optional parameters for the ConfigurationServicesClient.BeginValidate -// method. -type ConfigurationServicesClientBeginValidateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// GetContainerRegistryCredentials implements the ContainerRegistryCredentialsClassification interface for type ContainerRegistryBasicCredentials. +func (c *ContainerRegistryBasicCredentials) GetContainerRegistryCredentials() *ContainerRegistryCredentials { + return &ContainerRegistryCredentials{ + Type: c.Type, + } } -// ConfigurationServicesClientGetOptions contains the optional parameters for the ConfigurationServicesClient.Get method. -type ConfigurationServicesClientGetOptions struct { - // placeholder for future optional parameters +// ContainerRegistryCredentials - The credential for the container registry resource. +type ContainerRegistryCredentials struct { + // REQUIRED; The credential type of the container registry credentials. + Type *string } -// ConfigurationServicesClientListOptions contains the optional parameters for the ConfigurationServicesClient.NewListPager -// method. -type ConfigurationServicesClientListOptions struct { - // placeholder for future optional parameters +// GetContainerRegistryCredentials implements the ContainerRegistryCredentialsClassification interface for type ContainerRegistryCredentials. +func (c *ContainerRegistryCredentials) GetContainerRegistryCredentials() *ContainerRegistryCredentials { + return c } -// ContainerProbeSettings - Container liveness and readiness probe settings -type ContainerProbeSettings struct { - // Indicates whether disable the liveness and readiness probe - DisableProbe *bool +// 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. @@ -1671,15 +1420,15 @@ type ContentCertificateProperties struct { // GetCertificateProperties implements the CertificatePropertiesClassification interface for type ContentCertificateProperties. func (c *ContentCertificateProperties) GetCertificateProperties() *CertificateProperties { return &CertificateProperties{ - Type: c.Type, - Thumbprint: c.Thumbprint, - Issuer: c.Issuer, - IssuedDate: c.IssuedDate, - ExpirationDate: c.ExpirationDate, ActivateDate: c.ActivateDate, - SubjectName: c.SubjectName, DNSNames: c.DNSNames, + ExpirationDate: c.ExpirationDate, + IssuedDate: c.IssuedDate, + Issuer: c.Issuer, ProvisioningState: c.ProvisioningState, + SubjectName: c.SubjectName, + Thumbprint: c.Thumbprint, + Type: c.Type, } } @@ -1697,7 +1446,7 @@ type CustomContainer struct { // Credential of the image registry ImageRegistryCredential *ImageRegistryCredential - // Language framework of the container image uploaded + // Language framework of the container image uploaded. Supported values: "springboot", "", null. LanguageFramework *string // The name of the registry that contains the container image @@ -1781,44 +1530,6 @@ type CustomDomainValidateResult struct { Message *string } -// CustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomDomainsClient.BeginCreateOrUpdate -// method. -type CustomDomainsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CustomDomainsClientBeginDeleteOptions contains the optional parameters for the CustomDomainsClient.BeginDelete method. -type CustomDomainsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CustomDomainsClientBeginUpdateOptions contains the optional parameters for the CustomDomainsClient.BeginUpdate method. -type CustomDomainsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CustomDomainsClientGetOptions contains the optional parameters for the CustomDomainsClient.Get method. -type CustomDomainsClientGetOptions struct { - // placeholder for future optional parameters -} - -// CustomDomainsClientListOptions contains the optional parameters for the CustomDomainsClient.NewListPager method. -type CustomDomainsClientListOptions struct { - // placeholder for future optional parameters -} - -// CustomPersistentDiskPropertiesClassification provides polymorphic access to related types. -// Call the interface's GetCustomPersistentDiskProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureFileVolume, *CustomPersistentDiskProperties -type CustomPersistentDiskPropertiesClassification interface { - // GetCustomPersistentDiskProperties returns the CustomPersistentDiskProperties content of the underlying type. - GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties -} - // CustomPersistentDiskProperties - Custom persistent disk resource payload. type CustomPersistentDiskProperties struct { // REQUIRED; The mount path of the persistent disk. @@ -1911,37 +1622,6 @@ type CustomizedAcceleratorValidateResult struct { State *CustomizedAcceleratorValidateResultState } -// CustomizedAcceleratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomizedAcceleratorsClient.BeginCreateOrUpdate -// method. -type CustomizedAcceleratorsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CustomizedAcceleratorsClientBeginDeleteOptions contains the optional parameters for the CustomizedAcceleratorsClient.BeginDelete -// method. -type CustomizedAcceleratorsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CustomizedAcceleratorsClientGetOptions contains the optional parameters for the CustomizedAcceleratorsClient.Get method. -type CustomizedAcceleratorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// CustomizedAcceleratorsClientListOptions contains the optional parameters for the CustomizedAcceleratorsClient.NewListPager -// method. -type CustomizedAcceleratorsClientListOptions struct { - // placeholder for future optional parameters -} - -// CustomizedAcceleratorsClientValidateOptions contains the optional parameters for the CustomizedAcceleratorsClient.Validate -// method. -type CustomizedAcceleratorsClientValidateOptions struct { - // placeholder for future optional parameters -} - // DeploymentInstance - Deployment instance payload type DeploymentInstance struct { // READ-ONLY; Discovery status of the deployment instance @@ -2025,6 +1705,9 @@ type DeploymentSettings struct { // Collection of addons AddonConfigs map[string]any + // Collection of ApmReferences + Apms []*ApmReference + // Container liveness and readiness probe settings ContainerProbeSettings *ContainerProbeSettings @@ -2064,106 +1747,15 @@ type DeploymentSettings struct { TerminationGracePeriodSeconds *int32 } -// DeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdate -// method. -type DeploymentsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeploymentsClientBeginDeleteOptions contains the optional parameters for the DeploymentsClient.BeginDelete method. -type DeploymentsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeploymentsClientBeginDisableRemoteDebuggingOptions contains the optional parameters for the DeploymentsClient.BeginDisableRemoteDebugging -// method. -type DeploymentsClientBeginDisableRemoteDebuggingOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeploymentsClientBeginEnableRemoteDebuggingOptions contains the optional parameters for the DeploymentsClient.BeginEnableRemoteDebugging -// method. -type DeploymentsClientBeginEnableRemoteDebuggingOptions struct { - // Parameters for enable remote debugging - RemoteDebuggingPayload *RemoteDebuggingPayload - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeploymentsClientBeginGenerateHeapDumpOptions contains the optional parameters for the DeploymentsClient.BeginGenerateHeapDump -// method. -type DeploymentsClientBeginGenerateHeapDumpOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeploymentsClientBeginGenerateThreadDumpOptions contains the optional parameters for the DeploymentsClient.BeginGenerateThreadDump -// method. -type DeploymentsClientBeginGenerateThreadDumpOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeploymentsClientBeginRestartOptions contains the optional parameters for the DeploymentsClient.BeginRestart method. -type DeploymentsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeploymentsClientBeginStartJFROptions contains the optional parameters for the DeploymentsClient.BeginStartJFR method. -type DeploymentsClientBeginStartJFROptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeploymentsClientBeginStartOptions contains the optional parameters for the DeploymentsClient.BeginStart method. -type DeploymentsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeploymentsClientBeginStopOptions contains the optional parameters for the DeploymentsClient.BeginStop method. -type DeploymentsClientBeginStopOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeploymentsClientBeginUpdateOptions contains the optional parameters for the DeploymentsClient.BeginUpdate method. -type DeploymentsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DeploymentsClientGetLogFileURLOptions contains the optional parameters for the DeploymentsClient.GetLogFileURL method. -type DeploymentsClientGetLogFileURLOptions struct { - // placeholder for future optional parameters -} - -// DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method. -type DeploymentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DeploymentsClientGetRemoteDebuggingConfigOptions contains the optional parameters for the DeploymentsClient.GetRemoteDebuggingConfig -// method. -type DeploymentsClientGetRemoteDebuggingConfigOptions struct { - // placeholder for future optional parameters -} +type DevToolPortalComponent struct { + // READ-ONLY; Collection of instances belong to Dev Tool Portal. + Instances []*DevToolPortalInstance -// DeploymentsClientListForClusterOptions contains the optional parameters for the DeploymentsClient.NewListForClusterPager -// method. -type DeploymentsClientListForClusterOptions struct { - // Version of the deployments to be listed - Version []string -} + // READ-ONLY + Name *string -// DeploymentsClientListOptions contains the optional parameters for the DeploymentsClient.NewListPager method. -type DeploymentsClientListOptions struct { - // Version of the deployments to be listed - Version []string + // READ-ONLY; The requested resource quantity for required CPU and Memory. + ResourceRequests *DevToolPortalResourceRequests } // DevToolPortalFeatureDetail - Detail settings for Dev Tool Portal feature @@ -2204,15 +1796,12 @@ type DevToolPortalProperties struct { // Single sign-on related configuration SsoProperties *DevToolPortalSsoProperties - // READ-ONLY; Collection of instances belong to Dev Tool Portal. - Instances []*DevToolPortalInstance + // READ-ONLY; Collection of components belong to Dev Tool Portal. + Components []*DevToolPortalComponent // READ-ONLY; State of the Dev Tool Portal. ProvisioningState *DevToolPortalProvisioningState - // READ-ONLY; The requested resource quantity for required CPU and Memory. - ResourceRequests *DevToolPortalResourceRequests - // READ-ONLY; URL of the resource, exposed when 'public' is true. URL *string } @@ -2272,29 +1861,6 @@ type DevToolPortalSsoProperties struct { Scopes []*string } -// DevToolPortalsClientBeginCreateOrUpdateOptions contains the optional parameters for the DevToolPortalsClient.BeginCreateOrUpdate -// method. -type DevToolPortalsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DevToolPortalsClientBeginDeleteOptions contains the optional parameters for the DevToolPortalsClient.BeginDelete method. -type DevToolPortalsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DevToolPortalsClientGetOptions contains the optional parameters for the DevToolPortalsClient.Get method. -type DevToolPortalsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DevToolPortalsClientListOptions contains the optional parameters for the DevToolPortalsClient.NewListPager method. -type DevToolPortalsClientListOptions struct { - // placeholder for future optional parameters -} - // DiagnosticParameters - Diagnostic parameters of diagnostic operations type DiagnosticParameters struct { // App instance name @@ -2316,6 +1882,46 @@ 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 +} + // 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 +2004,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 @@ -2442,31 +2051,6 @@ type GatewayCustomDomainResourceCollection struct { Value []*GatewayCustomDomainResource } -// GatewayCustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewayCustomDomainsClient.BeginCreateOrUpdate -// method. -type GatewayCustomDomainsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GatewayCustomDomainsClientBeginDeleteOptions contains the optional parameters for the GatewayCustomDomainsClient.BeginDelete -// method. -type GatewayCustomDomainsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GatewayCustomDomainsClientGetOptions contains the optional parameters for the GatewayCustomDomainsClient.Get method. -type GatewayCustomDomainsClientGetOptions struct { - // placeholder for future optional parameters -} - -// GatewayCustomDomainsClientListOptions contains the optional parameters for the GatewayCustomDomainsClient.NewListPager -// method. -type GatewayCustomDomainsClientListOptions struct { - // placeholder for future optional parameters -} - // GatewayInstance - Collection of instances belong to the Spring Cloud Gateway type GatewayInstance struct { // READ-ONLY; Name of the Spring Cloud Gateway instance @@ -2502,9 +2086,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 +2126,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 @@ -2647,68 +2246,6 @@ type GatewayRouteConfigResourceCollection struct { Value []*GatewayRouteConfigResource } -// GatewayRouteConfigsClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewayRouteConfigsClient.BeginCreateOrUpdate -// method. -type GatewayRouteConfigsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GatewayRouteConfigsClientBeginDeleteOptions contains the optional parameters for the GatewayRouteConfigsClient.BeginDelete -// method. -type GatewayRouteConfigsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GatewayRouteConfigsClientGetOptions contains the optional parameters for the GatewayRouteConfigsClient.Get method. -type GatewayRouteConfigsClientGetOptions struct { - // placeholder for future optional parameters -} - -// GatewayRouteConfigsClientListOptions contains the optional parameters for the GatewayRouteConfigsClient.NewListPager method. -type GatewayRouteConfigsClientListOptions struct { - // placeholder for future optional parameters -} - -// GatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewaysClient.BeginCreateOrUpdate method. -type GatewaysClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GatewaysClientBeginDeleteOptions contains the optional parameters for the GatewaysClient.BeginDelete method. -type GatewaysClientBeginDeleteOptions 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. - ResumeToken string -} - -// GatewaysClientGetOptions contains the optional parameters for the GatewaysClient.Get method. -type GatewaysClientGetOptions struct { - // placeholder for future optional parameters -} - -// GatewaysClientListEnvSecretsOptions contains the optional parameters for the GatewaysClient.ListEnvSecrets method. -type GatewaysClientListEnvSecretsOptions struct { - // placeholder for future optional parameters -} - -// GatewaysClientListOptions contains the optional parameters for the GatewaysClient.NewListPager method. -type GatewaysClientListOptions struct { - // placeholder for future optional parameters -} - -// GatewaysClientValidateDomainOptions contains the optional parameters for the GatewaysClient.ValidateDomain method. -type GatewaysClientValidateDomainOptions struct { - // placeholder for future optional parameters -} - // GitPatternRepository - Git repository property payload for config server type GitPatternRepository struct { // REQUIRED; Name of the repository @@ -2745,6 +2282,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. @@ -2898,15 +2441,15 @@ type KeyVaultCertificateProperties struct { // GetCertificateProperties implements the CertificatePropertiesClassification interface for type KeyVaultCertificateProperties. func (k *KeyVaultCertificateProperties) GetCertificateProperties() *CertificateProperties { return &CertificateProperties{ - Type: k.Type, - Thumbprint: k.Thumbprint, - Issuer: k.Issuer, - IssuedDate: k.IssuedDate, - ExpirationDate: k.ExpirationDate, ActivateDate: k.ActivateDate, - SubjectName: k.SubjectName, DNSNames: k.DNSNames, + ExpirationDate: k.ExpirationDate, + IssuedDate: k.IssuedDate, + Issuer: k.Issuer, ProvisioningState: k.ProvisioningState, + SubjectName: k.SubjectName, + Thumbprint: k.Thumbprint, + Type: k.Type, } } @@ -2937,6 +2480,17 @@ type LogSpecification struct { Name *string } +// MaintenanceScheduleConfiguration - Configuration for the planned maintenance +type MaintenanceScheduleConfiguration struct { + // REQUIRED; The frequency to run the maintenance job + Frequency *Frequency +} + +// GetMaintenanceScheduleConfiguration implements the MaintenanceScheduleConfigurationClassification interface for type MaintenanceScheduleConfiguration. +func (m *MaintenanceScheduleConfiguration) GetMaintenanceScheduleConfiguration() *MaintenanceScheduleConfiguration { + return m +} + // ManagedIdentityProperties - Managed identity properties retrieved from ARM request headers. type ManagedIdentityProperties struct { // Principal Id of system-assigned managed identity. @@ -3053,25 +2607,6 @@ type MonitoringSettingResource struct { Type *string } -// MonitoringSettingsClientBeginUpdatePatchOptions contains the optional parameters for the MonitoringSettingsClient.BeginUpdatePatch -// method. -type MonitoringSettingsClientBeginUpdatePatchOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MonitoringSettingsClientBeginUpdatePutOptions contains the optional parameters for the MonitoringSettingsClient.BeginUpdatePut -// method. -type MonitoringSettingsClientBeginUpdatePutOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// MonitoringSettingsClientGetOptions contains the optional parameters for the MonitoringSettingsClient.Get method. -type MonitoringSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - // NameAvailability - Name availability result payload type NameAvailability struct { // Message why the name is not available @@ -3206,11 +2741,6 @@ type OperationProperties struct { ServiceSpecification *ServiceSpecification } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // PersistentDisk - Persistent disk payload type PersistentDisk struct { // Mount path of the persistent disk @@ -3270,31 +2800,6 @@ type PredefinedAcceleratorResourceCollection struct { Value []*PredefinedAcceleratorResource } -// PredefinedAcceleratorsClientBeginDisableOptions contains the optional parameters for the PredefinedAcceleratorsClient.BeginDisable -// method. -type PredefinedAcceleratorsClientBeginDisableOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PredefinedAcceleratorsClientBeginEnableOptions contains the optional parameters for the PredefinedAcceleratorsClient.BeginEnable -// method. -type PredefinedAcceleratorsClientBeginEnableOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PredefinedAcceleratorsClientGetOptions contains the optional parameters for the PredefinedAcceleratorsClient.Get method. -type PredefinedAcceleratorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// PredefinedAcceleratorsClientListOptions contains the optional parameters for the PredefinedAcceleratorsClient.NewListPager -// method. -type PredefinedAcceleratorsClientListOptions struct { - // placeholder for future optional parameters -} - // Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive // traffic. type Probe struct { @@ -3321,15 +2826,6 @@ type Probe struct { TimeoutSeconds *int32 } -// ProbeActionClassification provides polymorphic access to related types. -// Call the interface's GetProbeAction() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ExecAction, *HTTPGetAction, *ProbeAction, *TCPSocketAction -type ProbeActionClassification interface { - // GetProbeAction returns the ProbeAction content of the underlying type. - GetProbeAction() *ProbeAction -} - // ProbeAction - The action of the probe. type ProbeAction struct { // REQUIRED; The type of the action to take to perform the health check. @@ -3528,12 +3024,6 @@ type ResourceUploadDefinition struct { UploadURL *string } -// RuntimeVersionsClientListRuntimeVersionsOptions contains the optional parameters for the RuntimeVersionsClient.ListRuntimeVersions -// method. -type RuntimeVersionsClientListRuntimeVersionsOptions struct { - // placeholder for future optional parameters -} - // SKU - Sku of Azure Spring Apps type SKU struct { // Current capacity of the target resource @@ -3567,11 +3057,6 @@ type SKUObject struct { SKU *SKU } -// SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method. -type SKUsClientListOptions struct { - // placeholder for future optional parameters -} - // Scale - Azure Spring Apps scaling configurations. type Scale struct { // Optional. Maximum number of container replicas. Defaults to 10 if not set. @@ -3620,30 +3105,6 @@ type Secret struct { Value *string } -// ServiceRegistriesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceRegistriesClient.BeginCreateOrUpdate -// method. -type ServiceRegistriesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServiceRegistriesClientBeginDeleteOptions contains the optional parameters for the ServiceRegistriesClient.BeginDelete -// method. -type ServiceRegistriesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServiceRegistriesClientGetOptions contains the optional parameters for the ServiceRegistriesClient.Get method. -type ServiceRegistriesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServiceRegistriesClientListOptions contains the optional parameters for the ServiceRegistriesClient.NewListPager method. -type ServiceRegistriesClientListOptions struct { - // placeholder for future optional parameters -} - // ServiceRegistryInstance - Collection of instances belong to the Service Registry type ServiceRegistryInstance struct { // READ-ONLY; Name of the Service Registry instance @@ -3752,82 +3213,14 @@ 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 } -// ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. -type ServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. -type ServicesClientBeginDeleteOptions 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. - ResumeToken string -} - -// ServicesClientBeginStopOptions contains the optional parameters for the ServicesClient.BeginStop method. -type ServicesClientBeginStopOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. -type ServicesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability -// method. -type ServicesClientCheckNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientDisableTestEndpointOptions contains the optional parameters for the ServicesClient.DisableTestEndpoint method. -type ServicesClientDisableTestEndpointOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientEnableTestEndpointOptions contains the optional parameters for the ServicesClient.EnableTestEndpoint method. -type ServicesClientEnableTestEndpointOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. -type ServicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager -// method. -type ServicesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientListOptions contains the optional parameters for the ServicesClient.NewListPager method. -type ServicesClientListOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientListTestKeysOptions contains the optional parameters for the ServicesClient.ListTestKeys method. -type ServicesClientListTestKeysOptions struct { - // placeholder for future optional parameters -} - -// ServicesClientRegenerateTestKeyOptions contains the optional parameters for the ServicesClient.RegenerateTestKey method. -type ServicesClientRegenerateTestKeyOptions struct { - // placeholder for future optional parameters -} - // SourceUploadedUserSourceInfo - Uploaded Java source code binary for a deployment type SourceUploadedUserSourceInfo struct { // REQUIRED; Type of the source uploaded @@ -3907,15 +3300,6 @@ func (s *StorageAccount) GetStorageProperties() *StorageProperties { } } -// StoragePropertiesClassification provides polymorphic access to related types. -// Call the interface's GetStorageProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *StorageAccount, *StorageProperties -type StoragePropertiesClassification interface { - // GetStorageProperties returns the StorageProperties content of the underlying type. - GetStorageProperties() *StorageProperties -} - // StorageProperties - Storage resource payload. type StorageProperties struct { // REQUIRED; The type of the storage. @@ -3952,26 +3336,19 @@ type StorageResourceCollection struct { Value []*StorageResource } -// StoragesClientBeginCreateOrUpdateOptions contains the optional parameters for the StoragesClient.BeginCreateOrUpdate method. -type StoragesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// StoragesClientBeginDeleteOptions contains the optional parameters for the StoragesClient.BeginDelete method. -type StoragesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// SupportedApmType - Supported APM type +type SupportedApmType struct { + // The name of the supported APM type + Name *string } -// StoragesClientGetOptions contains the optional parameters for the StoragesClient.Get method. -type StoragesClientGetOptions struct { - // placeholder for future optional parameters -} +// 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 -// StoragesClientListOptions contains the optional parameters for the StoragesClient.NewListPager method. -type StoragesClientListOptions struct { - // placeholder for future optional parameters + // Collection of the supported APM type + Value []*SupportedApmType } // SupportedBuildpackResource - Supported buildpack resource payload @@ -4153,16 +3530,6 @@ type TriggeredBuildResult struct { ID *string } -// UploadedUserSourceInfoClassification provides polymorphic access to related types. -// Call the interface's GetUploadedUserSourceInfo() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *JarUploadedUserSourceInfo, *NetCoreZipUploadedUserSourceInfo, *SourceUploadedUserSourceInfo, *UploadedUserSourceInfo -type UploadedUserSourceInfoClassification interface { - UserSourceInfoClassification - // GetUploadedUserSourceInfo returns the UploadedUserSourceInfo content of the underlying type. - GetUploadedUserSourceInfo() *UploadedUserSourceInfo -} - // UploadedUserSourceInfo - Source with uploaded location type UploadedUserSourceInfo struct { // REQUIRED; Type of the source uploaded @@ -4195,16 +3562,6 @@ type UserAssignedManagedIdentity struct { PrincipalID *string } -// UserSourceInfoClassification provides polymorphic access to related types. -// Call the interface's GetUserSourceInfo() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *BuildResultUserSourceInfo, *CustomContainerUserSourceInfo, *JarUploadedUserSourceInfo, *NetCoreZipUploadedUserSourceInfo, -// - *SourceUploadedUserSourceInfo, *UploadedUserSourceInfo, *UserSourceInfo -type UserSourceInfoClassification interface { - // GetUserSourceInfo returns the UserSourceInfo content of the underlying type. - GetUserSourceInfo() *UserSourceInfo -} - // UserSourceInfo - Source information for a deployment type UserSourceInfo struct { // REQUIRED; Type of the source uploaded @@ -4225,3 +3582,63 @@ type ValidationMessages struct { // The name of the configuration service git repository. Name *string } + +// WarUploadedUserSourceInfo - Uploaded War binary for a deployment +type WarUploadedUserSourceInfo struct { + // REQUIRED; Type of the source uploaded + Type *string + + // JVM parameter + JvmOptions *string + + // Relative path of the storage which stores the source + RelativePath *string + + // Runtime version of the war file + RuntimeVersion *string + + // Server version, currently only Apache Tomcat is supported + ServerVersion *string + + // Version of the source + Version *string +} + +// GetUploadedUserSourceInfo implements the UploadedUserSourceInfoClassification interface for type WarUploadedUserSourceInfo. +func (w *WarUploadedUserSourceInfo) GetUploadedUserSourceInfo() *UploadedUserSourceInfo { + return &UploadedUserSourceInfo{ + RelativePath: w.RelativePath, + Type: w.Type, + Version: w.Version, + } +} + +// GetUserSourceInfo implements the UserSourceInfoClassification interface for type WarUploadedUserSourceInfo. +func (w *WarUploadedUserSourceInfo) GetUserSourceInfo() *UserSourceInfo { + return &UserSourceInfo{ + Type: w.Type, + Version: w.Version, + } +} + +// WeeklyMaintenanceScheduleConfiguration - Weekly planned maintenance +type WeeklyMaintenanceScheduleConfiguration struct { + // REQUIRED; The day to run the maintenance job + Day *WeekDay + + // REQUIRED; The frequency to run the maintenance job + Frequency *Frequency + + // REQUIRED; The hour to run the maintenance job + Hour *int32 + + // READ-ONLY; The duration time to run the maintenance job + DurationHours *int32 +} + +// GetMaintenanceScheduleConfiguration implements the MaintenanceScheduleConfigurationClassification interface for type WeeklyMaintenanceScheduleConfiguration. +func (w *WeeklyMaintenanceScheduleConfiguration) GetMaintenanceScheduleConfiguration() *MaintenanceScheduleConfiguration { + return &MaintenanceScheduleConfiguration{ + Frequency: w.Frequency, + } +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/models_serde.go b/sdk/resourcemanager/appplatform/armappplatform/models_serde.go index 9530c2fd6528..809676700253 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/models_serde.go +++ b/sdk/resourcemanager/appplatform/armappplatform/models_serde.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -347,6 +346,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 +364,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 +432,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 +448,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 +525,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 +791,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 +846,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 +1643,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 +1666,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 +1836,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 +1860,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 +2129,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 +2145,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 +2601,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) @@ -2486,6 +2707,7 @@ func (c ClusterResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "fqdn", c.Fqdn) populate(objectMap, "infraResourceGroup", c.InfraResourceGroup) + populate(objectMap, "maintenanceScheduleConfiguration", c.MaintenanceScheduleConfiguration) populate(objectMap, "managedEnvironmentId", c.ManagedEnvironmentID) populate(objectMap, "marketplaceResource", c.MarketplaceResource) populate(objectMap, "networkProfile", c.NetworkProfile) @@ -2513,6 +2735,9 @@ func (c *ClusterResourceProperties) UnmarshalJSON(data []byte) error { case "infraResourceGroup": err = unpopulate(val, "InfraResourceGroup", &c.InfraResourceGroup) delete(rawMsg, key) + case "maintenanceScheduleConfiguration": + c.MaintenanceScheduleConfiguration, err = unmarshalMaintenanceScheduleConfigurationClassification(val) + delete(rawMsg, key) case "managedEnvironmentId": err = unpopulate(val, "ManagedEnvironmentID", &c.ManagedEnvironmentID) delete(rawMsg, key) @@ -2615,6 +2840,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 +2858,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 +3072,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 +3097,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 +3178,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 +3195,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) @@ -3167,6 +3408,208 @@ func (c *ContainerProbeSettings) UnmarshalJSON(data []byte) error { 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, "credentials", c.Credentials) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "credentials": + c.Credentials, err = unmarshalContainerRegistryCredentialsClassification(val) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryResource. +func (c ContainerRegistryResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryResourceCollection. +func (c ContainerRegistryResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryValidateResult. +func (c ContainerRegistryValidateResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isValid", c.IsValid) + populate(objectMap, "message", c.Message) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + 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 { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ContentCertificateProperties. func (c ContentCertificateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3951,6 +4394,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 +4418,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) @@ -4006,6 +4453,41 @@ func (d *DeploymentSettings) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DevToolPortalComponent. +func (d DevToolPortalComponent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "instances", d.Instances) + populate(objectMap, "name", d.Name) + populate(objectMap, "resourceRequests", d.ResourceRequests) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DevToolPortalComponent. +func (d *DevToolPortalComponent) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "instances": + err = unpopulate(val, "Instances", &d.Instances) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "resourceRequests": + err = unpopulate(val, "ResourceRequests", &d.ResourceRequests) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DevToolPortalFeatureDetail. func (d DevToolPortalFeatureDetail) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4102,11 +4584,10 @@ func (d *DevToolPortalInstance) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DevToolPortalProperties. func (d DevToolPortalProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "components", d.Components) populate(objectMap, "features", d.Features) - populate(objectMap, "instances", d.Instances) populate(objectMap, "provisioningState", d.ProvisioningState) populate(objectMap, "public", d.Public) - populate(objectMap, "resourceRequests", d.ResourceRequests) populate(objectMap, "ssoProperties", d.SsoProperties) populate(objectMap, "url", d.URL) return json.Marshal(objectMap) @@ -4121,21 +4602,18 @@ func (d *DevToolPortalProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "components": + err = unpopulate(val, "Components", &d.Components) + delete(rawMsg, key) case "features": err = unpopulate(val, "Features", &d.Features) delete(rawMsg, key) - case "instances": - err = unpopulate(val, "Instances", &d.Instances) - delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) delete(rawMsg, key) case "public": err = unpopulate(val, "Public", &d.Public) delete(rawMsg, key) - case "resourceRequests": - err = unpopulate(val, "ResourceRequests", &d.ResourceRequests) - delete(rawMsg, key) case "ssoProperties": err = unpopulate(val, "SsoProperties", &d.SsoProperties) delete(rawMsg, key) @@ -4364,6 +4842,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 +5090,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 +5115,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 +5337,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 +5365,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 +5412,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 +5806,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) @@ -5585,6 +6242,33 @@ func (l *LogSpecification) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MaintenanceScheduleConfiguration. +func (m MaintenanceScheduleConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["frequency"] = m.Frequency + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceScheduleConfiguration. +func (m *MaintenanceScheduleConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "frequency": + err = unpopulate(val, "Frequency", &m.Frequency) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManagedIdentityProperties. func (m ManagedIdentityProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -7485,6 +8169,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 +8183,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 +8446,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) @@ -8380,6 +9126,92 @@ func (v *ValidationMessages) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WarUploadedUserSourceInfo. +func (w WarUploadedUserSourceInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "jvmOptions", w.JvmOptions) + populate(objectMap, "relativePath", w.RelativePath) + populate(objectMap, "runtimeVersion", w.RuntimeVersion) + populate(objectMap, "serverVersion", w.ServerVersion) + objectMap["type"] = "War" + populate(objectMap, "version", w.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WarUploadedUserSourceInfo. +func (w *WarUploadedUserSourceInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "jvmOptions": + err = unpopulate(val, "JvmOptions", &w.JvmOptions) + delete(rawMsg, key) + case "relativePath": + err = unpopulate(val, "RelativePath", &w.RelativePath) + delete(rawMsg, key) + case "runtimeVersion": + err = unpopulate(val, "RuntimeVersion", &w.RuntimeVersion) + delete(rawMsg, key) + case "serverVersion": + err = unpopulate(val, "ServerVersion", &w.ServerVersion) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &w.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WeeklyMaintenanceScheduleConfiguration. +func (w WeeklyMaintenanceScheduleConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "day", w.Day) + populate(objectMap, "durationHours", w.DurationHours) + objectMap["frequency"] = FrequencyWeekly + populate(objectMap, "hour", w.Hour) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WeeklyMaintenanceScheduleConfiguration. +func (w *WeeklyMaintenanceScheduleConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "day": + err = unpopulate(val, "Day", &w.Day) + delete(rawMsg, key) + case "durationHours": + err = unpopulate(val, "DurationHours", &w.DurationHours) + delete(rawMsg, key) + case "frequency": + err = unpopulate(val, "Frequency", &w.Frequency) + delete(rawMsg, key) + case "hour": + err = unpopulate(val, "Hour", &w.Hour) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + func populate(m map[string]any, k string, v any) { if v == nil { return diff --git a/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go b/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go index 28608234a7fd..8e8dfa40872e 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,24 +47,27 @@ 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-09-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 - MonitoringSettingsClientGetOptions contains the optional parameters for the MonitoringSettingsClient.Get method. func (client *MonitoringSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *MonitoringSettingsClientGetOptions) (MonitoringSettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return MonitoringSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MonitoringSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MonitoringSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MonitoringSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -88,7 +90,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +108,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-09-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. @@ -119,7 +121,8 @@ func (client *MonitoringSettingsClient) BeginUpdatePatch(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller[MonitoringSettingsClientUpdatePatchResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[MonitoringSettingsClientUpdatePatchResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[MonitoringSettingsClientUpdatePatchResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -128,20 +131,22 @@ 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-09-01-preview func (client *MonitoringSettingsClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, monitoringSettingResource MonitoringSettingResource, options *MonitoringSettingsClientBeginUpdatePatchOptions) (*http.Response, error) { + var err error req, err := client.updatePatchCreateRequest(ctx, resourceGroupName, serviceName, monitoringSettingResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updatePatchCreateRequest creates the UpdatePatch request. @@ -164,16 +169,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, monitoringSettingResource) + if err := runtime.MarshalAsJSON(req, monitoringSettingResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -186,7 +194,8 @@ func (client *MonitoringSettingsClient) BeginUpdatePut(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller[MonitoringSettingsClientUpdatePutResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[MonitoringSettingsClientUpdatePutResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[MonitoringSettingsClientUpdatePutResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -195,20 +204,22 @@ 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-09-01-preview func (client *MonitoringSettingsClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, monitoringSettingResource MonitoringSettingResource, options *MonitoringSettingsClientBeginUpdatePutOptions) (*http.Response, error) { + var err error req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, monitoringSettingResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updatePutCreateRequest creates the UpdatePut request. @@ -231,8 +242,11 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, monitoringSettingResource) + if err := runtime.MarshalAsJSON(req, monitoringSettingResource); err != nil { + return nil, err + } + return req, nil } 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..7466e0d57943 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/operations_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/operations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -40,7 +39,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-09-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 +77,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-09-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/options.go b/sdk/resourcemanager/appplatform/armappplatform/options.go new file mode 100644 index 000000000000..00b4e0559eb8 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/options.go @@ -0,0 +1,1008 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armappplatform + +// APIPortalCustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the APIPortalCustomDomainsClient.BeginCreateOrUpdate +// method. +type APIPortalCustomDomainsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIPortalCustomDomainsClientBeginDeleteOptions contains the optional parameters for the APIPortalCustomDomainsClient.BeginDelete +// method. +type APIPortalCustomDomainsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIPortalCustomDomainsClientGetOptions contains the optional parameters for the APIPortalCustomDomainsClient.Get method. +type APIPortalCustomDomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIPortalCustomDomainsClientListOptions contains the optional parameters for the APIPortalCustomDomainsClient.NewListPager +// method. +type APIPortalCustomDomainsClientListOptions struct { + // placeholder for future optional parameters +} + +// APIPortalsClientBeginCreateOrUpdateOptions contains the optional parameters for the APIPortalsClient.BeginCreateOrUpdate +// method. +type APIPortalsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIPortalsClientBeginDeleteOptions contains the optional parameters for the APIPortalsClient.BeginDelete method. +type APIPortalsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIPortalsClientGetOptions contains the optional parameters for the APIPortalsClient.Get method. +type APIPortalsClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIPortalsClientListOptions contains the optional parameters for the APIPortalsClient.NewListPager method. +type APIPortalsClientListOptions struct { + // placeholder for future optional parameters +} + +// APIPortalsClientValidateDomainOptions contains the optional parameters for the APIPortalsClient.ValidateDomain method. +type APIPortalsClientValidateDomainOptions struct { + // placeholder for future optional parameters +} + +// 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 +} + +// ApplicationAcceleratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationAcceleratorsClient.BeginCreateOrUpdate +// method. +type ApplicationAcceleratorsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationAcceleratorsClientBeginDeleteOptions contains the optional parameters for the ApplicationAcceleratorsClient.BeginDelete +// method. +type ApplicationAcceleratorsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationAcceleratorsClientGetOptions contains the optional parameters for the ApplicationAcceleratorsClient.Get method. +type ApplicationAcceleratorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationAcceleratorsClientListOptions contains the optional parameters for the ApplicationAcceleratorsClient.NewListPager +// method. +type ApplicationAcceleratorsClientListOptions struct { + // placeholder for future optional parameters +} + +// ApplicationLiveViewsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationLiveViewsClient.BeginCreateOrUpdate +// method. +type ApplicationLiveViewsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationLiveViewsClientBeginDeleteOptions contains the optional parameters for the ApplicationLiveViewsClient.BeginDelete +// method. +type ApplicationLiveViewsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationLiveViewsClientGetOptions contains the optional parameters for the ApplicationLiveViewsClient.Get method. +type ApplicationLiveViewsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationLiveViewsClientListOptions contains the optional parameters for the ApplicationLiveViewsClient.NewListPager +// method. +type ApplicationLiveViewsClientListOptions struct { + // placeholder for future optional parameters +} + +// AppsClientBeginCreateOrUpdateOptions contains the optional parameters for the AppsClient.BeginCreateOrUpdate method. +type AppsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AppsClientBeginDeleteOptions contains the optional parameters for the AppsClient.BeginDelete method. +type AppsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AppsClientBeginSetActiveDeploymentsOptions contains the optional parameters for the AppsClient.BeginSetActiveDeployments +// method. +type AppsClientBeginSetActiveDeploymentsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AppsClientBeginUpdateOptions contains the optional parameters for the AppsClient.BeginUpdate method. +type AppsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AppsClientGetOptions contains the optional parameters for the AppsClient.Get method. +type AppsClientGetOptions struct { + // Indicates whether sync status + SyncStatus *string +} + +// AppsClientGetResourceUploadURLOptions contains the optional parameters for the AppsClient.GetResourceUploadURL method. +type AppsClientGetResourceUploadURLOptions struct { + // placeholder for future optional parameters +} + +// AppsClientListOptions contains the optional parameters for the AppsClient.NewListPager method. +type AppsClientListOptions struct { + // placeholder for future optional parameters +} + +// AppsClientValidateDomainOptions contains the optional parameters for the AppsClient.ValidateDomain method. +type AppsClientValidateDomainOptions struct { + // placeholder for future optional parameters +} + +// BindingsClientBeginCreateOrUpdateOptions contains the optional parameters for the BindingsClient.BeginCreateOrUpdate method. +type BindingsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BindingsClientBeginDeleteOptions contains the optional parameters for the BindingsClient.BeginDelete method. +type BindingsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BindingsClientBeginUpdateOptions contains the optional parameters for the BindingsClient.BeginUpdate method. +type BindingsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BindingsClientGetOptions contains the optional parameters for the BindingsClient.Get method. +type BindingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// BindingsClientListOptions contains the optional parameters for the BindingsClient.NewListPager method. +type BindingsClientListOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceAgentPoolClientBeginUpdatePutOptions contains the optional parameters for the BuildServiceAgentPoolClient.BeginUpdatePut +// method. +type BuildServiceAgentPoolClientBeginUpdatePutOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BuildServiceAgentPoolClientGetOptions contains the optional parameters for the BuildServiceAgentPoolClient.Get method. +type BuildServiceAgentPoolClientGetOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceAgentPoolClientListOptions contains the optional parameters for the BuildServiceAgentPoolClient.NewListPager +// method. +type BuildServiceAgentPoolClientListOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceBuilderClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildServiceBuilderClient.BeginCreateOrUpdate +// method. +type BuildServiceBuilderClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BuildServiceBuilderClientBeginDeleteOptions contains the optional parameters for the BuildServiceBuilderClient.BeginDelete +// method. +type BuildServiceBuilderClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BuildServiceBuilderClientGetOptions contains the optional parameters for the BuildServiceBuilderClient.Get method. +type BuildServiceBuilderClientGetOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceBuilderClientListDeploymentsOptions contains the optional parameters for the BuildServiceBuilderClient.ListDeployments +// method. +type BuildServiceBuilderClientListDeploymentsOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceBuilderClientListOptions contains the optional parameters for the BuildServiceBuilderClient.NewListPager method. +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 { + // placeholder for future optional parameters +} + +// BuildServiceClientGetBuildOptions contains the optional parameters for the BuildServiceClient.GetBuild method. +type BuildServiceClientGetBuildOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceClientGetBuildResultLogOptions contains the optional parameters for the BuildServiceClient.GetBuildResultLog +// method. +type BuildServiceClientGetBuildResultLogOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceClientGetBuildResultOptions contains the optional parameters for the BuildServiceClient.GetBuildResult method. +type BuildServiceClientGetBuildResultOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceClientGetBuildServiceOptions contains the optional parameters for the BuildServiceClient.GetBuildService method. +type BuildServiceClientGetBuildServiceOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceClientGetResourceUploadURLOptions contains the optional parameters for the BuildServiceClient.GetResourceUploadURL +// method. +type BuildServiceClientGetResourceUploadURLOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceClientGetSupportedBuildpackOptions contains the optional parameters for the BuildServiceClient.GetSupportedBuildpack +// method. +type BuildServiceClientGetSupportedBuildpackOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceClientGetSupportedStackOptions contains the optional parameters for the BuildServiceClient.GetSupportedStack +// method. +type BuildServiceClientGetSupportedStackOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceClientListBuildResultsOptions contains the optional parameters for the BuildServiceClient.NewListBuildResultsPager +// method. +type BuildServiceClientListBuildResultsOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceClientListBuildServicesOptions contains the optional parameters for the BuildServiceClient.NewListBuildServicesPager +// method. +type BuildServiceClientListBuildServicesOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceClientListBuildsOptions contains the optional parameters for the BuildServiceClient.NewListBuildsPager method. +type BuildServiceClientListBuildsOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceClientListSupportedBuildpacksOptions contains the optional parameters for the BuildServiceClient.ListSupportedBuildpacks +// method. +type BuildServiceClientListSupportedBuildpacksOptions struct { + // placeholder for future optional parameters +} + +// BuildServiceClientListSupportedStacksOptions contains the optional parameters for the BuildServiceClient.ListSupportedStacks +// method. +type BuildServiceClientListSupportedStacksOptions struct { + // placeholder for future optional parameters +} + +// BuildpackBindingClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildpackBindingClient.BeginCreateOrUpdate +// method. +type BuildpackBindingClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BuildpackBindingClientBeginDeleteOptions contains the optional parameters for the BuildpackBindingClient.BeginDelete method. +type BuildpackBindingClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BuildpackBindingClientGetOptions contains the optional parameters for the BuildpackBindingClient.Get method. +type BuildpackBindingClientGetOptions struct { + // placeholder for future optional parameters +} + +// BuildpackBindingClientListForClusterOptions contains the optional parameters for the BuildpackBindingClient.NewListForClusterPager +// method. +type BuildpackBindingClientListForClusterOptions struct { + // placeholder for future optional parameters +} + +// BuildpackBindingClientListOptions contains the optional parameters for the BuildpackBindingClient.NewListPager method. +type BuildpackBindingClientListOptions struct { + // placeholder for future optional parameters +} + +// CertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the CertificatesClient.BeginCreateOrUpdate +// method. +type CertificatesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CertificatesClientBeginDeleteOptions contains the optional parameters for the CertificatesClient.BeginDelete method. +type CertificatesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CertificatesClientGetOptions contains the optional parameters for the CertificatesClient.Get method. +type CertificatesClientGetOptions struct { + // placeholder for future optional parameters +} + +// CertificatesClientListOptions contains the optional parameters for the CertificatesClient.NewListPager method. +type CertificatesClientListOptions struct { + // placeholder for future optional parameters +} + +// ConfigServersClientBeginUpdatePatchOptions contains the optional parameters for the ConfigServersClient.BeginUpdatePatch +// method. +type ConfigServersClientBeginUpdatePatchOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigServersClientBeginUpdatePutOptions contains the optional parameters for the ConfigServersClient.BeginUpdatePut method. +type ConfigServersClientBeginUpdatePutOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigServersClientBeginValidateOptions contains the optional parameters for the ConfigServersClient.BeginValidate method. +type ConfigServersClientBeginValidateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigServersClientGetOptions contains the optional parameters for the ConfigServersClient.Get method. +type ConfigServersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationServicesClient.BeginCreateOrUpdate +// method. +type ConfigurationServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigurationServicesClientBeginDeleteOptions contains the optional parameters for the ConfigurationServicesClient.BeginDelete +// method. +type ConfigurationServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigurationServicesClientBeginValidateOptions contains the optional parameters for the ConfigurationServicesClient.BeginValidate +// method. +type ConfigurationServicesClientBeginValidateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigurationServicesClientBeginValidateResourceOptions contains the optional parameters for the ConfigurationServicesClient.BeginValidateResource +// method. +type ConfigurationServicesClientBeginValidateResourceOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ConfigurationServicesClientGetOptions contains the optional parameters for the ConfigurationServicesClient.Get method. +type ConfigurationServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationServicesClientListOptions contains the optional parameters for the ConfigurationServicesClient.NewListPager +// method. +type ConfigurationServicesClientListOptions struct { + // placeholder for future optional parameters +} + +// 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 +} + +// CustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomDomainsClient.BeginCreateOrUpdate +// method. +type CustomDomainsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CustomDomainsClientBeginDeleteOptions contains the optional parameters for the CustomDomainsClient.BeginDelete method. +type CustomDomainsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CustomDomainsClientBeginUpdateOptions contains the optional parameters for the CustomDomainsClient.BeginUpdate method. +type CustomDomainsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CustomDomainsClientGetOptions contains the optional parameters for the CustomDomainsClient.Get method. +type CustomDomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// CustomDomainsClientListOptions contains the optional parameters for the CustomDomainsClient.NewListPager method. +type CustomDomainsClientListOptions struct { + // placeholder for future optional parameters +} + +// CustomizedAcceleratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomizedAcceleratorsClient.BeginCreateOrUpdate +// method. +type CustomizedAcceleratorsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CustomizedAcceleratorsClientBeginDeleteOptions contains the optional parameters for the CustomizedAcceleratorsClient.BeginDelete +// method. +type CustomizedAcceleratorsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CustomizedAcceleratorsClientGetOptions contains the optional parameters for the CustomizedAcceleratorsClient.Get method. +type CustomizedAcceleratorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// CustomizedAcceleratorsClientListOptions contains the optional parameters for the CustomizedAcceleratorsClient.NewListPager +// method. +type CustomizedAcceleratorsClientListOptions struct { + // placeholder for future optional parameters +} + +// CustomizedAcceleratorsClientValidateOptions contains the optional parameters for the CustomizedAcceleratorsClient.Validate +// method. +type CustomizedAcceleratorsClientValidateOptions struct { + // placeholder for future optional parameters +} + +// DeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdate +// method. +type DeploymentsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientBeginDeleteOptions contains the optional parameters for the DeploymentsClient.BeginDelete method. +type DeploymentsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientBeginDisableRemoteDebuggingOptions contains the optional parameters for the DeploymentsClient.BeginDisableRemoteDebugging +// method. +type DeploymentsClientBeginDisableRemoteDebuggingOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientBeginEnableRemoteDebuggingOptions contains the optional parameters for the DeploymentsClient.BeginEnableRemoteDebugging +// method. +type DeploymentsClientBeginEnableRemoteDebuggingOptions struct { + // Parameters for enable remote debugging + RemoteDebuggingPayload *RemoteDebuggingPayload + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientBeginGenerateHeapDumpOptions contains the optional parameters for the DeploymentsClient.BeginGenerateHeapDump +// method. +type DeploymentsClientBeginGenerateHeapDumpOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientBeginGenerateThreadDumpOptions contains the optional parameters for the DeploymentsClient.BeginGenerateThreadDump +// method. +type DeploymentsClientBeginGenerateThreadDumpOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientBeginRestartOptions contains the optional parameters for the DeploymentsClient.BeginRestart method. +type DeploymentsClientBeginRestartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientBeginStartJFROptions contains the optional parameters for the DeploymentsClient.BeginStartJFR method. +type DeploymentsClientBeginStartJFROptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientBeginStartOptions contains the optional parameters for the DeploymentsClient.BeginStart method. +type DeploymentsClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientBeginStopOptions contains the optional parameters for the DeploymentsClient.BeginStop method. +type DeploymentsClientBeginStopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientBeginUpdateOptions contains the optional parameters for the DeploymentsClient.BeginUpdate method. +type DeploymentsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientGetLogFileURLOptions contains the optional parameters for the DeploymentsClient.GetLogFileURL method. +type DeploymentsClientGetLogFileURLOptions struct { + // placeholder for future optional parameters +} + +// DeploymentsClientGetOptions contains the optional parameters for the DeploymentsClient.Get method. +type DeploymentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DeploymentsClientGetRemoteDebuggingConfigOptions contains the optional parameters for the DeploymentsClient.GetRemoteDebuggingConfig +// method. +type DeploymentsClientGetRemoteDebuggingConfigOptions struct { + // placeholder for future optional parameters +} + +// DeploymentsClientListForClusterOptions contains the optional parameters for the DeploymentsClient.NewListForClusterPager +// method. +type DeploymentsClientListForClusterOptions struct { + // Version of the deployments to be listed + Version []string +} + +// DeploymentsClientListOptions contains the optional parameters for the DeploymentsClient.NewListPager method. +type DeploymentsClientListOptions struct { + // Version of the deployments to be listed + Version []string +} + +// DevToolPortalsClientBeginCreateOrUpdateOptions contains the optional parameters for the DevToolPortalsClient.BeginCreateOrUpdate +// method. +type DevToolPortalsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DevToolPortalsClientBeginDeleteOptions contains the optional parameters for the DevToolPortalsClient.BeginDelete method. +type DevToolPortalsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DevToolPortalsClientGetOptions contains the optional parameters for the DevToolPortalsClient.Get method. +type DevToolPortalsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DevToolPortalsClientListOptions contains the optional parameters for the DevToolPortalsClient.NewListPager method. +type DevToolPortalsClientListOptions struct { + // placeholder for future optional parameters +} + +// 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 +} + +// GatewayCustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewayCustomDomainsClient.BeginCreateOrUpdate +// method. +type GatewayCustomDomainsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewayCustomDomainsClientBeginDeleteOptions contains the optional parameters for the GatewayCustomDomainsClient.BeginDelete +// method. +type GatewayCustomDomainsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewayCustomDomainsClientGetOptions contains the optional parameters for the GatewayCustomDomainsClient.Get method. +type GatewayCustomDomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// GatewayCustomDomainsClientListOptions contains the optional parameters for the GatewayCustomDomainsClient.NewListPager +// method. +type GatewayCustomDomainsClientListOptions struct { + // placeholder for future optional parameters +} + +// GatewayRouteConfigsClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewayRouteConfigsClient.BeginCreateOrUpdate +// method. +type GatewayRouteConfigsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewayRouteConfigsClientBeginDeleteOptions contains the optional parameters for the GatewayRouteConfigsClient.BeginDelete +// method. +type GatewayRouteConfigsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewayRouteConfigsClientGetOptions contains the optional parameters for the GatewayRouteConfigsClient.Get method. +type GatewayRouteConfigsClientGetOptions struct { + // placeholder for future optional parameters +} + +// GatewayRouteConfigsClientListOptions contains the optional parameters for the GatewayRouteConfigsClient.NewListPager method. +type GatewayRouteConfigsClientListOptions struct { + // placeholder for future optional parameters +} + +// GatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewaysClient.BeginCreateOrUpdate method. +type GatewaysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewaysClientBeginDeleteOptions contains the optional parameters for the GatewaysClient.BeginDelete method. +type GatewaysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + 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. + ResumeToken string +} + +// GatewaysClientGetOptions contains the optional parameters for the GatewaysClient.Get method. +type GatewaysClientGetOptions struct { + // placeholder for future optional parameters +} + +// GatewaysClientListEnvSecretsOptions contains the optional parameters for the GatewaysClient.ListEnvSecrets method. +type GatewaysClientListEnvSecretsOptions struct { + // placeholder for future optional parameters +} + +// GatewaysClientListOptions contains the optional parameters for the GatewaysClient.NewListPager method. +type GatewaysClientListOptions struct { + // placeholder for future optional parameters +} + +// GatewaysClientValidateDomainOptions contains the optional parameters for the GatewaysClient.ValidateDomain method. +type GatewaysClientValidateDomainOptions struct { + // placeholder for future optional parameters +} + +// MonitoringSettingsClientBeginUpdatePatchOptions contains the optional parameters for the MonitoringSettingsClient.BeginUpdatePatch +// method. +type MonitoringSettingsClientBeginUpdatePatchOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MonitoringSettingsClientBeginUpdatePutOptions contains the optional parameters for the MonitoringSettingsClient.BeginUpdatePut +// method. +type MonitoringSettingsClientBeginUpdatePutOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MonitoringSettingsClientGetOptions contains the optional parameters for the MonitoringSettingsClient.Get method. +type MonitoringSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PredefinedAcceleratorsClientBeginDisableOptions contains the optional parameters for the PredefinedAcceleratorsClient.BeginDisable +// method. +type PredefinedAcceleratorsClientBeginDisableOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PredefinedAcceleratorsClientBeginEnableOptions contains the optional parameters for the PredefinedAcceleratorsClient.BeginEnable +// method. +type PredefinedAcceleratorsClientBeginEnableOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PredefinedAcceleratorsClientGetOptions contains the optional parameters for the PredefinedAcceleratorsClient.Get method. +type PredefinedAcceleratorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PredefinedAcceleratorsClientListOptions contains the optional parameters for the PredefinedAcceleratorsClient.NewListPager +// method. +type PredefinedAcceleratorsClientListOptions struct { + // placeholder for future optional parameters +} + +// RuntimeVersionsClientListRuntimeVersionsOptions contains the optional parameters for the RuntimeVersionsClient.ListRuntimeVersions +// method. +type RuntimeVersionsClientListRuntimeVersionsOptions struct { + // placeholder for future optional parameters +} + +// SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method. +type SKUsClientListOptions struct { + // placeholder for future optional parameters +} + +// ServiceRegistriesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceRegistriesClient.BeginCreateOrUpdate +// method. +type ServiceRegistriesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceRegistriesClientBeginDeleteOptions contains the optional parameters for the ServiceRegistriesClient.BeginDelete +// method. +type ServiceRegistriesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceRegistriesClientGetOptions contains the optional parameters for the ServiceRegistriesClient.Get method. +type ServiceRegistriesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServiceRegistriesClientListOptions contains the optional parameters for the ServiceRegistriesClient.NewListPager method. +type ServiceRegistriesClientListOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. +type ServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. +type ServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + 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 +} + +// ServicesClientBeginFlushVnetDNSSettingOptions contains the optional parameters for the ServicesClient.BeginFlushVnetDNSSetting +// method. +type ServicesClientBeginFlushVnetDNSSettingOptions 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. + ResumeToken string +} + +// ServicesClientBeginStopOptions contains the optional parameters for the ServicesClient.BeginStop method. +type ServicesClientBeginStopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. +type ServicesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability +// method. +type ServicesClientCheckNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientDisableTestEndpointOptions contains the optional parameters for the ServicesClient.DisableTestEndpoint method. +type ServicesClientDisableTestEndpointOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientEnableTestEndpointOptions contains the optional parameters for the ServicesClient.EnableTestEndpoint method. +type ServicesClientEnableTestEndpointOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. +type ServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager +// method. +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 +} + +// ServicesClientRegenerateTestKeyOptions contains the optional parameters for the ServicesClient.RegenerateTestKey method. +type ServicesClientRegenerateTestKeyOptions struct { + // placeholder for future optional parameters +} + +// StoragesClientBeginCreateOrUpdateOptions contains the optional parameters for the StoragesClient.BeginCreateOrUpdate method. +type StoragesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// StoragesClientBeginDeleteOptions contains the optional parameters for the StoragesClient.BeginDelete method. +type StoragesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// StoragesClientGetOptions contains the optional parameters for the StoragesClient.Get method. +type StoragesClientGetOptions struct { + // placeholder for future optional parameters +} + +// StoragesClientListOptions contains the optional parameters for the StoragesClient.NewListPager method. +type StoragesClientListOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go b/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go index b56f75c8c26a..104a325faf75 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go +++ b/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -30,7 +29,10 @@ func unmarshalAcceleratorAuthSettingClassification(rawMsg json.RawMessage) (Acce default: b = &AcceleratorAuthSetting{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalCertificatePropertiesClassification(rawMsg json.RawMessage) (CertificatePropertiesClassification, error) { @@ -50,7 +52,31 @@ func unmarshalCertificatePropertiesClassification(rawMsg json.RawMessage) (Certi default: b = &CertificateProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +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{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalCustomPersistentDiskPropertiesClassification(rawMsg json.RawMessage) (CustomPersistentDiskPropertiesClassification, error) { @@ -68,7 +94,31 @@ func unmarshalCustomPersistentDiskPropertiesClassification(rawMsg json.RawMessag default: b = &CustomPersistentDiskProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalMaintenanceScheduleConfigurationClassification(rawMsg json.RawMessage) (MaintenanceScheduleConfigurationClassification, 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 MaintenanceScheduleConfigurationClassification + switch m["frequency"] { + case string(FrequencyWeekly): + b = &WeeklyMaintenanceScheduleConfiguration{} + default: + b = &MaintenanceScheduleConfiguration{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalProbeActionClassification(rawMsg json.RawMessage) (ProbeActionClassification, error) { @@ -90,7 +140,10 @@ func unmarshalProbeActionClassification(rawMsg json.RawMessage) (ProbeActionClas default: b = &ProbeAction{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalStoragePropertiesClassification(rawMsg json.RawMessage) (StoragePropertiesClassification, error) { @@ -108,7 +161,10 @@ func unmarshalStoragePropertiesClassification(rawMsg json.RawMessage) (StoragePr default: b = &StorageProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalUserSourceInfoClassification(rawMsg json.RawMessage) (UserSourceInfoClassification, error) { @@ -133,8 +189,13 @@ func unmarshalUserSourceInfoClassification(rawMsg json.RawMessage) (UserSourceIn b = &SourceUploadedUserSourceInfo{} case "UploadedUserSourceInfo": b = &UploadedUserSourceInfo{} + case "War": + b = &WarUploadedUserSourceInfo{} default: b = &UserSourceInfo{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } diff --git a/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go b/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go index f14268b54554..e7de3d3c2998 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -62,7 +61,8 @@ func (client *PredefinedAcceleratorsClient) BeginDisable(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller[PredefinedAcceleratorsClientDisableResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PredefinedAcceleratorsClientDisableResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PredefinedAcceleratorsClientDisableResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ 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-09-01-preview func (client *PredefinedAcceleratorsClient) disable(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientBeginDisableOptions) (*http.Response, error) { + var err error req, err := client.disableCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // disableCreateRequest creates the Disable request. @@ -115,7 +117,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,7 +126,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-09-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. @@ -138,7 +140,8 @@ func (client *PredefinedAcceleratorsClient) BeginEnable(ctx context.Context, res if err != nil { return nil, err } - return runtime.NewPoller[PredefinedAcceleratorsClientEnableResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PredefinedAcceleratorsClientEnableResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PredefinedAcceleratorsClientEnableResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -147,20 +150,22 @@ 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-09-01-preview func (client *PredefinedAcceleratorsClient) enable(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientBeginEnableOptions) (*http.Response, error) { + var err error req, err := client.enableCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // enableCreateRequest creates the Enable request. @@ -191,7 +196,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +205,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-09-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. @@ -209,18 +214,21 @@ func (client *PredefinedAcceleratorsClient) enableCreateRequest(ctx context.Cont // - options - PredefinedAcceleratorsClientGetOptions contains the optional parameters for the PredefinedAcceleratorsClient.Get // method. func (client *PredefinedAcceleratorsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientGetOptions) (PredefinedAcceleratorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, options) if err != nil { return PredefinedAcceleratorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PredefinedAcceleratorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PredefinedAcceleratorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PredefinedAcceleratorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -251,7 +259,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +276,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-09-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 +335,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-09-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..b67febbaab11 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/response_types.go +++ b/sdk/resourcemanager/appplatform/armappplatform/response_types.go @@ -3,14 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform // APIPortalCustomDomainsClientCreateOrUpdateResponse contains the response from method APIPortalCustomDomainsClient.BeginCreateOrUpdate. type APIPortalCustomDomainsClientCreateOrUpdateResponse struct { + // Custom domain of the API portal APIPortalCustomDomainResource } @@ -21,16 +21,19 @@ type APIPortalCustomDomainsClientDeleteResponse struct { // APIPortalCustomDomainsClientGetResponse contains the response from method APIPortalCustomDomainsClient.Get. type APIPortalCustomDomainsClientGetResponse struct { + // Custom domain of the API portal APIPortalCustomDomainResource } // APIPortalCustomDomainsClientListResponse contains the response from method APIPortalCustomDomainsClient.NewListPager. type APIPortalCustomDomainsClientListResponse struct { + // Object that includes an array of API portal custom domain resources and a possible link for next set APIPortalCustomDomainResourceCollection } // APIPortalsClientCreateOrUpdateResponse contains the response from method APIPortalsClient.BeginCreateOrUpdate. type APIPortalsClientCreateOrUpdateResponse struct { + // API portal resource APIPortalResource } @@ -41,21 +44,54 @@ type APIPortalsClientDeleteResponse struct { // APIPortalsClientGetResponse contains the response from method APIPortalsClient.Get. type APIPortalsClientGetResponse struct { + // API portal resource APIPortalResource } // APIPortalsClientListResponse contains the response from method APIPortalsClient.NewListPager. type APIPortalsClientListResponse struct { + // Object that includes an array of API portal resources and a possible link for next set APIPortalResourceCollection } // APIPortalsClientValidateDomainResponse contains the response from method APIPortalsClient.ValidateDomain. type APIPortalsClientValidateDomainResponse struct { + // Validation result for custom domain. CustomDomainValidateResult } +// ApmsClientCreateOrUpdateResponse contains the response from method ApmsClient.BeginCreateOrUpdate. +type ApmsClientCreateOrUpdateResponse struct { + // APM Resource object + 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 { + // APM Resource object + ApmResource +} + +// ApmsClientListResponse contains the response from method ApmsClient.NewListPager. +type ApmsClientListResponse struct { + // Object that includes an array of APM resources and a possible link for next set + ApmResourceCollection +} + +// ApmsClientListSecretKeysResponse contains the response from method ApmsClient.ListSecretKeys. +type ApmsClientListSecretKeysResponse struct { + // Keys of APM sensitive properties + ApmSecretKeys +} + // ApplicationAcceleratorsClientCreateOrUpdateResponse contains the response from method ApplicationAcceleratorsClient.BeginCreateOrUpdate. type ApplicationAcceleratorsClientCreateOrUpdateResponse struct { + // Application accelerator resource ApplicationAcceleratorResource } @@ -66,16 +102,19 @@ type ApplicationAcceleratorsClientDeleteResponse struct { // ApplicationAcceleratorsClientGetResponse contains the response from method ApplicationAcceleratorsClient.Get. type ApplicationAcceleratorsClientGetResponse struct { + // Application accelerator resource ApplicationAcceleratorResource } // ApplicationAcceleratorsClientListResponse contains the response from method ApplicationAcceleratorsClient.NewListPager. type ApplicationAcceleratorsClientListResponse struct { + // Object that includes an array of application accelerator resources and a possible link for next set ApplicationAcceleratorResourceCollection } // ApplicationLiveViewsClientCreateOrUpdateResponse contains the response from method ApplicationLiveViewsClient.BeginCreateOrUpdate. type ApplicationLiveViewsClientCreateOrUpdateResponse struct { + // Application Live View resource ApplicationLiveViewResource } @@ -86,16 +125,19 @@ type ApplicationLiveViewsClientDeleteResponse struct { // ApplicationLiveViewsClientGetResponse contains the response from method ApplicationLiveViewsClient.Get. type ApplicationLiveViewsClientGetResponse struct { + // Application Live View resource ApplicationLiveViewResource } // ApplicationLiveViewsClientListResponse contains the response from method ApplicationLiveViewsClient.NewListPager. type ApplicationLiveViewsClientListResponse struct { + // Object that includes an array of Application Live View resources and a possible link for next set ApplicationLiveViewResourceCollection } // AppsClientCreateOrUpdateResponse contains the response from method AppsClient.BeginCreateOrUpdate. type AppsClientCreateOrUpdateResponse struct { + // App resource payload AppResource } @@ -106,36 +148,43 @@ type AppsClientDeleteResponse struct { // AppsClientGetResourceUploadURLResponse contains the response from method AppsClient.GetResourceUploadURL. type AppsClientGetResourceUploadURLResponse struct { + // Resource upload definition payload ResourceUploadDefinition } // AppsClientGetResponse contains the response from method AppsClient.Get. type AppsClientGetResponse struct { + // App resource payload AppResource } // AppsClientListResponse contains the response from method AppsClient.NewListPager. type AppsClientListResponse struct { + // Object that includes an array of App resources and a possible link for next set AppResourceCollection } // AppsClientSetActiveDeploymentsResponse contains the response from method AppsClient.BeginSetActiveDeployments. type AppsClientSetActiveDeploymentsResponse struct { + // App resource payload AppResource } // AppsClientUpdateResponse contains the response from method AppsClient.BeginUpdate. type AppsClientUpdateResponse struct { + // App resource payload AppResource } // AppsClientValidateDomainResponse contains the response from method AppsClient.ValidateDomain. type AppsClientValidateDomainResponse struct { + // Validation result for custom domain. CustomDomainValidateResult } // BindingsClientCreateOrUpdateResponse contains the response from method BindingsClient.BeginCreateOrUpdate. type BindingsClientCreateOrUpdateResponse struct { + // Binding resource payload BindingResource } @@ -146,36 +195,43 @@ type BindingsClientDeleteResponse struct { // BindingsClientGetResponse contains the response from method BindingsClient.Get. type BindingsClientGetResponse struct { + // Binding resource payload BindingResource } // BindingsClientListResponse contains the response from method BindingsClient.NewListPager. type BindingsClientListResponse struct { + // Object that includes an array of Binding resources and a possible link for next set BindingResourceCollection } // BindingsClientUpdateResponse contains the response from method BindingsClient.BeginUpdate. type BindingsClientUpdateResponse struct { + // Binding resource payload BindingResource } // BuildServiceAgentPoolClientGetResponse contains the response from method BuildServiceAgentPoolClient.Get. type BuildServiceAgentPoolClientGetResponse struct { + // The build service agent pool resource BuildServiceAgentPoolResource } // BuildServiceAgentPoolClientListResponse contains the response from method BuildServiceAgentPoolClient.NewListPager. type BuildServiceAgentPoolClientListResponse struct { + // Object that includes an array of build service agent pool resources and a possible link for next set BuildServiceAgentPoolResourceCollection } // BuildServiceAgentPoolClientUpdatePutResponse contains the response from method BuildServiceAgentPoolClient.BeginUpdatePut. type BuildServiceAgentPoolClientUpdatePutResponse struct { + // The build service agent pool resource BuildServiceAgentPoolResource } // BuildServiceBuilderClientCreateOrUpdateResponse contains the response from method BuildServiceBuilderClient.BeginCreateOrUpdate. type BuildServiceBuilderClientCreateOrUpdateResponse struct { + // KPack Builder resource BuilderResource } @@ -186,86 +242,114 @@ type BuildServiceBuilderClientDeleteResponse struct { // BuildServiceBuilderClientGetResponse contains the response from method BuildServiceBuilderClient.Get. type BuildServiceBuilderClientGetResponse struct { + // KPack Builder resource BuilderResource } // BuildServiceBuilderClientListDeploymentsResponse contains the response from method BuildServiceBuilderClient.ListDeployments. type BuildServiceBuilderClientListDeploymentsResponse struct { + // A list of deployments resource ids. DeploymentList } // BuildServiceBuilderClientListResponse contains the response from method BuildServiceBuilderClient.NewListPager. type BuildServiceBuilderClientListResponse struct { + // Object that includes an array of Builder resources and a possible link for next set BuilderResourceCollection } // BuildServiceClientCreateOrUpdateBuildResponse contains the response from method BuildServiceClient.CreateOrUpdateBuild. type BuildServiceClientCreateOrUpdateBuildResponse struct { + // Build resource payload Build } +// BuildServiceClientCreateOrUpdateResponse contains the response from method BuildServiceClient.BeginCreateOrUpdate. +type BuildServiceClientCreateOrUpdateResponse struct { + // Build service resource payload + 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 resource payload Build } // BuildServiceClientGetBuildResultLogResponse contains the response from method BuildServiceClient.GetBuildResultLog. type BuildServiceClientGetBuildResultLogResponse struct { + // Build result log resource properties payload BuildResultLog } // BuildServiceClientGetBuildResultResponse contains the response from method BuildServiceClient.GetBuildResult. type BuildServiceClientGetBuildResultResponse struct { + // Build result resource payload BuildResult } // BuildServiceClientGetBuildServiceResponse contains the response from method BuildServiceClient.GetBuildService. type BuildServiceClientGetBuildServiceResponse struct { + // Build service resource payload BuildService } // BuildServiceClientGetResourceUploadURLResponse contains the response from method BuildServiceClient.GetResourceUploadURL. type BuildServiceClientGetResourceUploadURLResponse struct { + // Resource upload definition payload ResourceUploadDefinition } // BuildServiceClientGetSupportedBuildpackResponse contains the response from method BuildServiceClient.GetSupportedBuildpack. type BuildServiceClientGetSupportedBuildpackResponse struct { + // Supported buildpack resource payload SupportedBuildpackResource } // BuildServiceClientGetSupportedStackResponse contains the response from method BuildServiceClient.GetSupportedStack. type BuildServiceClientGetSupportedStackResponse struct { + // Supported stack resource payload SupportedStackResource } // BuildServiceClientListBuildResultsResponse contains the response from method BuildServiceClient.NewListBuildResultsPager. type BuildServiceClientListBuildResultsResponse struct { + // Object that includes an array of Build result resources and a possible link for next set BuildResultCollection } // BuildServiceClientListBuildServicesResponse contains the response from method BuildServiceClient.NewListBuildServicesPager. type BuildServiceClientListBuildServicesResponse struct { + // Object that includes an array of Build service resources and a possible link for next set BuildServiceCollection } // BuildServiceClientListBuildsResponse contains the response from method BuildServiceClient.NewListBuildsPager. type BuildServiceClientListBuildsResponse struct { + // Object that includes an array of Build resources and a possible link for next set BuildCollection } // BuildServiceClientListSupportedBuildpacksResponse contains the response from method BuildServiceClient.ListSupportedBuildpacks. type BuildServiceClientListSupportedBuildpacksResponse struct { + // Object that includes an array of supported buildpacks resources and a possible link for next set SupportedBuildpacksCollection } // BuildServiceClientListSupportedStacksResponse contains the response from method BuildServiceClient.ListSupportedStacks. type BuildServiceClientListSupportedStacksResponse struct { + // Object that includes an array of supported stacks resources and a possible link for next set SupportedStacksCollection } // BuildpackBindingClientCreateOrUpdateResponse contains the response from method BuildpackBindingClient.BeginCreateOrUpdate. type BuildpackBindingClientCreateOrUpdateResponse struct { + // Buildpack Binding Resource object BuildpackBindingResource } @@ -276,21 +360,25 @@ type BuildpackBindingClientDeleteResponse struct { // BuildpackBindingClientGetResponse contains the response from method BuildpackBindingClient.Get. type BuildpackBindingClientGetResponse struct { + // Buildpack Binding Resource object BuildpackBindingResource } // BuildpackBindingClientListForClusterResponse contains the response from method BuildpackBindingClient.NewListForClusterPager. type BuildpackBindingClientListForClusterResponse struct { + // Object that includes an array of BuildpackBinding resources and a possible link for next set BuildpackBindingResourceCollection } // BuildpackBindingClientListResponse contains the response from method BuildpackBindingClient.NewListPager. type BuildpackBindingClientListResponse struct { + // Object that includes an array of BuildpackBinding resources and a possible link for next set BuildpackBindingResourceCollection } // CertificatesClientCreateOrUpdateResponse contains the response from method CertificatesClient.BeginCreateOrUpdate. type CertificatesClientCreateOrUpdateResponse struct { + // Certificate resource payload. CertificateResource } @@ -301,36 +389,43 @@ type CertificatesClientDeleteResponse struct { // CertificatesClientGetResponse contains the response from method CertificatesClient.Get. type CertificatesClientGetResponse struct { + // Certificate resource payload. CertificateResource } // CertificatesClientListResponse contains the response from method CertificatesClient.NewListPager. type CertificatesClientListResponse struct { + // Collection compose of certificate resources list and a possible link for next page. CertificateResourceCollection } // ConfigServersClientGetResponse contains the response from method ConfigServersClient.Get. type ConfigServersClientGetResponse struct { + // Config Server resource ConfigServerResource } // ConfigServersClientUpdatePatchResponse contains the response from method ConfigServersClient.BeginUpdatePatch. type ConfigServersClientUpdatePatchResponse struct { + // Config Server resource ConfigServerResource } // ConfigServersClientUpdatePutResponse contains the response from method ConfigServersClient.BeginUpdatePut. type ConfigServersClientUpdatePutResponse struct { + // Config Server resource ConfigServerResource } // ConfigServersClientValidateResponse contains the response from method ConfigServersClient.BeginValidate. type ConfigServersClientValidateResponse struct { + // Validation result for config server settings ConfigServerSettingsValidateResult } // ConfigurationServicesClientCreateOrUpdateResponse contains the response from method ConfigurationServicesClient.BeginCreateOrUpdate. type ConfigurationServicesClientCreateOrUpdateResponse struct { + // Application Configuration Service resource ConfigurationServiceResource } @@ -341,21 +436,60 @@ type ConfigurationServicesClientDeleteResponse struct { // ConfigurationServicesClientGetResponse contains the response from method ConfigurationServicesClient.Get. type ConfigurationServicesClientGetResponse struct { + // Application Configuration Service resource ConfigurationServiceResource } // ConfigurationServicesClientListResponse contains the response from method ConfigurationServicesClient.NewListPager. type ConfigurationServicesClientListResponse struct { + // Object that includes an array of configuration service resources and a possible link for next set ConfigurationServiceResourceCollection } +// ConfigurationServicesClientValidateResourceResponse contains the response from method ConfigurationServicesClient.BeginValidateResource. +type ConfigurationServicesClientValidateResourceResponse struct { + // Validation result for configuration service settings + ConfigurationServiceSettingsValidateResult +} + // ConfigurationServicesClientValidateResponse contains the response from method ConfigurationServicesClient.BeginValidate. type ConfigurationServicesClientValidateResponse struct { + // Validation result for configuration service settings ConfigurationServiceSettingsValidateResult } +// ContainerRegistriesClientCreateOrUpdateResponse contains the response from method ContainerRegistriesClient.BeginCreateOrUpdate. +type ContainerRegistriesClientCreateOrUpdateResponse struct { + // Container registry resource payload. + 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 { + // Container registry resource payload. + ContainerRegistryResource +} + +// ContainerRegistriesClientListResponse contains the response from method ContainerRegistriesClient.NewListPager. +type ContainerRegistriesClientListResponse struct { + // Collection compose of container registry resources list and a possible link for next page. + ContainerRegistryResourceCollection +} + +// ContainerRegistriesClientValidateResponse contains the response from method ContainerRegistriesClient.BeginValidate. +type ContainerRegistriesClientValidateResponse struct { + // Validation result for container registry properties + ContainerRegistryValidateResult +} + // CustomDomainsClientCreateOrUpdateResponse contains the response from method CustomDomainsClient.BeginCreateOrUpdate. type CustomDomainsClientCreateOrUpdateResponse struct { + // Custom domain resource payload. CustomDomainResource } @@ -366,21 +500,25 @@ type CustomDomainsClientDeleteResponse struct { // CustomDomainsClientGetResponse contains the response from method CustomDomainsClient.Get. type CustomDomainsClientGetResponse struct { + // Custom domain resource payload. CustomDomainResource } // CustomDomainsClientListResponse contains the response from method CustomDomainsClient.NewListPager. type CustomDomainsClientListResponse struct { + // Collection compose of a custom domain resources list and a possible link for next page. CustomDomainResourceCollection } // CustomDomainsClientUpdateResponse contains the response from method CustomDomainsClient.BeginUpdate. type CustomDomainsClientUpdateResponse struct { + // Custom domain resource payload. CustomDomainResource } // CustomizedAcceleratorsClientCreateOrUpdateResponse contains the response from method CustomizedAcceleratorsClient.BeginCreateOrUpdate. type CustomizedAcceleratorsClientCreateOrUpdateResponse struct { + // Customized accelerator resource CustomizedAcceleratorResource } @@ -391,6 +529,7 @@ type CustomizedAcceleratorsClientDeleteResponse struct { // CustomizedAcceleratorsClientGetResponse contains the response from method CustomizedAcceleratorsClient.Get. type CustomizedAcceleratorsClientGetResponse struct { + // Customized accelerator resource CustomizedAcceleratorResource } @@ -401,11 +540,13 @@ type CustomizedAcceleratorsClientListResponse struct { // CustomizedAcceleratorsClientValidateResponse contains the response from method CustomizedAcceleratorsClient.Validate. type CustomizedAcceleratorsClientValidateResponse struct { + // Validation result for customized accelerator properties CustomizedAcceleratorValidateResult } // DeploymentsClientCreateOrUpdateResponse contains the response from method DeploymentsClient.BeginCreateOrUpdate. type DeploymentsClientCreateOrUpdateResponse struct { + // Deployment resource payload DeploymentResource } @@ -416,11 +557,13 @@ type DeploymentsClientDeleteResponse struct { // DeploymentsClientDisableRemoteDebuggingResponse contains the response from method DeploymentsClient.BeginDisableRemoteDebugging. type DeploymentsClientDisableRemoteDebuggingResponse struct { + // Remote debugging config. RemoteDebugging } // DeploymentsClientEnableRemoteDebuggingResponse contains the response from method DeploymentsClient.BeginEnableRemoteDebugging. type DeploymentsClientEnableRemoteDebuggingResponse struct { + // Remote debugging config. RemoteDebugging } @@ -436,26 +579,31 @@ type DeploymentsClientGenerateThreadDumpResponse struct { // DeploymentsClientGetLogFileURLResponse contains the response from method DeploymentsClient.GetLogFileURL. type DeploymentsClientGetLogFileURLResponse struct { + // Log file URL payload LogFileURLResponse } // DeploymentsClientGetRemoteDebuggingConfigResponse contains the response from method DeploymentsClient.GetRemoteDebuggingConfig. type DeploymentsClientGetRemoteDebuggingConfigResponse struct { + // Remote debugging config. RemoteDebugging } // DeploymentsClientGetResponse contains the response from method DeploymentsClient.Get. type DeploymentsClientGetResponse struct { + // Deployment resource payload DeploymentResource } // DeploymentsClientListForClusterResponse contains the response from method DeploymentsClient.NewListForClusterPager. type DeploymentsClientListForClusterResponse struct { + // Object that includes an array of App resources and a possible link for next set DeploymentResourceCollection } // DeploymentsClientListResponse contains the response from method DeploymentsClient.NewListPager. type DeploymentsClientListResponse struct { + // Object that includes an array of App resources and a possible link for next set DeploymentResourceCollection } @@ -481,11 +629,13 @@ type DeploymentsClientStopResponse struct { // DeploymentsClientUpdateResponse contains the response from method DeploymentsClient.BeginUpdate. type DeploymentsClientUpdateResponse struct { + // Deployment resource payload DeploymentResource } // DevToolPortalsClientCreateOrUpdateResponse contains the response from method DevToolPortalsClient.BeginCreateOrUpdate. type DevToolPortalsClientCreateOrUpdateResponse struct { + // Dev Tool Portal resource DevToolPortalResource } @@ -496,16 +646,43 @@ type DevToolPortalsClientDeleteResponse struct { // DevToolPortalsClientGetResponse contains the response from method DevToolPortalsClient.Get. type DevToolPortalsClientGetResponse struct { + // Dev Tool Portal resource DevToolPortalResource } // DevToolPortalsClientListResponse contains the response from method DevToolPortalsClient.NewListPager. type DevToolPortalsClientListResponse struct { + // Object that includes an array of Dev Tool Portal resources and a possible link for next set DevToolPortalResourceCollection } +// EurekaServersClientGetResponse contains the response from method EurekaServersClient.Get. +type EurekaServersClientGetResponse struct { + // Eureka server resource + EurekaServerResource +} + +// EurekaServersClientListResponse contains the response from method EurekaServersClient.List. +type EurekaServersClientListResponse struct { + // Object that includes an array of Eureka server resources and a possible link for next set + EurekaServerResourceCollection +} + +// EurekaServersClientUpdatePatchResponse contains the response from method EurekaServersClient.BeginUpdatePatch. +type EurekaServersClientUpdatePatchResponse struct { + // Eureka server resource + EurekaServerResource +} + +// EurekaServersClientUpdatePutResponse contains the response from method EurekaServersClient.BeginUpdatePut. +type EurekaServersClientUpdatePutResponse struct { + // Eureka server resource + EurekaServerResource +} + // GatewayCustomDomainsClientCreateOrUpdateResponse contains the response from method GatewayCustomDomainsClient.BeginCreateOrUpdate. type GatewayCustomDomainsClientCreateOrUpdateResponse struct { + // Custom domain of the Spring Cloud Gateway GatewayCustomDomainResource } @@ -516,16 +693,19 @@ type GatewayCustomDomainsClientDeleteResponse struct { // GatewayCustomDomainsClientGetResponse contains the response from method GatewayCustomDomainsClient.Get. type GatewayCustomDomainsClientGetResponse struct { + // Custom domain of the Spring Cloud Gateway GatewayCustomDomainResource } // GatewayCustomDomainsClientListResponse contains the response from method GatewayCustomDomainsClient.NewListPager. type GatewayCustomDomainsClientListResponse struct { + // Object that includes an array of Spring Cloud Gateway custom domain resources and a possible link for next set GatewayCustomDomainResourceCollection } // GatewayRouteConfigsClientCreateOrUpdateResponse contains the response from method GatewayRouteConfigsClient.BeginCreateOrUpdate. type GatewayRouteConfigsClientCreateOrUpdateResponse struct { + // Spring Cloud Gateway route config resource GatewayRouteConfigResource } @@ -536,16 +716,19 @@ type GatewayRouteConfigsClientDeleteResponse struct { // GatewayRouteConfigsClientGetResponse contains the response from method GatewayRouteConfigsClient.Get. type GatewayRouteConfigsClientGetResponse struct { + // Spring Cloud Gateway route config resource GatewayRouteConfigResource } // GatewayRouteConfigsClientListResponse contains the response from method GatewayRouteConfigsClient.NewListPager. type GatewayRouteConfigsClientListResponse struct { + // Object that includes an array of Spring Cloud Gateway route config resources and a possible link for next set GatewayRouteConfigResourceCollection } // GatewaysClientCreateOrUpdateResponse contains the response from method GatewaysClient.BeginCreateOrUpdate. type GatewaysClientCreateOrUpdateResponse struct { + // Spring Cloud Gateway resource GatewayResource } @@ -556,6 +739,7 @@ type GatewaysClientDeleteResponse struct { // GatewaysClientGetResponse contains the response from method GatewaysClient.Get. type GatewaysClientGetResponse struct { + // Spring Cloud Gateway resource GatewayResource } @@ -567,36 +751,48 @@ type GatewaysClientListEnvSecretsResponse struct { // GatewaysClientListResponse contains the response from method GatewaysClient.NewListPager. type GatewaysClientListResponse struct { + // Object that includes an array of gateway resources and a possible link for next set 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 { + // Spring Cloud Gateway resource GatewayResource } // GatewaysClientValidateDomainResponse contains the response from method GatewaysClient.ValidateDomain. type GatewaysClientValidateDomainResponse struct { + // Validation result for custom domain. CustomDomainValidateResult } // MonitoringSettingsClientGetResponse contains the response from method MonitoringSettingsClient.Get. type MonitoringSettingsClientGetResponse struct { + // Monitoring Setting resource MonitoringSettingResource } // MonitoringSettingsClientUpdatePatchResponse contains the response from method MonitoringSettingsClient.BeginUpdatePatch. type MonitoringSettingsClientUpdatePatchResponse struct { + // Monitoring Setting resource MonitoringSettingResource } // MonitoringSettingsClientUpdatePutResponse contains the response from method MonitoringSettingsClient.BeginUpdatePut. type MonitoringSettingsClientUpdatePutResponse struct { + // Monitoring Setting resource MonitoringSettingResource } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Available operations of the service AvailableOperations } @@ -612,6 +808,7 @@ type PredefinedAcceleratorsClientEnableResponse struct { // PredefinedAcceleratorsClientGetResponse contains the response from method PredefinedAcceleratorsClient.Get. type PredefinedAcceleratorsClientGetResponse struct { + // Predefined accelerator resource PredefinedAcceleratorResource } @@ -627,11 +824,13 @@ type RuntimeVersionsClientListRuntimeVersionsResponse struct { // SKUsClientListResponse contains the response from method SKUsClient.NewListPager. type SKUsClientListResponse struct { + // Object that includes an array of Azure Spring Apps SKU and a possible link for next set ResourceSKUCollection } // ServiceRegistriesClientCreateOrUpdateResponse contains the response from method ServiceRegistriesClient.BeginCreateOrUpdate. type ServiceRegistriesClientCreateOrUpdateResponse struct { + // Service Registry resource ServiceRegistryResource } @@ -642,21 +841,25 @@ type ServiceRegistriesClientDeleteResponse struct { // ServiceRegistriesClientGetResponse contains the response from method ServiceRegistriesClient.Get. type ServiceRegistriesClientGetResponse struct { + // Service Registry resource ServiceRegistryResource } // ServiceRegistriesClientListResponse contains the response from method ServiceRegistriesClient.NewListPager. type ServiceRegistriesClientListResponse struct { + // Object that includes an array of Service Registry resources and a possible link for next set ServiceRegistryResourceCollection } // ServicesClientCheckNameAvailabilityResponse contains the response from method ServicesClient.CheckNameAvailability. type ServicesClientCheckNameAvailabilityResponse struct { + // Name availability result payload NameAvailability } // ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.BeginCreateOrUpdate. type ServicesClientCreateOrUpdateResponse struct { + // Service resource ServiceResource } @@ -665,38 +868,71 @@ 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 { + // Test keys payload TestKeys } +// ServicesClientFlushVnetDNSSettingResponse contains the response from method ServicesClient.BeginFlushVnetDNSSetting. +type ServicesClientFlushVnetDNSSettingResponse struct { + // placeholder for future response values +} + // ServicesClientGetResponse contains the response from method ServicesClient.Get. type ServicesClientGetResponse struct { + // Service resource ServiceResource } // ServicesClientListBySubscriptionResponse contains the response from method ServicesClient.NewListBySubscriptionPager. type ServicesClientListBySubscriptionResponse struct { + // Object that includes an array of Service resources and a possible link for next set ServiceResourceList } +// ServicesClientListGloballyEnabledApmsResponse contains the response from method ServicesClient.ListGloballyEnabledApms. +type ServicesClientListGloballyEnabledApmsResponse struct { + // Globally enabled APMs payload + GloballyEnabledApms +} + // ServicesClientListResponse contains the response from method ServicesClient.NewListPager. type ServicesClientListResponse struct { + // Object that includes an array of Service resources and a possible link for next set ServiceResourceList } +// ServicesClientListSupportedApmTypesResponse contains the response from method ServicesClient.NewListSupportedApmTypesPager. +type ServicesClientListSupportedApmTypesResponse struct { + // Supported APM types payload + SupportedApmTypes +} + // ServicesClientListTestKeysResponse contains the response from method ServicesClient.ListTestKeys. type ServicesClientListTestKeysResponse struct { + // Test keys payload TestKeys } // ServicesClientRegenerateTestKeyResponse contains the response from method ServicesClient.RegenerateTestKey. type ServicesClientRegenerateTestKeyResponse struct { + // Test keys payload TestKeys } @@ -712,11 +948,13 @@ type ServicesClientStopResponse struct { // ServicesClientUpdateResponse contains the response from method ServicesClient.BeginUpdate. type ServicesClientUpdateResponse struct { + // Service resource ServiceResource } // StoragesClientCreateOrUpdateResponse contains the response from method StoragesClient.BeginCreateOrUpdate. type StoragesClientCreateOrUpdateResponse struct { + // Storage resource payload. StorageResource } @@ -727,10 +965,12 @@ type StoragesClientDeleteResponse struct { // StoragesClientGetResponse contains the response from method StoragesClient.Get. type StoragesClientGetResponse struct { + // Storage resource payload. StorageResource } // StoragesClientListResponse contains the response from method StoragesClient.NewListPager. type StoragesClientListResponse struct { + // Collection compose of storage resources list and a possible link for next page. StorageResourceCollection } diff --git a/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go b/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go index ee6fdd183cd0..9c363f735afb 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -41,22 +40,25 @@ 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-09-01-preview // - options - RuntimeVersionsClientListRuntimeVersionsOptions contains the optional parameters for the RuntimeVersionsClient.ListRuntimeVersions // method. func (client *RuntimeVersionsClient) ListRuntimeVersions(ctx context.Context, options *RuntimeVersionsClientListRuntimeVersionsOptions) (RuntimeVersionsClientListRuntimeVersionsResponse, error) { + var err error req, err := client.listRuntimeVersionsCreateRequest(ctx, options) if err != nil { return RuntimeVersionsClientListRuntimeVersionsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RuntimeVersionsClientListRuntimeVersionsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RuntimeVersionsClientListRuntimeVersionsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RuntimeVersionsClientListRuntimeVersionsResponse{}, err } - return client.listRuntimeVersionsHandleResponse(resp) + resp, err := client.listRuntimeVersionsHandleResponse(httpResp) + return resp, err } // listRuntimeVersionsCreateRequest creates the ListRuntimeVersions request. @@ -67,7 +69,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-09-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..1e7e057668b4 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -61,7 +60,8 @@ func (client *ServiceRegistriesClient) BeginCreateOrUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[ServiceRegistriesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServiceRegistriesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServiceRegistriesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ 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-09-01-preview func (client *ServiceRegistriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, serviceRegistryName string, options *ServiceRegistriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, serviceRegistryName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -110,7 +112,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +121,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-09-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. @@ -132,7 +134,8 @@ func (client *ServiceRegistriesClient) BeginDelete(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[ServiceRegistriesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServiceRegistriesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServiceRegistriesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -141,20 +144,22 @@ 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-09-01-preview func (client *ServiceRegistriesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, serviceRegistryName string, options *ServiceRegistriesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, serviceRegistryName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,7 +186,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,25 +195,28 @@ 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-09-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. // - serviceRegistryName - The name of Service Registry. // - options - ServiceRegistriesClientGetOptions contains the optional parameters for the ServiceRegistriesClient.Get method. func (client *ServiceRegistriesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, serviceRegistryName string, options *ServiceRegistriesClientGetOptions) (ServiceRegistriesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, serviceRegistryName, options) if err != nil { return ServiceRegistriesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServiceRegistriesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceRegistriesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServiceRegistriesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -235,7 +243,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +260,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-09-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 +314,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-09-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..103830cab75a 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/services_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/services_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,24 +47,27 @@ 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-09-01-preview // - location - the region // - availabilityParameters - Parameters supplied to the operation. // - options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability // method. func (client *ServicesClient) CheckNameAvailability(ctx context.Context, location string, availabilityParameters NameAvailabilityParameters, options *ServicesClientCheckNameAvailabilityOptions) (ServicesClientCheckNameAvailabilityResponse, error) { + var err error req, err := client.checkNameAvailabilityCreateRequest(ctx, location, availabilityParameters, options) if err != nil { return ServicesClientCheckNameAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientCheckNameAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientCheckNameAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientCheckNameAvailabilityResponse{}, err } - return client.checkNameAvailabilityHandleResponse(resp) + resp, err := client.checkNameAvailabilityHandleResponse(httpResp) + return resp, err } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. @@ -84,10 +86,13 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, availabilityParameters) + if err := runtime.MarshalAsJSON(req, availabilityParameters); err != nil { + return nil, err + } + return req, nil } // checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. @@ -102,7 +107,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-09-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. @@ -115,7 +120,8 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[ServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -124,20 +130,22 @@ 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-09-01-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, resource ServiceResource, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -160,16 +168,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -180,7 +191,8 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -189,20 +201,22 @@ 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-09-01-preview func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -225,32 +239,109 @@ 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-09-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-09-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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientDisableApmGloballyResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } 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-09-01-preview +func (client *ServicesClient) disableApmGlobally(ctx context.Context, resourceGroupName string, serviceName string, apm ApmReference, options *ServicesClientBeginDisableApmGloballyOptions) (*http.Response, error) { + var err error + req, err := client.disableApmGloballyCreateRequest(ctx, resourceGroupName, serviceName, apm, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// 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-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, apm); err != nil { + return nil, err + } + return req, nil +} + // 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-09-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 - ServicesClientDisableTestEndpointOptions contains the optional parameters for the ServicesClient.DisableTestEndpoint // method. func (client *ServicesClient) DisableTestEndpoint(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientDisableTestEndpointOptions) (ServicesClientDisableTestEndpointResponse, error) { + var err error req, err := client.disableTestEndpointCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return ServicesClientDisableTestEndpointResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientDisableTestEndpointResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientDisableTestEndpointResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientDisableTestEndpointResponse{}, err } return ServicesClientDisableTestEndpointResponse{}, nil } @@ -275,34 +366,112 @@ 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-09-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-09-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 + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientEnableApmGloballyResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } 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-09-01-preview +func (client *ServicesClient) enableApmGlobally(ctx context.Context, resourceGroupName string, serviceName string, apm ApmReference, options *ServicesClientBeginEnableApmGloballyOptions) (*http.Response, error) { + var err error + req, err := client.enableApmGloballyCreateRequest(ctx, resourceGroupName, serviceName, apm, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, apm); err != nil { + return nil, err + } return req, nil } // 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-09-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 - ServicesClientEnableTestEndpointOptions contains the optional parameters for the ServicesClient.EnableTestEndpoint // method. func (client *ServicesClient) EnableTestEndpoint(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientEnableTestEndpointOptions) (ServicesClientEnableTestEndpointResponse, error) { + var err error req, err := client.enableTestEndpointCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return ServicesClientEnableTestEndpointResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientEnableTestEndpointResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientEnableTestEndpointResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientEnableTestEndpointResponse{}, err } - return client.enableTestEndpointHandleResponse(resp) + resp, err := client.enableTestEndpointHandleResponse(httpResp) + return resp, err } // enableTestEndpointCreateRequest creates the EnableTestEndpoint request. @@ -325,7 +494,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -340,27 +509,101 @@ func (client *ServicesClient) enableTestEndpointHandleResponse(resp *http.Respon return result, nil } +// BeginFlushVnetDNSSetting - Flush Virtual Network DNS settings for a VNET injected Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-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 - ServicesClientBeginFlushVnetDNSSettingOptions contains the optional parameters for the ServicesClient.BeginFlushVnetDNSSetting +// method. +func (client *ServicesClient) BeginFlushVnetDNSSetting(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginFlushVnetDNSSettingOptions) (*runtime.Poller[ServicesClientFlushVnetDNSSettingResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.flushVnetDNSSetting(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientFlushVnetDNSSettingResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ServicesClientFlushVnetDNSSettingResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// FlushVnetDNSSetting - Flush Virtual Network DNS settings for a VNET injected Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01-preview +func (client *ServicesClient) flushVnetDNSSetting(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginFlushVnetDNSSettingOptions) (*http.Response, error) { + var err error + req, err := client.flushVnetDNSSettingCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// flushVnetDNSSettingCreateRequest creates the FlushVnetDNSSetting request. +func (client *ServicesClient) flushVnetDNSSettingCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginFlushVnetDNSSettingOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/flushVirtualNetworkDnsSettings" + 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-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // 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-09-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 - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. func (client *ServicesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientGetOptions) (ServicesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return ServicesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -383,7 +626,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -400,7 +643,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-09-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 +691,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -465,7 +708,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-09-01-preview // - options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager // method. func (client *ServicesClient) NewListBySubscriptionPager(options *ServicesClientListBySubscriptionOptions) *runtime.Pager[ServicesClientListBySubscriptionResponse] { @@ -508,7 +751,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -523,27 +766,163 @@ 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-09-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) { + var err error + req, err := client.listGloballyEnabledApmsCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return ServicesClientListGloballyEnabledApmsResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServicesClientListGloballyEnabledApmsResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientListGloballyEnabledApmsResponse{}, err + } + resp, err := client.listGloballyEnabledApmsHandleResponse(httpResp) + return resp, err +} + +// 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-09-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-09-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-09-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-09-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 - ServicesClientListTestKeysOptions contains the optional parameters for the ServicesClient.ListTestKeys method. func (client *ServicesClient) ListTestKeys(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientListTestKeysOptions) (ServicesClientListTestKeysResponse, error) { + var err error req, err := client.listTestKeysCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return ServicesClientListTestKeysResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientListTestKeysResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientListTestKeysResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientListTestKeysResponse{}, err } - return client.listTestKeysHandleResponse(resp) + resp, err := client.listTestKeysHandleResponse(httpResp) + return resp, err } // listTestKeysCreateRequest creates the ListTestKeys request. @@ -566,7 +945,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -584,7 +963,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-09-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. @@ -592,18 +971,21 @@ func (client *ServicesClient) listTestKeysHandleResponse(resp *http.Response) (S // - options - ServicesClientRegenerateTestKeyOptions contains the optional parameters for the ServicesClient.RegenerateTestKey // method. func (client *ServicesClient) RegenerateTestKey(ctx context.Context, resourceGroupName string, serviceName string, regenerateTestKeyRequest RegenerateTestKeyRequestPayload, options *ServicesClientRegenerateTestKeyOptions) (ServicesClientRegenerateTestKeyResponse, error) { + var err error req, err := client.regenerateTestKeyCreateRequest(ctx, resourceGroupName, serviceName, regenerateTestKeyRequest, options) if err != nil { return ServicesClientRegenerateTestKeyResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServicesClientRegenerateTestKeyResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServicesClientRegenerateTestKeyResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServicesClientRegenerateTestKeyResponse{}, err } - return client.regenerateTestKeyHandleResponse(resp) + resp, err := client.regenerateTestKeyHandleResponse(httpResp) + return resp, err } // regenerateTestKeyCreateRequest creates the RegenerateTestKey request. @@ -626,10 +1008,13 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, regenerateTestKeyRequest) + if err := runtime.MarshalAsJSON(req, regenerateTestKeyRequest); err != nil { + return nil, err + } + return req, nil } // regenerateTestKeyHandleResponse handles the RegenerateTestKey response. @@ -644,7 +1029,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-09-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. @@ -655,7 +1040,8 @@ func (client *ServicesClient) BeginStart(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ServicesClientStartResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServicesClientStartResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientStartResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -664,20 +1050,22 @@ 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-09-01-preview func (client *ServicesClient) start(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStartOptions) (*http.Response, error) { + var err error req, err := client.startCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // startCreateRequest creates the Start request. @@ -700,7 +1088,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -709,7 +1097,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-09-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. @@ -720,7 +1108,8 @@ func (client *ServicesClient) BeginStop(ctx context.Context, resourceGroupName s if err != nil { return nil, err } - return runtime.NewPoller[ServicesClientStopResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServicesClientStopResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientStopResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -729,20 +1118,22 @@ 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-09-01-preview func (client *ServicesClient) stop(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStopOptions) (*http.Response, error) { + var err error req, err := client.stopCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // stopCreateRequest creates the Stop request. @@ -765,7 +1156,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -774,7 +1165,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-09-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. @@ -786,7 +1177,8 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[ServicesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ServicesClientUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServicesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -795,20 +1187,22 @@ 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-09-01-preview func (client *ServicesClient) update(ctx context.Context, resourceGroupName string, serviceName string, resource ServiceResource, options *ServicesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, resource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -831,8 +1225,11 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, resource) + if err := runtime.MarshalAsJSON(req, resource); err != nil { + return nil, err + } + return req, nil } 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..ae2fb37180f1 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/skus_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/skus_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -47,7 +46,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-09-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 +88,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-09-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..0c6e7ce3c35a 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/storages_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/storages_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform @@ -48,7 +47,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-09-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. @@ -62,7 +61,8 @@ func (client *StoragesClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller[StoragesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[StoragesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[StoragesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ 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-09-01-preview func (client *StoragesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, storageName string, storageResource StorageResource, options *StoragesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, storageName, storageResource, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ 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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, storageResource) + if err := runtime.MarshalAsJSON(req, storageResource); err != nil { + return nil, err + } + return req, nil } // 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-09-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. @@ -132,7 +137,8 @@ func (client *StoragesClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[StoragesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[StoragesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[StoragesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -141,20 +147,22 @@ 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-09-01-preview func (client *StoragesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, storageName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, 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) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,7 +189,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,25 +198,28 @@ 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-09-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. // - storageName - The name of the storage resource. // - options - StoragesClientGetOptions contains the optional parameters for the StoragesClient.Get method. func (client *StoragesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientGetOptions) (StoragesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, storageName, options) if err != nil { return StoragesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return StoragesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return StoragesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return StoragesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -235,7 +246,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-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +263,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-09-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 +316,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-09-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"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/time_rfc3339.go b/sdk/resourcemanager/appplatform/armappplatform/time_rfc3339.go index 22ee10481ef1..2deea19ec638 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/time_rfc3339.go +++ b/sdk/resourcemanager/appplatform/armappplatform/time_rfc3339.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armappplatform