From 0fa9f0511dbc6bc99490d4c1f6d259e17d44b2a8 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 8 Dec 2023 10:12:19 +0000 Subject: [PATCH] CodeGen from PR 26946 in Azure/azure-rest-api-specs Merge b08d1751dbe10ac5619938962b87ac8b4fb4e66d into 4e8862afb891a4c7835a227a1407898ae6e25985 --- .../appplatform/armappplatform/CHANGELOG.md | 111 ++ .../apiportalcustomdomains_client.go | 20 +- ...portalcustomdomains_client_example_test.go | 164 --- .../armappplatform/apiportals_client.go | 24 +- .../apiportals_client_example_test.go | 263 ---- .../appplatform/armappplatform/apms_client.go | 418 ++++++ .../applicationaccelerators_client.go | 20 +- ...icationaccelerators_client_example_test.go | 224 ---- .../applicationliveviews_client.go | 20 +- ...pplicationliveviews_client_example_test.go | 242 ---- .../appplatform/armappplatform/apps_client.go | 40 +- .../apps_client_example_test.go | 1086 --------------- .../appplatform/armappplatform/autorest.md | 7 +- .../armappplatform/bindings_client.go | 26 +- .../bindings_client_example_test.go | 253 ---- .../armappplatform/buildpackbinding_client.go | 24 +- .../buildpackbinding_client_example_test.go | 283 ---- .../armappplatform/buildservice_client.go | 227 +++- .../buildservice_client_example_test.go | 631 --------- .../buildserviceagentpool_client.go | 14 +- ...ildserviceagentpool_client_example_test.go | 160 --- .../buildservicebuilder_client.go | 24 +- ...buildservicebuilder_client_example_test.go | 239 ---- .../armappplatform/certificates_client.go | 20 +- .../certificates_client_example_test.go | 211 --- .../armappplatform/client_factory.go | 18 + .../armappplatform/configservers_client.go | 22 +- .../configservers_client_example_test.go | 215 --- .../configurationservices_client.go | 113 +- ...nfigurationservices_client_example_test.go | 295 ---- .../appplatform/armappplatform/constants.go | 274 +++- .../containerregistries_client.go | 438 ++++++ .../armappplatform/customdomains_client.go | 26 +- .../customdomains_client_example_test.go | 220 --- .../customizedaccelerators_client.go | 24 +- ...tomizedaccelerators_client_example_test.go | 294 ---- .../armappplatform/deployments_client.go | 92 +- .../deployments_client_example_test.go | 1032 -------------- .../armappplatform/devtoolportals_client.go | 20 +- .../devtoolportals_client_example_test.go | 263 ---- .../armappplatform/eurekaservers_client.go | 339 +++++ .../armappplatform/fake/apms_server.go | 315 +++++ .../fake/buildservice_server.go | 120 ++ .../fake/configurationservices_server.go | 80 +- .../fake/containerregistries_server.go | 332 +++++ .../armappplatform/fake/deployments_server.go | 16 +- .../fake/eurekaservers_server.go | 253 ++++ .../armappplatform/fake/gateways_server.go | 56 + .../armappplatform/fake/server_factory.go | 19 + .../armappplatform/fake/services_server.go | 333 ++++- .../gatewaycustomdomains_client.go | 20 +- ...atewaycustomdomains_client_example_test.go | 164 --- .../gatewayrouteconfigs_client.go | 20 +- ...gatewayrouteconfigs_client_example_test.go | 223 ---- .../armappplatform/gateways_client.go | 116 +- .../gateways_client_example_test.go | 412 ------ .../appplatform/armappplatform/go.mod | 2 +- .../appplatform/armappplatform/interfaces.go | 32 +- .../appplatform/armappplatform/models.go | 471 ++++++- .../armappplatform/models_serde.go | 1186 ++++++++++++++++- .../monitoringsettings_client.go | 16 +- .../monitoringsettings_client_example_test.go | 165 --- .../armappplatform/operations_client.go | 4 +- .../operations_client_example_test.go | 59 - .../appplatform/armappplatform/options.go | 153 +++ .../armappplatform/polymorphic_helpers.go | 67 + .../predefinedaccelerators_client.go | 20 +- ...definedaccelerators_client_example_test.go | 164 --- .../armappplatform/response_types.go | 137 ++ .../armappplatform/runtimeversions_client.go | 4 +- .../runtimeversions_client_example_test.go | 61 - .../serviceregistries_client.go | 20 +- .../serviceregistries_client_example_test.go | 201 --- .../armappplatform/services_client.go | 502 ++++++- .../services_client_example_test.go | 1026 -------------- .../appplatform/armappplatform/skus_client.go | 4 +- .../skus_client_example_test.go | 69 - .../armappplatform/storages_client.go | 20 +- .../storages_client_example_test.go | 169 --- 79 files changed, 6207 insertions(+), 9260 deletions(-) delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/apiportals_client_example_test.go create mode 100644 sdk/resourcemanager/appplatform/armappplatform/apms_client.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/apps_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/bindings_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/buildservice_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/certificates_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/configservers_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/configurationservices_client_example_test.go create mode 100644 sdk/resourcemanager/appplatform/armappplatform/containerregistries_client.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/customdomains_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/deployments_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client_example_test.go create mode 100644 sdk/resourcemanager/appplatform/armappplatform/eurekaservers_client.go create mode 100644 sdk/resourcemanager/appplatform/armappplatform/fake/apms_server.go create mode 100644 sdk/resourcemanager/appplatform/armappplatform/fake/containerregistries_server.go create mode 100644 sdk/resourcemanager/appplatform/armappplatform/fake/eurekaservers_server.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/gateways_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/services_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/skus_client_example_test.go delete mode 100644 sdk/resourcemanager/appplatform/armappplatform/storages_client_example_test.go diff --git a/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md b/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md index 7fae43b023db..64ea8c4fc357 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md +++ b/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md @@ -1,5 +1,116 @@ # Release History +## 2.0.0-beta.3 (2023-12-08) +### Breaking Changes + +- Field `Instances`, `ResourceRequests` of struct `DevToolPortalProperties` has been removed + +### Features Added + +- New value `SupportedRuntimeValueJava21` added to enum type `SupportedRuntimeValue` +- New enum type `APIPortalAPITryOutEnabledState` with values `APIPortalAPITryOutEnabledStateDisabled`, `APIPortalAPITryOutEnabledStateEnabled` +- 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 `CustomizedAcceleratorType` with values `CustomizedAcceleratorTypeAccelerator`, `CustomizedAcceleratorTypeFragment` +- 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 `KeyVaultCertificateAutoSync` with values `KeyVaultCertificateAutoSyncDisabled`, `KeyVaultCertificateAutoSyncEnabled` +- New enum type `TriggeredBuildResultProvisioningState` with values `TriggeredBuildResultProvisioningStateBuilding`, `TriggeredBuildResultProvisioningStateCanceled`, `TriggeredBuildResultProvisioningStateDeleting`, `TriggeredBuildResultProvisioningStateFailed`, `TriggeredBuildResultProvisioningStateQueuing`, `TriggeredBuildResultProvisioningStateSucceeded` +- 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 `*GatewayLocalResponseCachePerInstanceProperties.GetGatewayResponseCacheProperties() *GatewayResponseCacheProperties` +- New function `*GatewayLocalResponseCachePerRouteProperties.GetGatewayResponseCacheProperties() *GatewayResponseCacheProperties` +- New function `*GatewayResponseCacheProperties.GetGatewayResponseCacheProperties() *GatewayResponseCacheProperties` +- 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 `*ServicesClient.NewListSupportedServerVersionsPager(string, string, *ServicesClientListSupportedServerVersionsOptions) *runtime.Pager[ServicesClientListSupportedServerVersionsResponse]` +- 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 `GatewayLocalResponseCachePerInstanceProperties` +- New struct `GatewayLocalResponseCachePerRouteProperties` +- New struct `GatewayPropertiesClientAuth` +- New struct `GloballyEnabledApms` +- New struct `SupportedApmType` +- New struct `SupportedApmTypes` +- New struct `SupportedServerVersion` +- New struct `SupportedServerVersions` +- New struct `WarUploadedUserSourceInfo` +- New struct `WeeklyMaintenanceScheduleConfiguration` +- New field `APITryOutEnabledState` in struct `APIPortalProperties` +- New field `CaCertResourceID` in struct `AcceleratorBasicAuthSetting` +- New field `SubPath` in struct `AcceleratorGitRepository` +- 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 `RefreshIntervalInSeconds` in struct `ConfigurationServiceSettings` +- New field `AcceleratorType`, `Imports` in struct `CustomizedAcceleratorProperties` +- New field `Apms` in struct `DeploymentSettings` +- New field `Expand` in struct `DeploymentsClientListForClusterOptions` +- New field `Expand` in struct `DeploymentsClientListOptions` +- New field `Components` in struct `DevToolPortalProperties` +- New field `AllowedOriginPatterns` in struct `GatewayCorsProperties` +- New field `AddonConfigs`, `Apms`, `ClientAuth`, `ResponseCacheProperties` in struct `GatewayProperties` +- New field `AutoSync` in struct `KeyVaultCertificateProperties` +- New field `DataPlanePublicEndpoint` in struct `ServiceVNetAddons` +- New field `Image`, `LastTransitionReason`, `LastTransitionStatus`, `LastTransitionTime`, `ProvisioningState` in struct `TriggeredBuildResult` + + ## 2.0.0-beta.2 (2023-11-30) ### Features Added diff --git a/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go index 98ac580ebc02..27826c97e052 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -76,7 +76,7 @@ func (client *APIPortalCustomDomainsClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Create or update the API portal custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "APIPortalCustomDomainsClient.BeginCreateOrUpdate" @@ -126,7 +126,7 @@ func (client *APIPortalCustomDomainsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, apiPortalCustomDomainResource); err != nil { @@ -138,7 +138,7 @@ func (client *APIPortalCustomDomainsClient) createOrUpdateCreateRequest(ctx cont // BeginDelete - Delete the API portal custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -166,7 +166,7 @@ func (client *APIPortalCustomDomainsClient) BeginDelete(ctx context.Context, res // Delete - Delete the API portal custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "APIPortalCustomDomainsClient.BeginDelete" @@ -216,7 +216,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,7 +225,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -283,7 +283,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,7 +300,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that 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,7 +354,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", "2024-01-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 51204e168341..340b8eee6e1d 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/apiportals_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/apiportals_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -75,7 +75,7 @@ func (client *APIPortalsClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Create the default API portal or update the existing API portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "APIPortalsClient.BeginCreateOrUpdate" @@ -121,7 +121,7 @@ func (client *APIPortalsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, apiPortalResource); err != nil { @@ -133,7 +133,7 @@ func (client *APIPortalsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Delete the default API portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -159,7 +159,7 @@ func (client *APIPortalsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete the default API portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *APIPortalsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "APIPortalsClient.BeginDelete" @@ -205,7 +205,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *APIPortalsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get the API portal and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -266,7 +266,7 @@ func (client *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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -331,7 +331,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +349,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -403,7 +403,7 @@ func (client *APIPortalsClient) validateDomainCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, validatePayload); err != nil { 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..f2aba5a30b41 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/apms_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" +) + +// 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, 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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ApmsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ApmsClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update an APM. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-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 + const operationName = "ApmsClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ApmsClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Operation to delete an APM +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ApmsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, apmName string, options *ApmsClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ApmsClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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 + const operationName = "ApmsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ApmsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + }, nil) + if err != nil { + return ApmsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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 + const operationName = "ApmsClient.ListSecretKeys" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + 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", "2024-01-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 25ce77ff6a81..cc83fd6c5008 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -75,7 +75,7 @@ func (client *ApplicationAcceleratorsClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Create or update the application accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "ApplicationAcceleratorsClient.BeginCreateOrUpdate" @@ -121,7 +121,7 @@ func (client *ApplicationAcceleratorsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, applicationAcceleratorResource); err != nil { @@ -133,7 +133,7 @@ func (client *ApplicationAcceleratorsClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Delete the application accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -160,7 +160,7 @@ func (client *ApplicationAcceleratorsClient) BeginDelete(ctx context.Context, re // Delete - Delete the application accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *ApplicationAcceleratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, options *ApplicationAcceleratorsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationAcceleratorsClient.BeginDelete" @@ -206,7 +206,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -268,7 +268,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -334,7 +334,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", "2024-01-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 a0c9b05d80eb..6a454b369d96 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -75,7 +75,7 @@ func (client *ApplicationLiveViewsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Create the default Application Live View or update the existing Application Live View. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "ApplicationLiveViewsClient.BeginCreateOrUpdate" @@ -121,7 +121,7 @@ func (client *ApplicationLiveViewsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, applicationLiveViewResource); err != nil { @@ -133,7 +133,7 @@ func (client *ApplicationLiveViewsClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Disable the default Application Live View. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -160,7 +160,7 @@ func (client *ApplicationLiveViewsClient) BeginDelete(ctx context.Context, resou // Delete - Disable the default Application Live View. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *ApplicationLiveViewsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, options *ApplicationLiveViewsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ApplicationLiveViewsClient.BeginDelete" @@ -206,7 +206,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -268,7 +268,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -334,7 +334,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", "2024-01-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 3b06985220a1..006c3735631a 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/apps_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/apps_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -75,7 +75,7 @@ func (client *AppsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroup // CreateOrUpdate - Create a new App or update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "AppsClient.BeginCreateOrUpdate" @@ -121,7 +121,7 @@ func (client *AppsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, appResource); err != nil { @@ -133,7 +133,7 @@ func (client *AppsClient) createOrUpdateCreateRequest(ctx context.Context, resou // BeginDelete - Operation to delete an App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -159,7 +159,7 @@ func (client *AppsClient) BeginDelete(ctx context.Context, resourceGroupName str // Delete - Operation to delete an App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *AppsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, options *AppsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AppsClient.BeginDelete" @@ -205,7 +205,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *AppsClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Get an App and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -266,7 +266,7 @@ func (client *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", "2024-01-01-preview") if options != nil && options.SyncStatus != nil { reqQP.Set("syncStatus", *options.SyncStatus) } @@ -287,7 +287,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -340,7 +340,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -357,7 +357,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -405,7 +405,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -423,7 +423,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -451,7 +451,7 @@ func (client *AppsClient) BeginSetActiveDeployments(ctx context.Context, resourc // SetActiveDeployments - Set existing Deployment under the app as active // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "AppsClient.BeginSetActiveDeployments" @@ -497,7 +497,7 @@ func (client *AppsClient) setActiveDeploymentsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, activeDeploymentCollection); err != nil { @@ -509,7 +509,7 @@ func (client *AppsClient) setActiveDeploymentsCreateRequest(ctx context.Context, // BeginUpdate - Operation to update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -536,7 +536,7 @@ func (client *AppsClient) BeginUpdate(ctx context.Context, resourceGroupName str // Update - Operation to update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "AppsClient.BeginUpdate" @@ -582,7 +582,7 @@ func (client *AppsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, appResource); err != nil { @@ -594,7 +594,7 @@ func (client *AppsClient) updateCreateRequest(ctx context.Context, resourceGroup // ValidateDomain - Check the resource name is valid as well as not in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -647,7 +647,7 @@ func (client *AppsClient) validateDomainCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, validatePayload); err != nil { 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 44a47b18a07c..255778271759 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.2 -tag: package-preview-2023-01 +module-version: 2.0.0-beta.3 ``` \ 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 7093c3ccf010..42c86766a509 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/bindings_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/bindings_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -76,7 +76,7 @@ func (client *BindingsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a new Binding or update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "BindingsClient.BeginCreateOrUpdate" @@ -126,7 +126,7 @@ func (client *BindingsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bindingResource); err != nil { @@ -138,7 +138,7 @@ func (client *BindingsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Operation to delete a Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -165,7 +165,7 @@ func (client *BindingsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Operation to delete a Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "BindingsClient.BeginDelete" @@ -215,7 +215,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,7 +224,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -281,7 +281,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,7 +298,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -351,7 +351,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -369,7 +369,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -397,7 +397,7 @@ func (client *BindingsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Operation to update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "BindingsClient.BeginUpdate" @@ -447,7 +447,7 @@ func (client *BindingsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, bindingResource); err != 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 aa7422288784..8e416eb0ee08 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -77,7 +77,7 @@ func (client *BuildpackBindingClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Create or update a buildpack binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "BuildpackBindingClient.BeginCreateOrUpdate" @@ -131,7 +131,7 @@ func (client *BuildpackBindingClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, buildpackBinding); err != nil { @@ -143,7 +143,7 @@ func (client *BuildpackBindingClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Operation to delete a Buildpack Binding // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -172,7 +172,7 @@ func (client *BuildpackBindingClient) BeginDelete(ctx context.Context, resourceG // Delete - Operation to delete a Buildpack Binding // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "BuildpackBindingClient.BeginDelete" @@ -226,7 +226,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -235,7 +235,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -297,7 +297,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -314,7 +314,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -373,7 +373,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,7 +390,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -439,7 +439,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", "2024-01-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 4cffdc139390..f1716e93b5e5 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildservice_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildservice_client.go @@ -44,10 +44,97 @@ 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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BuildServiceClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create a build service resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-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 + const operationName = "BuildServiceClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, 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", "2024-01-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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -106,7 +193,7 @@ func (client *BuildServiceClient) createOrUpdateBuildCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, buildParam); err != nil { @@ -124,10 +211,98 @@ 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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BuildServiceClientDeleteBuildResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// DeleteBuild - delete a KPack build. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-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 + const operationName = "BuildServiceClient.BeginDeleteBuild" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + 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", "2024-01-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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -184,7 +359,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +377,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -265,7 +440,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +458,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -346,7 +521,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,7 +539,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -417,7 +592,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -435,7 +610,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -488,7 +663,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -506,7 +681,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -564,7 +739,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -582,7 +757,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -640,7 +815,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -657,7 +832,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -716,7 +891,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -733,7 +908,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -782,7 +957,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -799,7 +974,7 @@ func (client *BuildServiceClient) listBuildServicesHandleResponse(resp *http.Res // NewListBuildsPager - List KPack builds. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -853,7 +1028,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -871,7 +1046,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -924,7 +1099,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -942,7 +1117,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -995,7 +1170,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", "2024-01-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 459605100410..c995d8268eeb 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -105,7 +105,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -122,7 +122,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -176,7 +176,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +194,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -223,7 +223,7 @@ func (client *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 2024-01-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 const operationName = "BuildServiceAgentPoolClient.BeginUpdatePut" @@ -273,7 +273,7 @@ func (client *BuildServiceAgentPoolClient) updatePutCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, agentPoolResource); err != 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 70e51baa8ced..7dcfcd24f1da 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -76,7 +76,7 @@ func (client *BuildServiceBuilderClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Create or update a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "BuildServiceBuilderClient.BeginCreateOrUpdate" @@ -126,7 +126,7 @@ func (client *BuildServiceBuilderClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, builderResource); err != nil { @@ -138,7 +138,7 @@ func (client *BuildServiceBuilderClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -166,7 +166,7 @@ func (client *BuildServiceBuilderClient) BeginDelete(ctx context.Context, resour // Delete - Delete a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "BuildServiceBuilderClient.BeginDelete" @@ -216,7 +216,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,7 +225,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -282,7 +282,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -299,7 +299,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -353,7 +353,7 @@ func (client *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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -371,7 +371,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -429,7 +429,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", "2024-01-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 5a4f619b17f5..3aed4cd5c1fd 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/certificates_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/certificates_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -75,7 +75,7 @@ func (client *CertificatesClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Create or update certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "CertificatesClient.BeginCreateOrUpdate" @@ -121,7 +121,7 @@ func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, certificateResource); err != nil { @@ -133,7 +133,7 @@ func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete the certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -160,7 +160,7 @@ func (client *CertificatesClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete the certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *CertificatesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, certificateName string, options *CertificatesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CertificatesClient.BeginDelete" @@ -206,7 +206,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou // Get - Get the certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -267,7 +267,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that 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,7 +332,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", "2024-01-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 47cda9e7224e..eed499192b59 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/client_factory.go +++ b/sdk/resourcemanager/appplatform/armappplatform/client_factory.go @@ -50,6 +50,12 @@ func (c *ClientFactory) NewAPIPortalsClient() *APIPortalsClient { return subClient } +// NewApmsClient creates a new instance of ApmsClient. +func (c *ClientFactory) NewApmsClient() *ApmsClient { + subClient, _ := NewApmsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewApplicationAcceleratorsClient creates a new instance of ApplicationAcceleratorsClient. func (c *ClientFactory) NewApplicationAcceleratorsClient() *ApplicationAcceleratorsClient { subClient, _ := NewApplicationAcceleratorsClient(c.subscriptionID, c.credential, c.options) @@ -116,6 +122,12 @@ func (c *ClientFactory) NewConfigurationServicesClient() *ConfigurationServicesC return subClient } +// NewContainerRegistriesClient creates a new instance of ContainerRegistriesClient. +func (c *ClientFactory) NewContainerRegistriesClient() *ContainerRegistriesClient { + subClient, _ := NewContainerRegistriesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewCustomDomainsClient creates a new instance of CustomDomainsClient. func (c *ClientFactory) NewCustomDomainsClient() *CustomDomainsClient { subClient, _ := NewCustomDomainsClient(c.subscriptionID, c.credential, c.options) @@ -140,6 +152,12 @@ func (c *ClientFactory) NewDevToolPortalsClient() *DevToolPortalsClient { return subClient } +// NewEurekaServersClient creates a new instance of EurekaServersClient. +func (c *ClientFactory) NewEurekaServersClient() *EurekaServersClient { + subClient, _ := NewEurekaServersClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewGatewayCustomDomainsClient creates a new instance of GatewayCustomDomainsClient. func (c *ClientFactory) NewGatewayCustomDomainsClient() *GatewayCustomDomainsClient { subClient, _ := NewGatewayCustomDomainsClient(c.subscriptionID, c.credential, c.options) diff --git a/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go b/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go index 23d9edf4ed45..a94742eb627e 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go @@ -47,7 +47,7 @@ func NewConfigServersClient(subscriptionID string, credential azcore.TokenCreden // Get - Get the config server and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -94,7 +94,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +112,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that 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 +139,7 @@ func (client *ConfigServersClient) BeginUpdatePatch(ctx context.Context, resourc // UpdatePatch - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *ConfigServersClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, configServerResource ConfigServerResource, options *ConfigServersClientBeginUpdatePatchOptions) (*http.Response, error) { var err error const operationName = "ConfigServersClient.BeginUpdatePatch" @@ -181,7 +181,7 @@ func (client *ConfigServersClient) updatePatchCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, configServerResource); err != nil { @@ -193,7 +193,7 @@ func (client *ConfigServersClient) updatePatchCreateRequest(ctx context.Context, // BeginUpdatePut - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that 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,7 +220,7 @@ func (client *ConfigServersClient) BeginUpdatePut(ctx context.Context, resourceG // UpdatePut - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *ConfigServersClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, configServerResource ConfigServerResource, options *ConfigServersClientBeginUpdatePutOptions) (*http.Response, error) { var err error const operationName = "ConfigServersClient.BeginUpdatePut" @@ -262,7 +262,7 @@ func (client *ConfigServersClient) updatePutCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, configServerResource); err != nil { @@ -274,7 +274,7 @@ func (client *ConfigServersClient) updatePutCreateRequest(ctx context.Context, r // BeginValidate - Check if the config server settings are valid. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -302,7 +302,7 @@ func (client *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 2024-01-01-preview func (client *ConfigServersClient) validate(ctx context.Context, resourceGroupName string, serviceName string, configServerSettings ConfigServerSettings, options *ConfigServersClientBeginValidateOptions) (*http.Response, error) { var err error const operationName = "ConfigServersClient.BeginValidate" @@ -344,7 +344,7 @@ func (client *ConfigServersClient) validateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, configServerSettings); err != 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 9224ecb3f752..6f9067668713 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client.go @@ -48,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -77,7 +77,7 @@ func (client *ConfigurationServicesClient) BeginCreateOrUpdate(ctx context.Conte // Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "ConfigurationServicesClient.BeginCreateOrUpdate" @@ -123,7 +123,7 @@ func (client *ConfigurationServicesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, configurationServiceResource); err != nil { @@ -135,7 +135,7 @@ func (client *ConfigurationServicesClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Disable the default Application Configuration Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -162,7 +162,7 @@ func (client *ConfigurationServicesClient) BeginDelete(ctx context.Context, reso // Delete - Disable the default Application Configuration Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *ConfigurationServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, options *ConfigurationServicesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ConfigurationServicesClient.BeginDelete" @@ -208,7 +208,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -217,7 +217,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that 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,7 +270,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +287,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -336,7 +336,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +354,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -383,7 +383,7 @@ func (client *ConfigurationServicesClient) BeginValidate(ctx context.Context, re // Validate - Check if the Application Configuration Service settings are valid. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "ConfigurationServicesClient.BeginValidate" @@ -429,7 +429,7 @@ func (client *ConfigurationServicesClient) validateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, settings); err != nil { @@ -437,3 +437,90 @@ func (client *ConfigurationServicesClient) validateCreateRequest(ctx context.Con } 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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ConfigurationServicesClientValidateResourceResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// ValidateResource - Check if the Application Configuration Service resource is valid. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-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 + const operationName = "ConfigurationServicesClient.BeginValidateResource" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + 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", "2024-01-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 84cca53624d3..6ed70c9d0cfb 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/constants.go +++ b/sdk/resourcemanager/appplatform/armappplatform/constants.go @@ -10,9 +10,27 @@ package armappplatform const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform" - moduleVersion = "v2.0.0-beta.2" + moduleVersion = "v2.0.0-beta.3" ) +// APIPortalAPITryOutEnabledState - Indicates whether the API try-out feature is enabled or disabled. When enabled, users +// can try out the API by sending requests and viewing responses in API portal. When disabled, users cannot try out +// the API. +type APIPortalAPITryOutEnabledState string + +const ( + APIPortalAPITryOutEnabledStateDisabled APIPortalAPITryOutEnabledState = "Disabled" + APIPortalAPITryOutEnabledStateEnabled APIPortalAPITryOutEnabledState = "Enabled" +) + +// PossibleAPIPortalAPITryOutEnabledStateValues returns the possible values for the APIPortalAPITryOutEnabledState const type. +func PossibleAPIPortalAPITryOutEnabledStateValues() []APIPortalAPITryOutEnabledState { + return []APIPortalAPITryOutEnabledState{ + APIPortalAPITryOutEnabledStateDisabled, + APIPortalAPITryOutEnabledStateEnabled, + } +} + // APIPortalProvisioningState - State of the API portal. type APIPortalProvisioningState string @@ -49,6 +67,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 @@ -225,7 +267,7 @@ func PossibleBuildResultProvisioningStateValues() []BuildResultProvisioningState } } -// BuildServiceProvisioningState - Provisioning state of the KPack build result +// BuildServiceProvisioningState - Provisioning state of the KPack build service type BuildServiceProvisioningState string const ( @@ -313,6 +355,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 @@ -335,6 +395,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 @@ -357,6 +433,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 @@ -421,6 +521,22 @@ func PossibleCustomizedAcceleratorProvisioningStateValues() []CustomizedAccelera } } +// CustomizedAcceleratorType - Type of the customized accelerator. +type CustomizedAcceleratorType string + +const ( + CustomizedAcceleratorTypeAccelerator CustomizedAcceleratorType = "Accelerator" + CustomizedAcceleratorTypeFragment CustomizedAcceleratorType = "Fragment" +) + +// PossibleCustomizedAcceleratorTypeValues returns the possible values for the CustomizedAcceleratorType const type. +func PossibleCustomizedAcceleratorTypeValues() []CustomizedAcceleratorType { + return []CustomizedAcceleratorType{ + CustomizedAcceleratorTypeAccelerator, + CustomizedAcceleratorTypeFragment, + } +} + // CustomizedAcceleratorValidateResultState - State of the customized accelerator validation result type CustomizedAcceleratorValidateResultState string @@ -517,6 +633,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 @@ -555,6 +741,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:// @@ -594,6 +796,22 @@ func PossibleKPackBuildStageProvisioningStateValues() []KPackBuildStageProvision } } +// KeyVaultCertificateAutoSync - Indicates whether to automatically synchronize certificate from key vault or not. +type KeyVaultCertificateAutoSync string + +const ( + KeyVaultCertificateAutoSyncDisabled KeyVaultCertificateAutoSync = "Disabled" + KeyVaultCertificateAutoSyncEnabled KeyVaultCertificateAutoSync = "Enabled" +) + +// PossibleKeyVaultCertificateAutoSyncValues returns the possible values for the KeyVaultCertificateAutoSync const type. +func PossibleKeyVaultCertificateAutoSyncValues() []KeyVaultCertificateAutoSync { + return []KeyVaultCertificateAutoSync{ + KeyVaultCertificateAutoSyncDisabled, + KeyVaultCertificateAutoSyncEnabled, + } +} + // LastModifiedByType - The type of identity that last modified the resource. type LastModifiedByType string @@ -884,6 +1102,7 @@ type SupportedRuntimeValue string const ( SupportedRuntimeValueJava11 SupportedRuntimeValue = "Java_11" SupportedRuntimeValueJava17 SupportedRuntimeValue = "Java_17" + SupportedRuntimeValueJava21 SupportedRuntimeValue = "Java_21" SupportedRuntimeValueJava8 SupportedRuntimeValue = "Java_8" SupportedRuntimeValueNetCore31 SupportedRuntimeValue = "NetCore_31" ) @@ -893,6 +1112,7 @@ func PossibleSupportedRuntimeValueValues() []SupportedRuntimeValue { return []SupportedRuntimeValue{ SupportedRuntimeValueJava11, SupportedRuntimeValueJava17, + SupportedRuntimeValueJava21, SupportedRuntimeValueJava8, SupportedRuntimeValueNetCore31, } @@ -930,6 +1150,30 @@ func PossibleTrafficDirectionValues() []TrafficDirection { } } +// TriggeredBuildResultProvisioningState - The provisioning state of this build result +type TriggeredBuildResultProvisioningState string + +const ( + TriggeredBuildResultProvisioningStateBuilding TriggeredBuildResultProvisioningState = "Building" + TriggeredBuildResultProvisioningStateCanceled TriggeredBuildResultProvisioningState = "Canceled" + TriggeredBuildResultProvisioningStateDeleting TriggeredBuildResultProvisioningState = "Deleting" + TriggeredBuildResultProvisioningStateFailed TriggeredBuildResultProvisioningState = "Failed" + TriggeredBuildResultProvisioningStateQueuing TriggeredBuildResultProvisioningState = "Queuing" + TriggeredBuildResultProvisioningStateSucceeded TriggeredBuildResultProvisioningState = "Succeeded" +) + +// PossibleTriggeredBuildResultProvisioningStateValues returns the possible values for the TriggeredBuildResultProvisioningState const type. +func PossibleTriggeredBuildResultProvisioningStateValues() []TriggeredBuildResultProvisioningState { + return []TriggeredBuildResultProvisioningState{ + TriggeredBuildResultProvisioningStateBuilding, + TriggeredBuildResultProvisioningStateCanceled, + TriggeredBuildResultProvisioningStateDeleting, + TriggeredBuildResultProvisioningStateFailed, + TriggeredBuildResultProvisioningStateQueuing, + TriggeredBuildResultProvisioningStateSucceeded, + } +} + // Type - The type of the underlying resource to mount as a persistent disk. type Type string @@ -943,3 +1187,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..854a730075ce --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/containerregistries_client.go @@ -0,0 +1,438 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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, 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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ContainerRegistriesClientCreateOrUpdateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// CreateOrUpdate - Create or update container registry resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-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 + const operationName = "ContainerRegistriesClient.BeginCreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ContainerRegistriesClientDeleteResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Delete - Delete a container registry resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ContainerRegistriesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, options *ContainerRegistriesClientBeginDeleteOptions) (*http.Response, error) { + var err error + const operationName = "ContainerRegistriesClient.BeginDelete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceGroupName, 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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 + const operationName = "ContainerRegistriesClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ContainerRegistriesClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + }, nil) + if err != nil { + return ContainerRegistriesClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ContainerRegistriesClientValidateResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Validate - Check if the container registry properties are valid. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-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 + const operationName = "ContainerRegistriesClient.BeginValidate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + 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", "2024-01-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 78415f8be6f2..72d44162d53d 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -76,7 +76,7 @@ func (client *CustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Create or update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "CustomDomainsClient.BeginCreateOrUpdate" @@ -126,7 +126,7 @@ func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, domainResource); err != nil { @@ -138,7 +138,7 @@ func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Delete the custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -166,7 +166,7 @@ func (client *CustomDomainsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Delete the custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "CustomDomainsClient.BeginDelete" @@ -216,7 +216,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,7 +225,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -282,7 +282,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -299,7 +299,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -352,7 +352,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -370,7 +370,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -399,7 +399,7 @@ func (client *CustomDomainsClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "CustomDomainsClient.BeginUpdate" @@ -449,7 +449,7 @@ func (client *CustomDomainsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, domainResource); err != 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 d9fd3118d002..4a4b8763cb3e 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -76,7 +76,7 @@ func (client *CustomizedAcceleratorsClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Create or update the customized accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "CustomizedAcceleratorsClient.BeginCreateOrUpdate" @@ -126,7 +126,7 @@ func (client *CustomizedAcceleratorsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, customizedAcceleratorResource); err != nil { @@ -138,7 +138,7 @@ func (client *CustomizedAcceleratorsClient) createOrUpdateCreateRequest(ctx cont // BeginDelete - Delete the customized accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -166,7 +166,7 @@ func (client *CustomizedAcceleratorsClient) BeginDelete(ctx context.Context, res // Delete - Delete the customized accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "CustomizedAcceleratorsClient.BeginDelete" @@ -216,7 +216,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,7 +225,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -283,7 +283,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,7 +300,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that 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,7 +354,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -372,7 +372,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -431,7 +431,7 @@ func (client *CustomizedAcceleratorsClient) validateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { 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 5ee1bac592af..99c1106bf454 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/deployments_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/deployments_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -76,7 +76,7 @@ func (client *DeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Create a new Deployment or update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "DeploymentsClient.BeginCreateOrUpdate" @@ -126,7 +126,7 @@ func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, deploymentResource); err != nil { @@ -138,7 +138,7 @@ func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Operation to delete a Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -165,7 +165,7 @@ func (client *DeploymentsClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Operation to delete a Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "DeploymentsClient.BeginDelete" @@ -215,7 +215,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -224,7 +224,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -252,7 +252,7 @@ func (client *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 2024-01-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 const operationName = "DeploymentsClient.BeginDisableRemoteDebugging" @@ -302,7 +302,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -311,7 +311,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -339,7 +339,7 @@ func (client *DeploymentsClient) BeginEnableRemoteDebugging(ctx context.Context, // EnableRemoteDebugging - Enable remote debugging. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "DeploymentsClient.BeginEnableRemoteDebugging" @@ -389,7 +389,7 @@ func (client *DeploymentsClient) enableRemoteDebuggingCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.RemoteDebuggingPayload != nil { @@ -404,7 +404,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -433,7 +433,7 @@ func (client *DeploymentsClient) BeginGenerateHeapDump(ctx context.Context, reso // GenerateHeapDump - Generate Heap Dump // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "DeploymentsClient.BeginGenerateHeapDump" @@ -483,7 +483,7 @@ func (client *DeploymentsClient) generateHeapDumpCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, diagnosticParameters); err != nil { @@ -495,7 +495,7 @@ func (client *DeploymentsClient) generateHeapDumpCreateRequest(ctx context.Conte // BeginGenerateThreadDump - Generate Thread Dump // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -524,7 +524,7 @@ func (client *DeploymentsClient) BeginGenerateThreadDump(ctx context.Context, re // GenerateThreadDump - Generate Thread Dump // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "DeploymentsClient.BeginGenerateThreadDump" @@ -574,7 +574,7 @@ func (client *DeploymentsClient) generateThreadDumpCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, diagnosticParameters); err != nil { @@ -586,7 +586,7 @@ func (client *DeploymentsClient) generateThreadDumpCreateRequest(ctx context.Con // Get - Get a Deployment and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -643,7 +643,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -661,7 +661,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -719,7 +719,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -737,7 +737,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -795,7 +795,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -812,7 +812,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -865,12 +865,15 @@ 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", "2024-01-01-preview") if options != nil && options.Version != nil { for _, qv := range options.Version { reqQP.Add("version", qv) } } + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -887,7 +890,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -936,12 +939,15 @@ 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", "2024-01-01-preview") if options != nil && options.Version != nil { for _, qv := range options.Version { reqQP.Add("version", qv) } } + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -959,7 +965,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -987,7 +993,7 @@ func (client *DeploymentsClient) BeginRestart(ctx context.Context, resourceGroup // Restart - Restart the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "DeploymentsClient.BeginRestart" @@ -1037,7 +1043,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1046,7 +1052,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -1073,7 +1079,7 @@ func (client *DeploymentsClient) BeginStart(ctx context.Context, resourceGroupNa // Start - Start the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "DeploymentsClient.BeginStart" @@ -1123,7 +1129,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1132,7 +1138,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -1161,7 +1167,7 @@ func (client *DeploymentsClient) BeginStartJFR(ctx context.Context, resourceGrou // StartJFR - Start JFR // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "DeploymentsClient.BeginStartJFR" @@ -1211,7 +1217,7 @@ func (client *DeploymentsClient) startJFRCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, diagnosticParameters); err != nil { @@ -1223,7 +1229,7 @@ func (client *DeploymentsClient) startJFRCreateRequest(ctx context.Context, reso // BeginStop - Stop the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -1250,7 +1256,7 @@ func (client *DeploymentsClient) BeginStop(ctx context.Context, resourceGroupNam // Stop - Stop the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "DeploymentsClient.BeginStop" @@ -1300,7 +1306,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1309,7 +1315,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -1337,7 +1343,7 @@ func (client *DeploymentsClient) BeginUpdate(ctx context.Context, resourceGroupN // Update - Operation to update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "DeploymentsClient.BeginUpdate" @@ -1387,7 +1393,7 @@ func (client *DeploymentsClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, deploymentResource); err != 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 2014fcbcd686..9ad83b7c53c5 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -75,7 +75,7 @@ func (client *DevToolPortalsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Create the default Dev Tool Portal or update the existing Dev Tool Portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "DevToolPortalsClient.BeginCreateOrUpdate" @@ -121,7 +121,7 @@ func (client *DevToolPortalsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, devToolPortalResource); err != nil { @@ -133,7 +133,7 @@ func (client *DevToolPortalsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Disable the default Dev Tool Portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -160,7 +160,7 @@ func (client *DevToolPortalsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Disable the default Dev Tool Portal. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *DevToolPortalsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, options *DevToolPortalsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DevToolPortalsClient.BeginDelete" @@ -206,7 +206,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,7 @@ func (client *DevToolPortalsClient) deleteCreateRequest(ctx context.Context, res // Get - Get the Application Live and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -267,7 +267,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that 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,7 +332,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", "2024-01-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..9b65d60292ff --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/eurekaservers_client.go @@ -0,0 +1,339 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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, 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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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 + const operationName = "EurekaServersClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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 + const operationName = "EurekaServersClient.List" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.listCreateRequest(ctx, resourceGroupName, 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[EurekaServersClientUpdatePatchResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// UpdatePatch - Update the eureka server settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *EurekaServersClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, eurekaServerResource EurekaServerResource, options *EurekaServersClientBeginUpdatePatchOptions) (*http.Response, error) { + var err error + const operationName = "EurekaServersClient.BeginUpdatePatch" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[EurekaServersClientUpdatePutResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// UpdatePut - Update the eureka server settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *EurekaServersClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, eurekaServerResource EurekaServerResource, options *EurekaServersClientBeginUpdatePutOptions) (*http.Response, error) { + var err error + const operationName = "EurekaServersClient.BeginUpdatePut" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + 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", "2024-01-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/fake/apms_server.go b/sdk/resourcemanager/appplatform/armappplatform/fake/apms_server.go new file mode 100644 index 000000000000..22446a20ee43 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/fake/apms_server.go @@ -0,0 +1,315 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform/v2" + "net/http" + "net/url" + "regexp" +) + +// ApmsServer is a fake server for instances of the armappplatform.ApmsClient type. +type ApmsServer struct { + // BeginCreateOrUpdate is the fake for method ApmsClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serviceName string, apmName string, apmResource armappplatform.ApmResource, options *armappplatform.ApmsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armappplatform.ApmsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ApmsClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, serviceName string, apmName string, options *armappplatform.ApmsClientBeginDeleteOptions) (resp azfake.PollerResponder[armappplatform.ApmsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ApmsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, serviceName string, apmName string, options *armappplatform.ApmsClientGetOptions) (resp azfake.Responder[armappplatform.ApmsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ApmsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, serviceName string, options *armappplatform.ApmsClientListOptions) (resp azfake.PagerResponder[armappplatform.ApmsClientListResponse]) + + // ListSecretKeys is the fake for method ApmsClient.ListSecretKeys + // HTTP status codes to indicate success: http.StatusOK + ListSecretKeys func(ctx context.Context, resourceGroupName string, serviceName string, apmName string, options *armappplatform.ApmsClientListSecretKeysOptions) (resp azfake.Responder[armappplatform.ApmsClientListSecretKeysResponse], errResp azfake.ErrorResponder) +} + +// NewApmsServerTransport creates a new instance of ApmsServerTransport with the provided implementation. +// The returned ApmsServerTransport instance is connected to an instance of armappplatform.ApmsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewApmsServerTransport(srv *ApmsServer) *ApmsServerTransport { + return &ApmsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappplatform.ApmsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armappplatform.ApmsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armappplatform.ApmsClientListResponse]](), + } +} + +// ApmsServerTransport connects instances of armappplatform.ApmsClient to instances of ApmsServer. +// Don't use this type directly, use NewApmsServerTransport instead. +type ApmsServerTransport struct { + srv *ApmsServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armappplatform.ApmsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armappplatform.ApmsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armappplatform.ApmsClientListResponse]] +} + +// Do implements the policy.Transporter interface for ApmsServerTransport. +func (a *ApmsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ApmsClient.BeginCreateOrUpdate": + resp, err = a.dispatchBeginCreateOrUpdate(req) + case "ApmsClient.BeginDelete": + resp, err = a.dispatchBeginDelete(req) + case "ApmsClient.Get": + resp, err = a.dispatchGet(req) + case "ApmsClient.NewListPager": + resp, err = a.dispatchNewListPager(req) + case "ApmsClient.ListSecretKeys": + resp, err = a.dispatchListSecretKeys(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (a *ApmsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if a.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := a.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/apms/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armappplatform.ApmResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + apmNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("apmName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serviceNameParam, apmNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + a.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + a.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + a.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (a *ApmsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if a.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := a.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/apms/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + apmNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("apmName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameParam, serviceNameParam, apmNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + a.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + a.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + a.beginDelete.remove(req) + } + + return resp, nil +} + +func (a *ApmsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if a.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/apms/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + apmNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("apmName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, serviceNameParam, apmNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApmResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (a *ApmsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if a.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := a.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/apms` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + resp := a.srv.NewListPager(resourceGroupNameParam, serviceNameParam, nil) + newListPager = &resp + a.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armappplatform.ApmsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + a.newListPager.remove(req) + } + return resp, nil +} + +func (a *ApmsServerTransport) dispatchListSecretKeys(req *http.Request) (*http.Response, error) { + if a.srv.ListSecretKeys == nil { + return nil, &nonRetriableError{errors.New("fake for method ListSecretKeys not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/apms/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listSecretKeys` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + apmNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("apmName")]) + if err != nil { + return nil, err + } + respr, errRespr := a.srv.ListSecretKeys(req.Context(), resourceGroupNameParam, serviceNameParam, apmNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ApmSecretKeys, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/fake/buildservice_server.go b/sdk/resourcemanager/appplatform/armappplatform/fake/buildservice_server.go index 6d032485fa4c..a14c0b9117b5 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/fake/buildservice_server.go +++ b/sdk/resourcemanager/appplatform/armappplatform/fake/buildservice_server.go @@ -24,10 +24,18 @@ import ( // BuildServiceServer is a fake server for instances of the armappplatform.BuildServiceClient type. type BuildServiceServer struct { + // BeginCreateOrUpdate is the fake for method BuildServiceClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildService armappplatform.BuildService, options *armappplatform.BuildServiceClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armappplatform.BuildServiceClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + // CreateOrUpdateBuild is the fake for method BuildServiceClient.CreateOrUpdateBuild // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated CreateOrUpdateBuild func(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildName string, buildParam armappplatform.Build, options *armappplatform.BuildServiceClientCreateOrUpdateBuildOptions) (resp azfake.Responder[armappplatform.BuildServiceClientCreateOrUpdateBuildResponse], errResp azfake.ErrorResponder) + // BeginDeleteBuild is the fake for method BuildServiceClient.BeginDeleteBuild + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDeleteBuild func(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildName string, options *armappplatform.BuildServiceClientBeginDeleteBuildOptions) (resp azfake.PollerResponder[armappplatform.BuildServiceClientDeleteBuildResponse], errResp azfake.ErrorResponder) + // GetBuild is the fake for method BuildServiceClient.GetBuild // HTTP status codes to indicate success: http.StatusOK GetBuild func(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, buildName string, options *armappplatform.BuildServiceClientGetBuildOptions) (resp azfake.Responder[armappplatform.BuildServiceClientGetBuildResponse], errResp azfake.ErrorResponder) @@ -83,6 +91,8 @@ type BuildServiceServer struct { func NewBuildServiceServerTransport(srv *BuildServiceServer) *BuildServiceServerTransport { return &BuildServiceServerTransport{ srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappplatform.BuildServiceClientCreateOrUpdateResponse]](), + beginDeleteBuild: newTracker[azfake.PollerResponder[armappplatform.BuildServiceClientDeleteBuildResponse]](), newListBuildResultsPager: newTracker[azfake.PagerResponder[armappplatform.BuildServiceClientListBuildResultsResponse]](), newListBuildServicesPager: newTracker[azfake.PagerResponder[armappplatform.BuildServiceClientListBuildServicesResponse]](), newListBuildsPager: newTracker[azfake.PagerResponder[armappplatform.BuildServiceClientListBuildsResponse]](), @@ -93,6 +103,8 @@ func NewBuildServiceServerTransport(srv *BuildServiceServer) *BuildServiceServer // Don't use this type directly, use NewBuildServiceServerTransport instead. type BuildServiceServerTransport struct { srv *BuildServiceServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armappplatform.BuildServiceClientCreateOrUpdateResponse]] + beginDeleteBuild *tracker[azfake.PollerResponder[armappplatform.BuildServiceClientDeleteBuildResponse]] newListBuildResultsPager *tracker[azfake.PagerResponder[armappplatform.BuildServiceClientListBuildResultsResponse]] newListBuildServicesPager *tracker[azfake.PagerResponder[armappplatform.BuildServiceClientListBuildServicesResponse]] newListBuildsPager *tracker[azfake.PagerResponder[armappplatform.BuildServiceClientListBuildsResponse]] @@ -110,8 +122,12 @@ func (b *BuildServiceServerTransport) Do(req *http.Request) (*http.Response, err var err error switch method { + case "BuildServiceClient.BeginCreateOrUpdate": + resp, err = b.dispatchBeginCreateOrUpdate(req) case "BuildServiceClient.CreateOrUpdateBuild": resp, err = b.dispatchCreateOrUpdateBuild(req) + case "BuildServiceClient.BeginDeleteBuild": + resp, err = b.dispatchBeginDeleteBuild(req) case "BuildServiceClient.GetBuild": resp, err = b.dispatchGetBuild(req) case "BuildServiceClient.GetBuildResult": @@ -147,6 +163,58 @@ func (b *BuildServiceServerTransport) Do(req *http.Request) (*http.Response, err return resp, nil } +func (b *BuildServiceServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if b.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := b.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/buildServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armappplatform.BuildService](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + buildServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("buildServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serviceNameParam, buildServiceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + b.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + b.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + b.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + func (b *BuildServiceServerTransport) dispatchCreateOrUpdateBuild(req *http.Request) (*http.Response, error) { if b.srv.CreateOrUpdateBuild == nil { return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdateBuild not implemented")} @@ -192,6 +260,58 @@ func (b *BuildServiceServerTransport) dispatchCreateOrUpdateBuild(req *http.Requ return resp, nil } +func (b *BuildServiceServerTransport) dispatchBeginDeleteBuild(req *http.Request) (*http.Response, error) { + if b.srv.BeginDeleteBuild == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDeleteBuild not implemented")} + } + beginDeleteBuild := b.beginDeleteBuild.get(req) + if beginDeleteBuild == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/buildServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/builds/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 5 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + buildServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("buildServiceName")]) + if err != nil { + return nil, err + } + buildNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("buildName")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginDeleteBuild(req.Context(), resourceGroupNameParam, serviceNameParam, buildServiceNameParam, buildNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDeleteBuild = &respr + b.beginDeleteBuild.add(req, beginDeleteBuild) + } + + resp, err := server.PollerResponderNext(beginDeleteBuild, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + b.beginDeleteBuild.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDeleteBuild) { + b.beginDeleteBuild.remove(req) + } + + return resp, nil +} + func (b *BuildServiceServerTransport) dispatchGetBuild(req *http.Request) (*http.Response, error) { if b.srv.GetBuild == nil { return nil, &nonRetriableError{errors.New("fake for method GetBuild not implemented")} diff --git a/sdk/resourcemanager/appplatform/armappplatform/fake/configurationservices_server.go b/sdk/resourcemanager/appplatform/armappplatform/fake/configurationservices_server.go index cc01db9bc7ee..88d1f474d7b8 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/fake/configurationservices_server.go +++ b/sdk/resourcemanager/appplatform/armappplatform/fake/configurationservices_server.go @@ -43,6 +43,10 @@ type ConfigurationServicesServer struct { // BeginValidate is the fake for method ConfigurationServicesClient.BeginValidate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginValidate func(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, settings armappplatform.ConfigurationServiceSettings, options *armappplatform.ConfigurationServicesClientBeginValidateOptions) (resp azfake.PollerResponder[armappplatform.ConfigurationServicesClientValidateResponse], errResp azfake.ErrorResponder) + + // BeginValidateResource is the fake for method ConfigurationServicesClient.BeginValidateResource + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginValidateResource func(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, configurationServiceResource armappplatform.ConfigurationServiceResource, options *armappplatform.ConfigurationServicesClientBeginValidateResourceOptions) (resp azfake.PollerResponder[armappplatform.ConfigurationServicesClientValidateResourceResponse], errResp azfake.ErrorResponder) } // NewConfigurationServicesServerTransport creates a new instance of ConfigurationServicesServerTransport with the provided implementation. @@ -50,22 +54,24 @@ type ConfigurationServicesServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewConfigurationServicesServerTransport(srv *ConfigurationServicesServer) *ConfigurationServicesServerTransport { return &ConfigurationServicesServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armappplatform.ConfigurationServicesClientListResponse]](), - beginValidate: newTracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientValidateResponse]](), + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armappplatform.ConfigurationServicesClientListResponse]](), + beginValidate: newTracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientValidateResponse]](), + beginValidateResource: newTracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientValidateResourceResponse]](), } } // ConfigurationServicesServerTransport connects instances of armappplatform.ConfigurationServicesClient to instances of ConfigurationServicesServer. // Don't use this type directly, use NewConfigurationServicesServerTransport instead. type ConfigurationServicesServerTransport struct { - srv *ConfigurationServicesServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armappplatform.ConfigurationServicesClientListResponse]] - beginValidate *tracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientValidateResponse]] + srv *ConfigurationServicesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armappplatform.ConfigurationServicesClientListResponse]] + beginValidate *tracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientValidateResponse]] + beginValidateResource *tracker[azfake.PollerResponder[armappplatform.ConfigurationServicesClientValidateResourceResponse]] } // Do implements the policy.Transporter interface for ConfigurationServicesServerTransport. @@ -90,6 +96,8 @@ func (c *ConfigurationServicesServerTransport) Do(req *http.Request) (*http.Resp resp, err = c.dispatchNewListPager(req) case "ConfigurationServicesClient.BeginValidate": resp, err = c.dispatchBeginValidate(req) + case "ConfigurationServicesClient.BeginValidateResource": + resp, err = c.dispatchBeginValidateResource(req) default: err = fmt.Errorf("unhandled API %s", method) } @@ -330,3 +338,55 @@ func (c *ConfigurationServicesServerTransport) dispatchBeginValidate(req *http.R return resp, nil } + +func (c *ConfigurationServicesServerTransport) dispatchBeginValidateResource(req *http.Request) (*http.Response, error) { + if c.srv.BeginValidateResource == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginValidateResource not implemented")} + } + beginValidateResource := c.beginValidateResource.get(req) + if beginValidateResource == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/configurationServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/validateResource` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armappplatform.ConfigurationServiceResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + configurationServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("configurationServiceName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginValidateResource(req.Context(), resourceGroupNameParam, serviceNameParam, configurationServiceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginValidateResource = &respr + c.beginValidateResource.add(req, beginValidateResource) + } + + resp, err := server.PollerResponderNext(beginValidateResource, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginValidateResource.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginValidateResource) { + c.beginValidateResource.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/fake/containerregistries_server.go b/sdk/resourcemanager/appplatform/armappplatform/fake/containerregistries_server.go new file mode 100644 index 000000000000..70642b4422f2 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/fake/containerregistries_server.go @@ -0,0 +1,332 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform/v2" + "net/http" + "net/url" + "regexp" +) + +// ContainerRegistriesServer is a fake server for instances of the armappplatform.ContainerRegistriesClient type. +type ContainerRegistriesServer struct { + // BeginCreateOrUpdate is the fake for method ContainerRegistriesClient.BeginCreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, containerRegistryResource armappplatform.ContainerRegistryResource, options *armappplatform.ContainerRegistriesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armappplatform.ContainerRegistriesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // BeginDelete is the fake for method ContainerRegistriesClient.BeginDelete + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginDelete func(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, options *armappplatform.ContainerRegistriesClientBeginDeleteOptions) (resp azfake.PollerResponder[armappplatform.ContainerRegistriesClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method ContainerRegistriesClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, options *armappplatform.ContainerRegistriesClientGetOptions) (resp azfake.Responder[armappplatform.ContainerRegistriesClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method ContainerRegistriesClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, serviceName string, options *armappplatform.ContainerRegistriesClientListOptions) (resp azfake.PagerResponder[armappplatform.ContainerRegistriesClientListResponse]) + + // BeginValidate is the fake for method ContainerRegistriesClient.BeginValidate + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginValidate func(ctx context.Context, resourceGroupName string, serviceName string, containerRegistryName string, containerRegistryProperties armappplatform.ContainerRegistryProperties, options *armappplatform.ContainerRegistriesClientBeginValidateOptions) (resp azfake.PollerResponder[armappplatform.ContainerRegistriesClientValidateResponse], errResp azfake.ErrorResponder) +} + +// NewContainerRegistriesServerTransport creates a new instance of ContainerRegistriesServerTransport with the provided implementation. +// The returned ContainerRegistriesServerTransport instance is connected to an instance of armappplatform.ContainerRegistriesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewContainerRegistriesServerTransport(srv *ContainerRegistriesServer) *ContainerRegistriesServerTransport { + return &ContainerRegistriesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappplatform.ContainerRegistriesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armappplatform.ContainerRegistriesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armappplatform.ContainerRegistriesClientListResponse]](), + beginValidate: newTracker[azfake.PollerResponder[armappplatform.ContainerRegistriesClientValidateResponse]](), + } +} + +// ContainerRegistriesServerTransport connects instances of armappplatform.ContainerRegistriesClient to instances of ContainerRegistriesServer. +// Don't use this type directly, use NewContainerRegistriesServerTransport instead. +type ContainerRegistriesServerTransport struct { + srv *ContainerRegistriesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armappplatform.ContainerRegistriesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armappplatform.ContainerRegistriesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armappplatform.ContainerRegistriesClientListResponse]] + beginValidate *tracker[azfake.PollerResponder[armappplatform.ContainerRegistriesClientValidateResponse]] +} + +// Do implements the policy.Transporter interface for ContainerRegistriesServerTransport. +func (c *ContainerRegistriesServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "ContainerRegistriesClient.BeginCreateOrUpdate": + resp, err = c.dispatchBeginCreateOrUpdate(req) + case "ContainerRegistriesClient.BeginDelete": + resp, err = c.dispatchBeginDelete(req) + case "ContainerRegistriesClient.Get": + resp, err = c.dispatchGet(req) + case "ContainerRegistriesClient.NewListPager": + resp, err = c.dispatchNewListPager(req) + case "ContainerRegistriesClient.BeginValidate": + resp, err = c.dispatchBeginValidate(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (c *ContainerRegistriesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { + if c.srv.BeginCreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} + } + beginCreateOrUpdate := c.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/containerRegistries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armappplatform.ContainerRegistryResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + containerRegistryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerRegistryName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, serviceNameParam, containerRegistryNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCreateOrUpdate = &respr + c.beginCreateOrUpdate.add(req, beginCreateOrUpdate) + } + + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + c.beginCreateOrUpdate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCreateOrUpdate) { + c.beginCreateOrUpdate.remove(req) + } + + return resp, nil +} + +func (c *ContainerRegistriesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { + if c.srv.BeginDelete == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} + } + beginDelete := c.beginDelete.get(req) + if beginDelete == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/containerRegistries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + containerRegistryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerRegistryName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginDelete(req.Context(), resourceGroupNameParam, serviceNameParam, containerRegistryNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDelete = &respr + c.beginDelete.add(req, beginDelete) + } + + resp, err := server.PollerResponderNext(beginDelete, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + c.beginDelete.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDelete) { + c.beginDelete.remove(req) + } + + return resp, nil +} + +func (c *ContainerRegistriesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/containerRegistries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + containerRegistryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerRegistryName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), resourceGroupNameParam, serviceNameParam, containerRegistryNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).ContainerRegistryResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *ContainerRegistriesServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/containerRegistries` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + resp := c.srv.NewListPager(resourceGroupNameParam, serviceNameParam, nil) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armappplatform.ContainerRegistriesClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} + +func (c *ContainerRegistriesServerTransport) dispatchBeginValidate(req *http.Request) (*http.Response, error) { + if c.srv.BeginValidate == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginValidate not implemented")} + } + beginValidate := c.beginValidate.get(req) + if beginValidate == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/containerRegistries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/validate` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armappplatform.ContainerRegistryProperties](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + containerRegistryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("containerRegistryName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.BeginValidate(req.Context(), resourceGroupNameParam, serviceNameParam, containerRegistryNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginValidate = &respr + c.beginValidate.add(req, beginValidate) + } + + resp, err := server.PollerResponderNext(beginValidate, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginValidate.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginValidate) { + c.beginValidate.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/fake/deployments_server.go b/sdk/resourcemanager/appplatform/armappplatform/fake/deployments_server.go index f1cc1fecc634..348f89b16aad 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/fake/deployments_server.go +++ b/sdk/resourcemanager/appplatform/armappplatform/fake/deployments_server.go @@ -677,10 +677,16 @@ func (d *DeploymentsServerTransport) dispatchNewListPager(req *http.Request) (*h } versionParam[i] = u } + expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) + if err != nil { + return nil, err + } + expandParam := getOptional(expandUnescaped) var options *armappplatform.DeploymentsClientListOptions - if len(versionParam) > 0 { + if len(versionParam) > 0 || expandParam != nil { options = &armappplatform.DeploymentsClientListOptions{ Version: versionParam, + Expand: expandParam, } } resp := d.srv.NewListPager(resourceGroupNameParam, serviceNameParam, appNameParam, options) @@ -734,10 +740,16 @@ func (d *DeploymentsServerTransport) dispatchNewListForClusterPager(req *http.Re } versionParam[i] = u } + expandUnescaped, err := url.QueryUnescape(qp.Get("$expand")) + if err != nil { + return nil, err + } + expandParam := getOptional(expandUnescaped) var options *armappplatform.DeploymentsClientListForClusterOptions - if len(versionParam) > 0 { + if len(versionParam) > 0 || expandParam != nil { options = &armappplatform.DeploymentsClientListForClusterOptions{ Version: versionParam, + Expand: expandParam, } } resp := d.srv.NewListForClusterPager(resourceGroupNameParam, serviceNameParam, options) diff --git a/sdk/resourcemanager/appplatform/armappplatform/fake/eurekaservers_server.go b/sdk/resourcemanager/appplatform/armappplatform/fake/eurekaservers_server.go new file mode 100644 index 000000000000..b6813ee752ef --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/fake/eurekaservers_server.go @@ -0,0 +1,253 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform/v2" + "net/http" + "net/url" + "regexp" +) + +// EurekaServersServer is a fake server for instances of the armappplatform.EurekaServersClient type. +type EurekaServersServer struct { + // Get is the fake for method EurekaServersClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, serviceName string, options *armappplatform.EurekaServersClientGetOptions) (resp azfake.Responder[armappplatform.EurekaServersClientGetResponse], errResp azfake.ErrorResponder) + + // List is the fake for method EurekaServersClient.List + // HTTP status codes to indicate success: http.StatusOK + List func(ctx context.Context, resourceGroupName string, serviceName string, options *armappplatform.EurekaServersClientListOptions) (resp azfake.Responder[armappplatform.EurekaServersClientListResponse], errResp azfake.ErrorResponder) + + // BeginUpdatePatch is the fake for method EurekaServersClient.BeginUpdatePatch + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpdatePatch func(ctx context.Context, resourceGroupName string, serviceName string, eurekaServerResource armappplatform.EurekaServerResource, options *armappplatform.EurekaServersClientBeginUpdatePatchOptions) (resp azfake.PollerResponder[armappplatform.EurekaServersClientUpdatePatchResponse], errResp azfake.ErrorResponder) + + // BeginUpdatePut is the fake for method EurekaServersClient.BeginUpdatePut + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginUpdatePut func(ctx context.Context, resourceGroupName string, serviceName string, eurekaServerResource armappplatform.EurekaServerResource, options *armappplatform.EurekaServersClientBeginUpdatePutOptions) (resp azfake.PollerResponder[armappplatform.EurekaServersClientUpdatePutResponse], errResp azfake.ErrorResponder) +} + +// NewEurekaServersServerTransport creates a new instance of EurekaServersServerTransport with the provided implementation. +// The returned EurekaServersServerTransport instance is connected to an instance of armappplatform.EurekaServersClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewEurekaServersServerTransport(srv *EurekaServersServer) *EurekaServersServerTransport { + return &EurekaServersServerTransport{ + srv: srv, + beginUpdatePatch: newTracker[azfake.PollerResponder[armappplatform.EurekaServersClientUpdatePatchResponse]](), + beginUpdatePut: newTracker[azfake.PollerResponder[armappplatform.EurekaServersClientUpdatePutResponse]](), + } +} + +// EurekaServersServerTransport connects instances of armappplatform.EurekaServersClient to instances of EurekaServersServer. +// Don't use this type directly, use NewEurekaServersServerTransport instead. +type EurekaServersServerTransport struct { + srv *EurekaServersServer + beginUpdatePatch *tracker[azfake.PollerResponder[armappplatform.EurekaServersClientUpdatePatchResponse]] + beginUpdatePut *tracker[azfake.PollerResponder[armappplatform.EurekaServersClientUpdatePutResponse]] +} + +// Do implements the policy.Transporter interface for EurekaServersServerTransport. +func (e *EurekaServersServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "EurekaServersClient.Get": + resp, err = e.dispatchGet(req) + case "EurekaServersClient.List": + resp, err = e.dispatchList(req) + case "EurekaServersClient.BeginUpdatePatch": + resp, err = e.dispatchBeginUpdatePatch(req) + case "EurekaServersClient.BeginUpdatePut": + resp, err = e.dispatchBeginUpdatePut(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (e *EurekaServersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if e.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/eurekaServers/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.Get(req.Context(), resourceGroupNameParam, serviceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).EurekaServerResource, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (e *EurekaServersServerTransport) dispatchList(req *http.Request) (*http.Response, error) { + if e.srv.List == nil { + return nil, &nonRetriableError{errors.New("fake for method List not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/eurekaServers` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.List(req.Context(), resourceGroupNameParam, serviceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).EurekaServerResourceCollection, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (e *EurekaServersServerTransport) dispatchBeginUpdatePatch(req *http.Request) (*http.Response, error) { + if e.srv.BeginUpdatePatch == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdatePatch not implemented")} + } + beginUpdatePatch := e.beginUpdatePatch.get(req) + if beginUpdatePatch == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/eurekaServers/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armappplatform.EurekaServerResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginUpdatePatch(req.Context(), resourceGroupNameParam, serviceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdatePatch = &respr + e.beginUpdatePatch.add(req, beginUpdatePatch) + } + + resp, err := server.PollerResponderNext(beginUpdatePatch, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + e.beginUpdatePatch.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdatePatch) { + e.beginUpdatePatch.remove(req) + } + + return resp, nil +} + +func (e *EurekaServersServerTransport) dispatchBeginUpdatePut(req *http.Request) (*http.Response, error) { + if e.srv.BeginUpdatePut == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpdatePut not implemented")} + } + beginUpdatePut := e.beginUpdatePut.get(req) + if beginUpdatePut == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/eurekaServers/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armappplatform.EurekaServerResource](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + respr, errRespr := e.srv.BeginUpdatePut(req.Context(), resourceGroupNameParam, serviceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpdatePut = &respr + e.beginUpdatePut.add(req, beginUpdatePut) + } + + resp, err := server.PollerResponderNext(beginUpdatePut, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + e.beginUpdatePut.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpdatePut) { + e.beginUpdatePut.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/fake/gateways_server.go b/sdk/resourcemanager/appplatform/armappplatform/fake/gateways_server.go index 7d109804c56d..1d2cae8a5ca7 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/fake/gateways_server.go +++ b/sdk/resourcemanager/appplatform/armappplatform/fake/gateways_server.go @@ -44,6 +44,10 @@ type GatewaysServer struct { // HTTP status codes to indicate success: http.StatusOK ListEnvSecrets func(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *armappplatform.GatewaysClientListEnvSecretsOptions) (resp azfake.Responder[armappplatform.GatewaysClientListEnvSecretsResponse], errResp azfake.ErrorResponder) + // BeginRestart is the fake for method GatewaysClient.BeginRestart + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginRestart func(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *armappplatform.GatewaysClientBeginRestartOptions) (resp azfake.PollerResponder[armappplatform.GatewaysClientRestartResponse], errResp azfake.ErrorResponder) + // BeginUpdateCapacity is the fake for method GatewaysClient.BeginUpdateCapacity // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginUpdateCapacity func(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayCapacityResource armappplatform.SKUObject, options *armappplatform.GatewaysClientBeginUpdateCapacityOptions) (resp azfake.PollerResponder[armappplatform.GatewaysClientUpdateCapacityResponse], errResp azfake.ErrorResponder) @@ -62,6 +66,7 @@ func NewGatewaysServerTransport(srv *GatewaysServer) *GatewaysServerTransport { beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappplatform.GatewaysClientCreateOrUpdateResponse]](), beginDelete: newTracker[azfake.PollerResponder[armappplatform.GatewaysClientDeleteResponse]](), newListPager: newTracker[azfake.PagerResponder[armappplatform.GatewaysClientListResponse]](), + beginRestart: newTracker[azfake.PollerResponder[armappplatform.GatewaysClientRestartResponse]](), beginUpdateCapacity: newTracker[azfake.PollerResponder[armappplatform.GatewaysClientUpdateCapacityResponse]](), } } @@ -73,6 +78,7 @@ type GatewaysServerTransport struct { beginCreateOrUpdate *tracker[azfake.PollerResponder[armappplatform.GatewaysClientCreateOrUpdateResponse]] beginDelete *tracker[azfake.PollerResponder[armappplatform.GatewaysClientDeleteResponse]] newListPager *tracker[azfake.PagerResponder[armappplatform.GatewaysClientListResponse]] + beginRestart *tracker[azfake.PollerResponder[armappplatform.GatewaysClientRestartResponse]] beginUpdateCapacity *tracker[azfake.PollerResponder[armappplatform.GatewaysClientUpdateCapacityResponse]] } @@ -98,6 +104,8 @@ func (g *GatewaysServerTransport) Do(req *http.Request) (*http.Response, error) resp, err = g.dispatchNewListPager(req) case "GatewaysClient.ListEnvSecrets": resp, err = g.dispatchListEnvSecrets(req) + case "GatewaysClient.BeginRestart": + resp, err = g.dispatchBeginRestart(req) case "GatewaysClient.BeginUpdateCapacity": resp, err = g.dispatchBeginUpdateCapacity(req) case "GatewaysClient.ValidateDomain": @@ -328,6 +336,54 @@ func (g *GatewaysServerTransport) dispatchListEnvSecrets(req *http.Request) (*ht return resp, nil } +func (g *GatewaysServerTransport) dispatchBeginRestart(req *http.Request) (*http.Response, error) { + if g.srv.BeginRestart == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginRestart not implemented")} + } + beginRestart := g.beginRestart.get(req) + if beginRestart == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/gateways/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restart` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + gatewayNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("gatewayName")]) + if err != nil { + return nil, err + } + respr, errRespr := g.srv.BeginRestart(req.Context(), resourceGroupNameParam, serviceNameParam, gatewayNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginRestart = &respr + g.beginRestart.add(req, beginRestart) + } + + resp, err := server.PollerResponderNext(beginRestart, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + g.beginRestart.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginRestart) { + g.beginRestart.remove(req) + } + + return resp, nil +} + func (g *GatewaysServerTransport) dispatchBeginUpdateCapacity(req *http.Request) (*http.Response, error) { if g.srv.BeginUpdateCapacity == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdateCapacity not implemented")} diff --git a/sdk/resourcemanager/appplatform/armappplatform/fake/server_factory.go b/sdk/resourcemanager/appplatform/armappplatform/fake/server_factory.go index 95fd7fbc2291..9d81023dc661 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/fake/server_factory.go +++ b/sdk/resourcemanager/appplatform/armappplatform/fake/server_factory.go @@ -21,6 +21,7 @@ import ( type ServerFactory struct { APIPortalCustomDomainsServer APIPortalCustomDomainsServer APIPortalsServer APIPortalsServer + ApmsServer ApmsServer ApplicationAcceleratorsServer ApplicationAcceleratorsServer ApplicationLiveViewsServer ApplicationLiveViewsServer AppsServer AppsServer @@ -32,10 +33,12 @@ type ServerFactory struct { CertificatesServer CertificatesServer ConfigServersServer ConfigServersServer ConfigurationServicesServer ConfigurationServicesServer + ContainerRegistriesServer ContainerRegistriesServer CustomDomainsServer CustomDomainsServer CustomizedAcceleratorsServer CustomizedAcceleratorsServer DeploymentsServer DeploymentsServer DevToolPortalsServer DevToolPortalsServer + EurekaServersServer EurekaServersServer GatewayCustomDomainsServer GatewayCustomDomainsServer GatewayRouteConfigsServer GatewayRouteConfigsServer GatewaysServer GatewaysServer @@ -65,6 +68,7 @@ type ServerFactoryTransport struct { trMu sync.Mutex trAPIPortalCustomDomainsServer *APIPortalCustomDomainsServerTransport trAPIPortalsServer *APIPortalsServerTransport + trApmsServer *ApmsServerTransport trApplicationAcceleratorsServer *ApplicationAcceleratorsServerTransport trApplicationLiveViewsServer *ApplicationLiveViewsServerTransport trAppsServer *AppsServerTransport @@ -76,10 +80,12 @@ type ServerFactoryTransport struct { trCertificatesServer *CertificatesServerTransport trConfigServersServer *ConfigServersServerTransport trConfigurationServicesServer *ConfigurationServicesServerTransport + trContainerRegistriesServer *ContainerRegistriesServerTransport trCustomDomainsServer *CustomDomainsServerTransport trCustomizedAcceleratorsServer *CustomizedAcceleratorsServerTransport trDeploymentsServer *DeploymentsServerTransport trDevToolPortalsServer *DevToolPortalsServerTransport + trEurekaServersServer *EurekaServersServerTransport trGatewayCustomDomainsServer *GatewayCustomDomainsServerTransport trGatewayRouteConfigsServer *GatewayRouteConfigsServerTransport trGatewaysServer *GatewaysServerTransport @@ -114,6 +120,9 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "APIPortalsClient": initServer(s, &s.trAPIPortalsServer, func() *APIPortalsServerTransport { return NewAPIPortalsServerTransport(&s.srv.APIPortalsServer) }) resp, err = s.trAPIPortalsServer.Do(req) + case "ApmsClient": + initServer(s, &s.trApmsServer, func() *ApmsServerTransport { return NewApmsServerTransport(&s.srv.ApmsServer) }) + resp, err = s.trApmsServer.Do(req) case "ApplicationAcceleratorsClient": initServer(s, &s.trApplicationAcceleratorsServer, func() *ApplicationAcceleratorsServerTransport { return NewApplicationAcceleratorsServerTransport(&s.srv.ApplicationAcceleratorsServer) @@ -161,6 +170,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewConfigurationServicesServerTransport(&s.srv.ConfigurationServicesServer) }) resp, err = s.trConfigurationServicesServer.Do(req) + case "ContainerRegistriesClient": + initServer(s, &s.trContainerRegistriesServer, func() *ContainerRegistriesServerTransport { + return NewContainerRegistriesServerTransport(&s.srv.ContainerRegistriesServer) + }) + resp, err = s.trContainerRegistriesServer.Do(req) case "CustomDomainsClient": initServer(s, &s.trCustomDomainsServer, func() *CustomDomainsServerTransport { return NewCustomDomainsServerTransport(&s.srv.CustomDomainsServer) @@ -179,6 +193,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewDevToolPortalsServerTransport(&s.srv.DevToolPortalsServer) }) resp, err = s.trDevToolPortalsServer.Do(req) + case "EurekaServersClient": + initServer(s, &s.trEurekaServersServer, func() *EurekaServersServerTransport { + return NewEurekaServersServerTransport(&s.srv.EurekaServersServer) + }) + resp, err = s.trEurekaServersServer.Do(req) case "GatewayCustomDomainsClient": initServer(s, &s.trGatewayCustomDomainsServer, func() *GatewayCustomDomainsServerTransport { return NewGatewayCustomDomainsServerTransport(&s.srv.GatewayCustomDomainsServer) diff --git a/sdk/resourcemanager/appplatform/armappplatform/fake/services_server.go b/sdk/resourcemanager/appplatform/armappplatform/fake/services_server.go index 91061ae0831c..1f40c016f7b3 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/fake/services_server.go +++ b/sdk/resourcemanager/appplatform/armappplatform/fake/services_server.go @@ -36,14 +36,26 @@ type ServicesServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginDelete func(ctx context.Context, resourceGroupName string, serviceName string, options *armappplatform.ServicesClientBeginDeleteOptions) (resp azfake.PollerResponder[armappplatform.ServicesClientDeleteResponse], errResp azfake.ErrorResponder) + // BeginDisableApmGlobally is the fake for method ServicesClient.BeginDisableApmGlobally + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginDisableApmGlobally func(ctx context.Context, resourceGroupName string, serviceName string, apm armappplatform.ApmReference, options *armappplatform.ServicesClientBeginDisableApmGloballyOptions) (resp azfake.PollerResponder[armappplatform.ServicesClientDisableApmGloballyResponse], errResp azfake.ErrorResponder) + // DisableTestEndpoint is the fake for method ServicesClient.DisableTestEndpoint // HTTP status codes to indicate success: http.StatusOK DisableTestEndpoint func(ctx context.Context, resourceGroupName string, serviceName string, options *armappplatform.ServicesClientDisableTestEndpointOptions) (resp azfake.Responder[armappplatform.ServicesClientDisableTestEndpointResponse], errResp azfake.ErrorResponder) + // BeginEnableApmGlobally is the fake for method ServicesClient.BeginEnableApmGlobally + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginEnableApmGlobally func(ctx context.Context, resourceGroupName string, serviceName string, apm armappplatform.ApmReference, options *armappplatform.ServicesClientBeginEnableApmGloballyOptions) (resp azfake.PollerResponder[armappplatform.ServicesClientEnableApmGloballyResponse], errResp azfake.ErrorResponder) + // EnableTestEndpoint is the fake for method ServicesClient.EnableTestEndpoint // HTTP status codes to indicate success: http.StatusOK EnableTestEndpoint func(ctx context.Context, resourceGroupName string, serviceName string, options *armappplatform.ServicesClientEnableTestEndpointOptions) (resp azfake.Responder[armappplatform.ServicesClientEnableTestEndpointResponse], errResp azfake.ErrorResponder) + // BeginFlushVnetDNSSetting is the fake for method ServicesClient.BeginFlushVnetDNSSetting + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginFlushVnetDNSSetting func(ctx context.Context, resourceGroupName string, serviceName string, options *armappplatform.ServicesClientBeginFlushVnetDNSSettingOptions) (resp azfake.PollerResponder[armappplatform.ServicesClientFlushVnetDNSSettingResponse], errResp azfake.ErrorResponder) + // Get is the fake for method ServicesClient.Get // HTTP status codes to indicate success: http.StatusOK Get func(ctx context.Context, resourceGroupName string, serviceName string, options *armappplatform.ServicesClientGetOptions) (resp azfake.Responder[armappplatform.ServicesClientGetResponse], errResp azfake.ErrorResponder) @@ -56,6 +68,18 @@ type ServicesServer struct { // HTTP status codes to indicate success: http.StatusOK NewListBySubscriptionPager func(options *armappplatform.ServicesClientListBySubscriptionOptions) (resp azfake.PagerResponder[armappplatform.ServicesClientListBySubscriptionResponse]) + // ListGloballyEnabledApms is the fake for method ServicesClient.ListGloballyEnabledApms + // HTTP status codes to indicate success: http.StatusOK + ListGloballyEnabledApms func(ctx context.Context, resourceGroupName string, serviceName string, options *armappplatform.ServicesClientListGloballyEnabledApmsOptions) (resp azfake.Responder[armappplatform.ServicesClientListGloballyEnabledApmsResponse], errResp azfake.ErrorResponder) + + // NewListSupportedApmTypesPager is the fake for method ServicesClient.NewListSupportedApmTypesPager + // HTTP status codes to indicate success: http.StatusOK + NewListSupportedApmTypesPager func(resourceGroupName string, serviceName string, options *armappplatform.ServicesClientListSupportedApmTypesOptions) (resp azfake.PagerResponder[armappplatform.ServicesClientListSupportedApmTypesResponse]) + + // NewListSupportedServerVersionsPager is the fake for method ServicesClient.NewListSupportedServerVersionsPager + // HTTP status codes to indicate success: http.StatusOK + NewListSupportedServerVersionsPager func(resourceGroupName string, serviceName string, options *armappplatform.ServicesClientListSupportedServerVersionsOptions) (resp azfake.PagerResponder[armappplatform.ServicesClientListSupportedServerVersionsResponse]) + // ListTestKeys is the fake for method ServicesClient.ListTestKeys // HTTP status codes to indicate success: http.StatusOK ListTestKeys func(ctx context.Context, resourceGroupName string, serviceName string, options *armappplatform.ServicesClientListTestKeysOptions) (resp azfake.Responder[armappplatform.ServicesClientListTestKeysResponse], errResp azfake.ErrorResponder) @@ -82,28 +106,38 @@ type ServicesServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewServicesServerTransport(srv *ServicesServer) *ServicesServerTransport { return &ServicesServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappplatform.ServicesClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armappplatform.ServicesClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armappplatform.ServicesClientListResponse]](), - newListBySubscriptionPager: newTracker[azfake.PagerResponder[armappplatform.ServicesClientListBySubscriptionResponse]](), - beginStart: newTracker[azfake.PollerResponder[armappplatform.ServicesClientStartResponse]](), - beginStop: newTracker[azfake.PollerResponder[armappplatform.ServicesClientStopResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armappplatform.ServicesClientUpdateResponse]](), + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armappplatform.ServicesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armappplatform.ServicesClientDeleteResponse]](), + beginDisableApmGlobally: newTracker[azfake.PollerResponder[armappplatform.ServicesClientDisableApmGloballyResponse]](), + beginEnableApmGlobally: newTracker[azfake.PollerResponder[armappplatform.ServicesClientEnableApmGloballyResponse]](), + beginFlushVnetDNSSetting: newTracker[azfake.PollerResponder[armappplatform.ServicesClientFlushVnetDNSSettingResponse]](), + newListPager: newTracker[azfake.PagerResponder[armappplatform.ServicesClientListResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armappplatform.ServicesClientListBySubscriptionResponse]](), + newListSupportedApmTypesPager: newTracker[azfake.PagerResponder[armappplatform.ServicesClientListSupportedApmTypesResponse]](), + newListSupportedServerVersionsPager: newTracker[azfake.PagerResponder[armappplatform.ServicesClientListSupportedServerVersionsResponse]](), + beginStart: newTracker[azfake.PollerResponder[armappplatform.ServicesClientStartResponse]](), + beginStop: newTracker[azfake.PollerResponder[armappplatform.ServicesClientStopResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armappplatform.ServicesClientUpdateResponse]](), } } // ServicesServerTransport connects instances of armappplatform.ServicesClient to instances of ServicesServer. // Don't use this type directly, use NewServicesServerTransport instead. type ServicesServerTransport struct { - srv *ServicesServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armappplatform.ServicesClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armappplatform.ServicesClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armappplatform.ServicesClientListResponse]] - newListBySubscriptionPager *tracker[azfake.PagerResponder[armappplatform.ServicesClientListBySubscriptionResponse]] - beginStart *tracker[azfake.PollerResponder[armappplatform.ServicesClientStartResponse]] - beginStop *tracker[azfake.PollerResponder[armappplatform.ServicesClientStopResponse]] - beginUpdate *tracker[azfake.PollerResponder[armappplatform.ServicesClientUpdateResponse]] + srv *ServicesServer + beginCreateOrUpdate *tracker[azfake.PollerResponder[armappplatform.ServicesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armappplatform.ServicesClientDeleteResponse]] + beginDisableApmGlobally *tracker[azfake.PollerResponder[armappplatform.ServicesClientDisableApmGloballyResponse]] + beginEnableApmGlobally *tracker[azfake.PollerResponder[armappplatform.ServicesClientEnableApmGloballyResponse]] + beginFlushVnetDNSSetting *tracker[azfake.PollerResponder[armappplatform.ServicesClientFlushVnetDNSSettingResponse]] + newListPager *tracker[azfake.PagerResponder[armappplatform.ServicesClientListResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armappplatform.ServicesClientListBySubscriptionResponse]] + newListSupportedApmTypesPager *tracker[azfake.PagerResponder[armappplatform.ServicesClientListSupportedApmTypesResponse]] + newListSupportedServerVersionsPager *tracker[azfake.PagerResponder[armappplatform.ServicesClientListSupportedServerVersionsResponse]] + beginStart *tracker[azfake.PollerResponder[armappplatform.ServicesClientStartResponse]] + beginStop *tracker[azfake.PollerResponder[armappplatform.ServicesClientStopResponse]] + beginUpdate *tracker[azfake.PollerResponder[armappplatform.ServicesClientUpdateResponse]] } // Do implements the policy.Transporter interface for ServicesServerTransport. @@ -124,16 +158,28 @@ func (s *ServicesServerTransport) Do(req *http.Request) (*http.Response, error) resp, err = s.dispatchBeginCreateOrUpdate(req) case "ServicesClient.BeginDelete": resp, err = s.dispatchBeginDelete(req) + case "ServicesClient.BeginDisableApmGlobally": + resp, err = s.dispatchBeginDisableApmGlobally(req) case "ServicesClient.DisableTestEndpoint": resp, err = s.dispatchDisableTestEndpoint(req) + case "ServicesClient.BeginEnableApmGlobally": + resp, err = s.dispatchBeginEnableApmGlobally(req) case "ServicesClient.EnableTestEndpoint": resp, err = s.dispatchEnableTestEndpoint(req) + case "ServicesClient.BeginFlushVnetDNSSetting": + resp, err = s.dispatchBeginFlushVnetDNSSetting(req) case "ServicesClient.Get": resp, err = s.dispatchGet(req) case "ServicesClient.NewListPager": resp, err = s.dispatchNewListPager(req) case "ServicesClient.NewListBySubscriptionPager": resp, err = s.dispatchNewListBySubscriptionPager(req) + case "ServicesClient.ListGloballyEnabledApms": + resp, err = s.dispatchListGloballyEnabledApms(req) + case "ServicesClient.NewListSupportedApmTypesPager": + resp, err = s.dispatchNewListSupportedApmTypesPager(req) + case "ServicesClient.NewListSupportedServerVersionsPager": + resp, err = s.dispatchNewListSupportedServerVersionsPager(req) case "ServicesClient.ListTestKeys": resp, err = s.dispatchListTestKeys(req) case "ServicesClient.RegenerateTestKey": @@ -280,6 +326,54 @@ func (s *ServicesServerTransport) dispatchBeginDelete(req *http.Request) (*http. return resp, nil } +func (s *ServicesServerTransport) dispatchBeginDisableApmGlobally(req *http.Request) (*http.Response, error) { + if s.srv.BeginDisableApmGlobally == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginDisableApmGlobally not implemented")} + } + beginDisableApmGlobally := s.beginDisableApmGlobally.get(req) + if beginDisableApmGlobally == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/disableApmGlobally` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armappplatform.ApmReference](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginDisableApmGlobally(req.Context(), resourceGroupNameParam, serviceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginDisableApmGlobally = &respr + s.beginDisableApmGlobally.add(req, beginDisableApmGlobally) + } + + resp, err := server.PollerResponderNext(beginDisableApmGlobally, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginDisableApmGlobally.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginDisableApmGlobally) { + s.beginDisableApmGlobally.remove(req) + } + + return resp, nil +} + func (s *ServicesServerTransport) dispatchDisableTestEndpoint(req *http.Request) (*http.Response, error) { if s.srv.DisableTestEndpoint == nil { return nil, &nonRetriableError{errors.New("fake for method DisableTestEndpoint not implemented")} @@ -313,6 +407,54 @@ func (s *ServicesServerTransport) dispatchDisableTestEndpoint(req *http.Request) return resp, nil } +func (s *ServicesServerTransport) dispatchBeginEnableApmGlobally(req *http.Request) (*http.Response, error) { + if s.srv.BeginEnableApmGlobally == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginEnableApmGlobally not implemented")} + } + beginEnableApmGlobally := s.beginEnableApmGlobally.get(req) + if beginEnableApmGlobally == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/enableApmGlobally` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armappplatform.ApmReference](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginEnableApmGlobally(req.Context(), resourceGroupNameParam, serviceNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginEnableApmGlobally = &respr + s.beginEnableApmGlobally.add(req, beginEnableApmGlobally) + } + + resp, err := server.PollerResponderNext(beginEnableApmGlobally, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginEnableApmGlobally.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginEnableApmGlobally) { + s.beginEnableApmGlobally.remove(req) + } + + return resp, nil +} + func (s *ServicesServerTransport) dispatchEnableTestEndpoint(req *http.Request) (*http.Response, error) { if s.srv.EnableTestEndpoint == nil { return nil, &nonRetriableError{errors.New("fake for method EnableTestEndpoint not implemented")} @@ -346,6 +488,50 @@ func (s *ServicesServerTransport) dispatchEnableTestEndpoint(req *http.Request) return resp, nil } +func (s *ServicesServerTransport) dispatchBeginFlushVnetDNSSetting(req *http.Request) (*http.Response, error) { + if s.srv.BeginFlushVnetDNSSetting == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginFlushVnetDNSSetting not implemented")} + } + beginFlushVnetDNSSetting := s.beginFlushVnetDNSSetting.get(req) + if beginFlushVnetDNSSetting == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/flushVirtualNetworkDnsSettings` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.BeginFlushVnetDNSSetting(req.Context(), resourceGroupNameParam, serviceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginFlushVnetDNSSetting = &respr + s.beginFlushVnetDNSSetting.add(req, beginFlushVnetDNSSetting) + } + + resp, err := server.PollerResponderNext(beginFlushVnetDNSSetting, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginFlushVnetDNSSetting.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginFlushVnetDNSSetting) { + s.beginFlushVnetDNSSetting.remove(req) + } + + return resp, nil +} + func (s *ServicesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { if s.srv.Get == nil { return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} @@ -449,6 +635,121 @@ func (s *ServicesServerTransport) dispatchNewListBySubscriptionPager(req *http.R return resp, nil } +func (s *ServicesServerTransport) dispatchListGloballyEnabledApms(req *http.Request) (*http.Response, error) { + if s.srv.ListGloballyEnabledApms == nil { + return nil, &nonRetriableError{errors.New("fake for method ListGloballyEnabledApms not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/listGloballyEnabledApms` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.ListGloballyEnabledApms(req.Context(), resourceGroupNameParam, serviceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).GloballyEnabledApms, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *ServicesServerTransport) dispatchNewListSupportedApmTypesPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListSupportedApmTypesPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListSupportedApmTypesPager not implemented")} + } + newListSupportedApmTypesPager := s.newListSupportedApmTypesPager.get(req) + if newListSupportedApmTypesPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/supportedApmTypes` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + resp := s.srv.NewListSupportedApmTypesPager(resourceGroupNameParam, serviceNameParam, nil) + newListSupportedApmTypesPager = &resp + s.newListSupportedApmTypesPager.add(req, newListSupportedApmTypesPager) + server.PagerResponderInjectNextLinks(newListSupportedApmTypesPager, req, func(page *armappplatform.ServicesClientListSupportedApmTypesResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListSupportedApmTypesPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListSupportedApmTypesPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListSupportedApmTypesPager) { + s.newListSupportedApmTypesPager.remove(req) + } + return resp, nil +} + +func (s *ServicesServerTransport) dispatchNewListSupportedServerVersionsPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListSupportedServerVersionsPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListSupportedServerVersionsPager not implemented")} + } + newListSupportedServerVersionsPager := s.newListSupportedServerVersionsPager.get(req) + if newListSupportedServerVersionsPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.AppPlatform/Spring/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/supportedServerVersions` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + serviceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("serviceName")]) + if err != nil { + return nil, err + } + resp := s.srv.NewListSupportedServerVersionsPager(resourceGroupNameParam, serviceNameParam, nil) + newListSupportedServerVersionsPager = &resp + s.newListSupportedServerVersionsPager.add(req, newListSupportedServerVersionsPager) + server.PagerResponderInjectNextLinks(newListSupportedServerVersionsPager, req, func(page *armappplatform.ServicesClientListSupportedServerVersionsResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListSupportedServerVersionsPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListSupportedServerVersionsPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListSupportedServerVersionsPager) { + s.newListSupportedServerVersionsPager.remove(req) + } + return resp, nil +} + func (s *ServicesServerTransport) dispatchListTestKeys(req *http.Request) (*http.Response, error) { if s.srv.ListTestKeys == nil { return nil, &nonRetriableError{errors.New("fake for method ListTestKeys not implemented")} diff --git a/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go index b9b66de09b97..5037309a544a 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -76,7 +76,7 @@ func (client *GatewayCustomDomainsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Create or update the Spring Cloud Gateway custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "GatewayCustomDomainsClient.BeginCreateOrUpdate" @@ -126,7 +126,7 @@ func (client *GatewayCustomDomainsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, gatewayCustomDomainResource); err != nil { @@ -138,7 +138,7 @@ func (client *GatewayCustomDomainsClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Delete the Spring Cloud Gateway custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -166,7 +166,7 @@ func (client *GatewayCustomDomainsClient) BeginDelete(ctx context.Context, resou // Delete - Delete the Spring Cloud Gateway custom domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "GatewayCustomDomainsClient.BeginDelete" @@ -216,7 +216,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,7 +225,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -283,7 +283,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,7 +300,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that 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,7 +354,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", "2024-01-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 6ec101cf2056..1c08f267d365 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client.go @@ -48,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -78,7 +78,7 @@ func (client *GatewayRouteConfigsClient) BeginCreateOrUpdate(ctx context.Context // configs. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "GatewayRouteConfigsClient.BeginCreateOrUpdate" @@ -128,7 +128,7 @@ func (client *GatewayRouteConfigsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, gatewayRouteConfigResource); err != nil { @@ -140,7 +140,7 @@ func (client *GatewayRouteConfigsClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete the Spring Cloud Gateway route config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -168,7 +168,7 @@ func (client *GatewayRouteConfigsClient) BeginDelete(ctx context.Context, resour // Delete - Delete the Spring Cloud Gateway route config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "GatewayRouteConfigsClient.BeginDelete" @@ -218,7 +218,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -227,7 +227,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -284,7 +284,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,7 +301,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -355,7 +355,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", "2024-01-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 277657382594..a3665168c02a 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/gateways_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/gateways_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -75,7 +75,7 @@ func (client *GatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "GatewaysClient.BeginCreateOrUpdate" @@ -121,7 +121,7 @@ func (client *GatewaysClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, gatewayResource); err != nil { @@ -133,7 +133,7 @@ func (client *GatewaysClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Disable the default Spring Cloud Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -159,7 +159,7 @@ func (client *GatewaysClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Disable the default Spring Cloud Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *GatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "GatewaysClient.BeginDelete" @@ -205,7 +205,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *GatewaysClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the Spring Cloud Gateway and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -266,7 +266,7 @@ func (client *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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -331,7 +331,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +349,7 @@ func (client *GatewaysClient) listHandleResponse(resp *http.Response) (GatewaysC // ListEnvSecrets - List sensitive environment variables of Spring Cloud Gateway. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -401,7 +401,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -416,10 +416,92 @@ 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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GatewaysClientRestartResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Restart - Restart the Spring Cloud Gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *GatewaysClient) restart(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginRestartOptions) (*http.Response, error) { + var err error + const operationName = "GatewaysClient.BeginRestart" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + 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", "2024-01-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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -448,7 +530,7 @@ func (client *GatewaysClient) BeginUpdateCapacity(ctx context.Context, resourceG // UpdateCapacity - Operation to update an exiting Spring Cloud Gateway capacity. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "GatewaysClient.BeginUpdateCapacity" @@ -494,7 +576,7 @@ func (client *GatewaysClient) updateCapacityCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, gatewayCapacityResource); err != nil { @@ -506,7 +588,7 @@ func (client *GatewaysClient) updateCapacityCreateRequest(ctx context.Context, r // ValidateDomain - Check the domains are valid as well as not in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -559,7 +641,7 @@ func (client *GatewaysClient) validateDomainCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, validatePayload); err != nil { 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 a5cece9edf79..76dd84682fa2 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/go.mod +++ b/sdk/resourcemanager/appplatform/armappplatform/go.mod @@ -4,13 +4,13 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 github.com/stretchr/testify v1.8.4 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/sdk/resourcemanager/appplatform/armappplatform/interfaces.go b/sdk/resourcemanager/appplatform/armappplatform/interfaces.go index f99e87669177..99aa426121ad 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/interfaces.go +++ b/sdk/resourcemanager/appplatform/armappplatform/interfaces.go @@ -26,6 +26,15 @@ type CertificatePropertiesClassification interface { 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: @@ -35,6 +44,24 @@ type CustomPersistentDiskPropertiesClassification interface { GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties } +// GatewayResponseCachePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetGatewayResponseCacheProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *GatewayLocalResponseCachePerInstanceProperties, *GatewayLocalResponseCachePerRouteProperties, *GatewayResponseCacheProperties +type GatewayResponseCachePropertiesClassification interface { + // GetGatewayResponseCacheProperties returns the GatewayResponseCacheProperties content of the underlying type. + GetGatewayResponseCacheProperties() *GatewayResponseCacheProperties +} + +// 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: @@ -56,7 +83,8 @@ type StoragePropertiesClassification interface { // 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 +// - *JarUploadedUserSourceInfo, *NetCoreZipUploadedUserSourceInfo, *SourceUploadedUserSourceInfo, *UploadedUserSourceInfo, +// - *WarUploadedUserSourceInfo type UploadedUserSourceInfoClassification interface { UserSourceInfoClassification // GetUploadedUserSourceInfo returns the UploadedUserSourceInfo content of the underlying type. @@ -67,7 +95,7 @@ type UploadedUserSourceInfoClassification interface { // 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 +// - *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 8a1553dbb5a7..0f383d22f2b3 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/models.go +++ b/sdk/resourcemanager/appplatform/armappplatform/models.go @@ -55,6 +55,11 @@ type APIPortalInstance struct { // APIPortalProperties - API portal properties payload type APIPortalProperties struct { + // Indicates whether the API try-out feature is enabled or disabled. When enabled, users can try out the API by sending requests + // and viewing responses in API portal. When disabled, users cannot try out + // the API. + APITryOutEnabledState *APIPortalAPITryOutEnabledState + // The array of resource Ids of gateway to integrate with API portal. GatewayIDs []*string @@ -139,6 +144,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 } @@ -168,12 +176,18 @@ type AcceleratorGitRepository struct { // Interval for checking for updates to Git or image repository. IntervalInSeconds *int32 + + // Folder path inside the git repository to consider as the root of the accelerator or fragment. + SubPath *string } // AcceleratorPublicSetting - Auth setting for public url. 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. @@ -211,6 +225,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 @@ -279,6 +347,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 @@ -576,9 +647,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 @@ -653,6 +730,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 } @@ -755,13 +835,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 } @@ -925,6 +1008,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. @@ -957,6 +1046,9 @@ 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 @@ -979,7 +1071,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 @@ -1024,6 +1116,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 @@ -1105,6 +1200,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 @@ -1138,6 +1239,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 @@ -1195,6 +1299,9 @@ type ConfigurationServiceResourceRequests struct { type ConfigurationServiceSettings struct { // Property of git environment. GitProperty *ConfigurationServiceGitProperty + + // How often (in seconds) to check repository updates. Minimum value is 0. + RefreshIntervalInSeconds *int32 } // ConfigurationServiceSettingsValidateResult - Validation result for configuration service settings @@ -1209,6 +1316,85 @@ type ContainerProbeSettings struct { DisableProbe *bool } +// ContainerRegistryBasicCredentials - The basic authentication properties for the container registry resource. +type ContainerRegistryBasicCredentials struct { + // REQUIRED; The password of the Container Registry. + Password *string + + // REQUIRED; The login server of the Container Registry. + Server *string + + // REQUIRED; The credential type of the container registry credentials. + Type *string + + // REQUIRED; The username of the Container Registry. + Username *string +} + +// GetContainerRegistryCredentials implements the ContainerRegistryCredentialsClassification interface for type ContainerRegistryBasicCredentials. +func (c *ContainerRegistryBasicCredentials) GetContainerRegistryCredentials() *ContainerRegistryCredentials { + return &ContainerRegistryCredentials{ + Type: c.Type, + } +} + +// ContainerRegistryCredentials - The credential for the container registry resource. +type ContainerRegistryCredentials struct { + // REQUIRED; The credential type of the container registry credentials. + Type *string +} + +// GetContainerRegistryCredentials implements the ContainerRegistryCredentialsClassification interface for type ContainerRegistryCredentials. +func (c *ContainerRegistryCredentials) GetContainerRegistryCredentials() *ContainerRegistryCredentials { + return c +} + +// ContainerRegistryProperties - Container registry resource payload. +type ContainerRegistryProperties struct { + // REQUIRED; The credentials of the container registry resource. + Credentials ContainerRegistryCredentialsClassification + + // READ-ONLY; State of the Container Registry. + ProvisioningState *ContainerRegistryProvisioningState +} + +// ContainerRegistryResource - Container registry resource payload. +type ContainerRegistryResource struct { + // Properties of the container registry resource payload. + Properties *ContainerRegistryProperties + + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string + + // READ-ONLY; The name of the resource. + Name *string + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. + Type *string +} + +// ContainerRegistryResourceCollection - Collection compose of container registry resources list and a possible link for next +// page. +type ContainerRegistryResourceCollection struct { + // The link to next page of storage list. + NextLink *string + + // The container registry resources list. + Value []*ContainerRegistryResource +} + +// ContainerRegistryValidateResult - Validation result for container registry properties +type ContainerRegistryValidateResult struct { + // Indicate if the container registry properties are valid + IsValid *bool + + // Detailed validation messages. + Message *string +} + // ContentCertificateProperties - Properties of certificate imported from key vault. type ContentCertificateProperties struct { // REQUIRED; The type of the certificate source. @@ -1271,7 +1457,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 @@ -1404,10 +1590,16 @@ type CustomizedAcceleratorProperties struct { // REQUIRED GitRepository *AcceleratorGitRepository AcceleratorTags []*string + + // Type of the customized accelerator. + AcceleratorType *CustomizedAcceleratorType Description *string DisplayName *string IconURL *string + // READ-ONLY; Imports references all imports that this accelerator/fragment depends upon. + Imports []*string + // READ-ONLY; State of the customized accelerator. ProvisioningState *CustomizedAcceleratorProvisioningState } @@ -1530,6 +1722,9 @@ type DeploymentSettings struct { // Collection of addons AddonConfigs map[string]any + // Collection of ApmReferences + Apms []*ApmReference + // Container liveness and readiness probe settings ContainerProbeSettings *ContainerProbeSettings @@ -1569,6 +1764,17 @@ type DeploymentSettings struct { TerminationGracePeriodSeconds *int32 } +type DevToolPortalComponent struct { + // READ-ONLY; Collection of instances belong to Dev Tool Portal. + Instances []*DevToolPortalInstance + + // READ-ONLY + Name *string + + // READ-ONLY; The requested resource quantity for required CPU and Memory. + ResourceRequests *DevToolPortalResourceRequests +} + // DevToolPortalFeatureDetail - Detail settings for Dev Tool Portal feature type DevToolPortalFeatureDetail struct { // State of the plugin @@ -1607,15 +1813,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 } @@ -1696,6 +1899,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. @@ -1778,6 +2021,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 @@ -1831,6 +2077,44 @@ type GatewayInstance struct { Status *string } +// GatewayLocalResponseCachePerInstanceProperties - Spring Cloud Gateway local response cache per instance properties. +type GatewayLocalResponseCachePerInstanceProperties struct { + // REQUIRED; The type of the response cache. + ResponseCacheType *string + + // Maximum size of cache (10MB, 900KB, 1GB…) to determine if the cache needs to evict some entries + Size *string + + // Time before a cached entry is expired (300s, 5m, 1h…) + TimeToLive *string +} + +// GetGatewayResponseCacheProperties implements the GatewayResponseCachePropertiesClassification interface for type GatewayLocalResponseCachePerInstanceProperties. +func (g *GatewayLocalResponseCachePerInstanceProperties) GetGatewayResponseCacheProperties() *GatewayResponseCacheProperties { + return &GatewayResponseCacheProperties{ + ResponseCacheType: g.ResponseCacheType, + } +} + +// GatewayLocalResponseCachePerRouteProperties - Spring Cloud Gateway local response cache per route properties. +type GatewayLocalResponseCachePerRouteProperties struct { + // REQUIRED; The type of the response cache. + ResponseCacheType *string + + // Maximum size of cache (10MB, 900KB, 1GB…) to determine if the cache needs to evict some entries. + Size *string + + // Time before a cached entry is expired (300s, 5m, 1h…) + TimeToLive *string +} + +// GetGatewayResponseCacheProperties implements the GatewayResponseCachePropertiesClassification interface for type GatewayLocalResponseCachePerRouteProperties. +func (g *GatewayLocalResponseCachePerRouteProperties) GetGatewayResponseCacheProperties() *GatewayResponseCacheProperties { + return &GatewayResponseCacheProperties{ + ResponseCacheType: g.ResponseCacheType, + } +} + // GatewayOperatorProperties - Properties of the Spring Cloud Gateway Operator. type GatewayOperatorProperties struct { // READ-ONLY; Collection of instances belong to Spring Cloud Gateway operator. @@ -1857,9 +2141,18 @@ 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 + // Collection of ApmReferences in service level + Apms []*ApmReference + + // Client-Certification Authentication. + ClientAuth *GatewayPropertiesClientAuth + // Cross-Origin Resource Sharing property CorsProperties *GatewayCorsProperties @@ -1875,6 +2168,9 @@ type GatewayProperties struct { // The requested resource quantity for required CPU and Memory. ResourceRequests *GatewayResourceRequests + // The properties to configure different types of response cache for Spring Cloud Gateway. + ResponseCacheProperties GatewayResponseCachePropertiesClassification + // Single sign-on related configuration SsoProperties *SsoProperties @@ -1891,6 +2187,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 @@ -1939,6 +2244,17 @@ type GatewayResourceRequests struct { Memory *string } +// GatewayResponseCacheProperties - Spring Cloud Gateway response cache properties. +type GatewayResponseCacheProperties struct { + // REQUIRED; The type of the response cache. + ResponseCacheType *string +} + +// GetGatewayResponseCacheProperties implements the GatewayResponseCachePropertiesClassification interface for type GatewayResponseCacheProperties. +func (g *GatewayResponseCacheProperties) GetGatewayResponseCacheProperties() *GatewayResponseCacheProperties { + return g +} + // GatewayRouteConfigOpenAPIProperties - OpenAPI properties of Spring Cloud Gateway route config. type GatewayRouteConfigOpenAPIProperties struct { // The URI of OpenAPI specification. @@ -2038,6 +2354,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. @@ -2157,6 +2479,9 @@ type KeyVaultCertificateProperties struct { // REQUIRED; The vault uri of user key vault. VaultURI *string + // Indicates whether to automatically synchronize certificate from key vault or not. + AutoSync *KeyVaultCertificateAutoSync + // The certificate version of key vault. CertVersion *string @@ -2230,6 +2555,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. @@ -2952,6 +3288,10 @@ type ServiceSpecification struct { // ServiceVNetAddons - Additional Service settings in vnet injection instance type ServiceVNetAddons struct { + // Indicates whether the data plane components(log stream, app connect, remote debugging) in vnet injection instance could + // be accessed from internet. + DataPlanePublicEndpoint *bool + // Indicates whether the log stream in vnet injection instance could be accessed from internet. LogStreamPublicEndpoint *bool } @@ -3071,6 +3411,21 @@ type StorageResourceCollection struct { Value []*StorageResource } +// SupportedApmType - Supported APM type +type SupportedApmType struct { + // The name of the supported APM type + Name *string +} + +// SupportedApmTypes - Supported APM types payload +type SupportedApmTypes struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string + + // Collection of the supported APM type + Value []*SupportedApmType +} + // SupportedBuildpackResource - Supported buildpack resource payload type SupportedBuildpackResource struct { // Supported buildpack resource properties @@ -3117,6 +3472,27 @@ type SupportedRuntimeVersion struct { Version *string } +// SupportedServerVersion - Supported server version. +type SupportedServerVersion struct { + // The server name. + Server *string + + // The raw server version value which could be passed to deployment CRUD operations. + Value *string + + // The Server version. + Version *string +} + +// SupportedServerVersions - Supported server versions. +type SupportedServerVersions struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string + + // Collection of the supported server versions. + Value []*SupportedServerVersion +} + // SupportedStackResource - Supported stack resource payload type SupportedStackResource struct { // Supported stack resource properties @@ -3248,6 +3624,21 @@ type TrackedResource struct { type TriggeredBuildResult struct { // The unique build id of this build result ID *string + + // The container image of this build result + Image *string + + // The last transition reason of this build result + LastTransitionReason *string + + // The last transition status of this build result + LastTransitionStatus *string + + // The last transition time of this build result + LastTransitionTime *time.Time + + // READ-ONLY; The provisioning state of this build result + ProvisioningState *TriggeredBuildResultProvisioningState } // UploadedUserSourceInfo - Source with uploaded location @@ -3302,3 +3693,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, specified in ISO8601 format, e.g. PT8H + Duration *string +} + +// 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 39e26e8f3372..20f9acccdd98 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/models_serde.go +++ b/sdk/resourcemanager/appplatform/armappplatform/models_serde.go @@ -150,6 +150,7 @@ func (a *APIPortalInstance) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type APIPortalProperties. func (a APIPortalProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "apiTryOutEnabledState", a.APITryOutEnabledState) populate(objectMap, "gatewayIds", a.GatewayIDs) populate(objectMap, "httpsOnly", a.HTTPSOnly) populate(objectMap, "instances", a.Instances) @@ -171,6 +172,9 @@ func (a *APIPortalProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "apiTryOutEnabledState": + err = unpopulate(val, "APITryOutEnabledState", &a.APITryOutEnabledState) + delete(rawMsg, key) case "gatewayIds": err = unpopulate(val, "GatewayIDs", &a.GatewayIDs) delete(rawMsg, key) @@ -346,6 +350,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) @@ -363,6 +368,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) @@ -385,6 +393,7 @@ func (a AcceleratorGitRepository) MarshalJSON() ([]byte, error) { populate(objectMap, "commit", a.Commit) populate(objectMap, "gitTag", a.GitTag) populate(objectMap, "intervalInSeconds", a.IntervalInSeconds) + populate(objectMap, "subPath", a.SubPath) populate(objectMap, "url", a.URL) return json.Marshal(objectMap) } @@ -413,6 +422,9 @@ func (a *AcceleratorGitRepository) UnmarshalJSON(data []byte) error { case "intervalInSeconds": err = unpopulate(val, "IntervalInSeconds", &a.IntervalInSeconds) delete(rawMsg, key) + case "subPath": + err = unpopulate(val, "SubPath", &a.SubPath) + delete(rawMsg, key) case "url": err = unpopulate(val, "URL", &a.URL) delete(rawMsg, key) @@ -428,6 +440,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) } @@ -443,6 +456,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) @@ -517,6 +533,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) @@ -616,6 +799,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) } @@ -670,6 +854,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) @@ -1464,7 +1651,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) @@ -1485,9 +1674,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) @@ -1649,6 +1844,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) @@ -1672,6 +1868,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) @@ -1938,6 +2137,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) @@ -1953,6 +2153,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) @@ -2406,6 +2609,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) @@ -2485,6 +2715,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) @@ -2512,6 +2743,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) @@ -2614,6 +2848,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) @@ -2631,6 +2866,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) @@ -2842,6 +3080,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) @@ -2865,6 +3105,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) @@ -2940,6 +3186,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) @@ -2956,6 +3203,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) @@ -3089,6 +3339,7 @@ func (c *ConfigurationServiceResourceRequests) UnmarshalJSON(data []byte) error func (c ConfigurationServiceSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "gitProperty", c.GitProperty) + populate(objectMap, "refreshIntervalInSeconds", c.RefreshIntervalInSeconds) return json.Marshal(objectMap) } @@ -3104,6 +3355,9 @@ func (c *ConfigurationServiceSettings) UnmarshalJSON(data []byte) error { case "gitProperty": err = unpopulate(val, "GitProperty", &c.GitProperty) delete(rawMsg, key) + case "refreshIntervalInSeconds": + err = unpopulate(val, "RefreshIntervalInSeconds", &c.RefreshIntervalInSeconds) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -3166,24 +3420,18 @@ func (c *ContainerProbeSettings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContentCertificateProperties. -func (c ContentCertificateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryBasicCredentials. +func (c ContainerRegistryBasicCredentials) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "activateDate", c.ActivateDate) - populate(objectMap, "content", c.Content) - populate(objectMap, "dnsNames", c.DNSNames) - populate(objectMap, "expirationDate", c.ExpirationDate) - populate(objectMap, "issuedDate", c.IssuedDate) - populate(objectMap, "issuer", c.Issuer) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "subjectName", c.SubjectName) - populate(objectMap, "thumbprint", c.Thumbprint) - objectMap["type"] = "ContentCertificate" + 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 ContentCertificateProperties. -func (c *ContentCertificateProperties) UnmarshalJSON(data []byte) error { +// 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) @@ -3191,36 +3439,18 @@ func (c *ContentCertificateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "activateDate": - err = unpopulate(val, "ActivateDate", &c.ActivateDate) - delete(rawMsg, key) - case "content": - err = unpopulate(val, "Content", &c.Content) - delete(rawMsg, key) - case "dnsNames": - err = unpopulate(val, "DNSNames", &c.DNSNames) - delete(rawMsg, key) - case "expirationDate": - err = unpopulate(val, "ExpirationDate", &c.ExpirationDate) - delete(rawMsg, key) - case "issuedDate": - err = unpopulate(val, "IssuedDate", &c.IssuedDate) - delete(rawMsg, key) - case "issuer": - err = unpopulate(val, "Issuer", &c.Issuer) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "subjectName": - err = unpopulate(val, "SubjectName", &c.SubjectName) + case "password": + err = unpopulate(val, "Password", &c.Password) delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) + 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) @@ -3229,20 +3459,15 @@ func (c *ContentCertificateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomContainer. -func (c CustomContainer) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryCredentials. +func (c ContainerRegistryCredentials) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "args", c.Args) - populate(objectMap, "command", c.Command) - populate(objectMap, "containerImage", c.ContainerImage) - populate(objectMap, "imageRegistryCredential", c.ImageRegistryCredential) - populate(objectMap, "languageFramework", c.LanguageFramework) - populate(objectMap, "server", c.Server) + objectMap["type"] = c.Type return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomContainer. -func (c *CustomContainer) UnmarshalJSON(data []byte) error { +// 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) @@ -3250,19 +3475,250 @@ func (c *CustomContainer) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "args": - err = unpopulate(val, "Args", &c.Args) - delete(rawMsg, key) - case "command": - err = unpopulate(val, "Command", &c.Command) - delete(rawMsg, key) - case "containerImage": - err = unpopulate(val, "ContainerImage", &c.ContainerImage) - delete(rawMsg, key) - case "imageRegistryCredential": - err = unpopulate(val, "ImageRegistryCredential", &c.ImageRegistryCredential) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) - case "languageFramework": + } + 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) + populate(objectMap, "activateDate", c.ActivateDate) + populate(objectMap, "content", c.Content) + populate(objectMap, "dnsNames", c.DNSNames) + populate(objectMap, "expirationDate", c.ExpirationDate) + populate(objectMap, "issuedDate", c.IssuedDate) + populate(objectMap, "issuer", c.Issuer) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "subjectName", c.SubjectName) + populate(objectMap, "thumbprint", c.Thumbprint) + objectMap["type"] = "ContentCertificate" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContentCertificateProperties. +func (c *ContentCertificateProperties) UnmarshalJSON(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 "activateDate": + err = unpopulate(val, "ActivateDate", &c.ActivateDate) + delete(rawMsg, key) + case "content": + err = unpopulate(val, "Content", &c.Content) + delete(rawMsg, key) + case "dnsNames": + err = unpopulate(val, "DNSNames", &c.DNSNames) + delete(rawMsg, key) + case "expirationDate": + err = unpopulate(val, "ExpirationDate", &c.ExpirationDate) + delete(rawMsg, key) + case "issuedDate": + err = unpopulate(val, "IssuedDate", &c.IssuedDate) + delete(rawMsg, key) + case "issuer": + err = unpopulate(val, "Issuer", &c.Issuer) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "subjectName": + err = unpopulate(val, "SubjectName", &c.SubjectName) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) + delete(rawMsg, key) + case "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 CustomContainer. +func (c CustomContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "args", c.Args) + populate(objectMap, "command", c.Command) + populate(objectMap, "containerImage", c.ContainerImage) + populate(objectMap, "imageRegistryCredential", c.ImageRegistryCredential) + populate(objectMap, "languageFramework", c.LanguageFramework) + populate(objectMap, "server", c.Server) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomContainer. +func (c *CustomContainer) UnmarshalJSON(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 "args": + err = unpopulate(val, "Args", &c.Args) + delete(rawMsg, key) + case "command": + err = unpopulate(val, "Command", &c.Command) + delete(rawMsg, key) + case "containerImage": + err = unpopulate(val, "ContainerImage", &c.ContainerImage) + delete(rawMsg, key) + case "imageRegistryCredential": + err = unpopulate(val, "ImageRegistryCredential", &c.ImageRegistryCredential) + delete(rawMsg, key) + case "languageFramework": err = unpopulate(val, "LanguageFramework", &c.LanguageFramework) delete(rawMsg, key) case "server": @@ -3595,10 +4051,12 @@ func (c *CustomScaleRule) UnmarshalJSON(data []byte) error { func (c CustomizedAcceleratorProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "acceleratorTags", c.AcceleratorTags) + populate(objectMap, "acceleratorType", c.AcceleratorType) populate(objectMap, "description", c.Description) populate(objectMap, "displayName", c.DisplayName) populate(objectMap, "gitRepository", c.GitRepository) populate(objectMap, "iconUrl", c.IconURL) + populate(objectMap, "imports", c.Imports) populate(objectMap, "provisioningState", c.ProvisioningState) return json.Marshal(objectMap) } @@ -3615,6 +4073,9 @@ func (c *CustomizedAcceleratorProperties) UnmarshalJSON(data []byte) error { case "acceleratorTags": err = unpopulate(val, "AcceleratorTags", &c.AcceleratorTags) delete(rawMsg, key) + case "acceleratorType": + err = unpopulate(val, "AcceleratorType", &c.AcceleratorType) + delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) @@ -3627,6 +4088,9 @@ func (c *CustomizedAcceleratorProperties) UnmarshalJSON(data []byte) error { case "iconUrl": err = unpopulate(val, "IconURL", &c.IconURL) delete(rawMsg, key) + case "imports": + err = unpopulate(val, "Imports", &c.Imports) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) @@ -3950,6 +4414,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) @@ -3973,6 +4438,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) @@ -4005,6 +4473,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) @@ -4101,11 +4604,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) @@ -4120,21 +4622,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) @@ -4363,6 +4862,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) @@ -4502,6 +5110,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) @@ -4526,6 +5135,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) @@ -4675,6 +5287,76 @@ func (g *GatewayInstance) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type GatewayLocalResponseCachePerInstanceProperties. +func (g GatewayLocalResponseCachePerInstanceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["responseCacheType"] = "LocalCachePerInstance" + populate(objectMap, "size", g.Size) + populate(objectMap, "timeToLive", g.TimeToLive) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayLocalResponseCachePerInstanceProperties. +func (g *GatewayLocalResponseCachePerInstanceProperties) UnmarshalJSON(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 "responseCacheType": + err = unpopulate(val, "ResponseCacheType", &g.ResponseCacheType) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &g.Size) + delete(rawMsg, key) + case "timeToLive": + err = unpopulate(val, "TimeToLive", &g.TimeToLive) + 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 GatewayLocalResponseCachePerRouteProperties. +func (g GatewayLocalResponseCachePerRouteProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["responseCacheType"] = "LocalCachePerRoute" + populate(objectMap, "size", g.Size) + populate(objectMap, "timeToLive", g.TimeToLive) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayLocalResponseCachePerRouteProperties. +func (g *GatewayLocalResponseCachePerRouteProperties) UnmarshalJSON(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 "responseCacheType": + err = unpopulate(val, "ResponseCacheType", &g.ResponseCacheType) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &g.Size) + delete(rawMsg, key) + case "timeToLive": + err = unpopulate(val, "TimeToLive", &g.TimeToLive) + 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 GatewayOperatorProperties. func (g GatewayOperatorProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4745,7 +5427,10 @@ 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, "apms", g.Apms) + populate(objectMap, "clientAuth", g.ClientAuth) populate(objectMap, "corsProperties", g.CorsProperties) populate(objectMap, "environmentVariables", g.EnvironmentVariables) populate(objectMap, "httpsOnly", g.HTTPSOnly) @@ -4754,6 +5439,7 @@ func (g GatewayProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "provisioningState", g.ProvisioningState) populate(objectMap, "public", g.Public) populate(objectMap, "resourceRequests", g.ResourceRequests) + populate(objectMap, "responseCacheProperties", g.ResponseCacheProperties) populate(objectMap, "ssoProperties", g.SsoProperties) populate(objectMap, "url", g.URL) return json.Marshal(objectMap) @@ -4771,9 +5457,18 @@ 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 "apms": + err = unpopulate(val, "Apms", &g.Apms) + 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) @@ -4798,6 +5493,9 @@ func (g *GatewayProperties) UnmarshalJSON(data []byte) error { case "resourceRequests": err = unpopulate(val, "ResourceRequests", &g.ResourceRequests) delete(rawMsg, key) + case "responseCacheProperties": + g.ResponseCacheProperties, err = unmarshalGatewayResponseCachePropertiesClassification(val) + delete(rawMsg, key) case "ssoProperties": err = unpopulate(val, "SsoProperties", &g.SsoProperties) delete(rawMsg, key) @@ -4812,6 +5510,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) @@ -4952,6 +5681,33 @@ func (g *GatewayResourceRequests) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type GatewayResponseCacheProperties. +func (g GatewayResponseCacheProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["responseCacheType"] = g.ResponseCacheType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResponseCacheProperties. +func (g *GatewayResponseCacheProperties) UnmarshalJSON(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 "responseCacheType": + err = unpopulate(val, "ResponseCacheType", &g.ResponseCacheType) + 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 GatewayRouteConfigOpenAPIProperties. func (g GatewayRouteConfigOpenAPIProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5175,6 +5931,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) @@ -5420,6 +6203,7 @@ func (j *JarUploadedUserSourceInfo) UnmarshalJSON(data []byte) error { func (k KeyVaultCertificateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "activateDate", k.ActivateDate) + populate(objectMap, "autoSync", k.AutoSync) populate(objectMap, "certVersion", k.CertVersion) populate(objectMap, "dnsNames", k.DNSNames) populate(objectMap, "excludePrivateKey", k.ExcludePrivateKey) @@ -5447,6 +6231,9 @@ func (k *KeyVaultCertificateProperties) UnmarshalJSON(data []byte) error { case "activateDate": err = unpopulate(val, "ActivateDate", &k.ActivateDate) delete(rawMsg, key) + case "autoSync": + err = unpopulate(val, "AutoSync", &k.AutoSync) + delete(rawMsg, key) case "certVersion": err = unpopulate(val, "CertVersion", &k.CertVersion) delete(rawMsg, key) @@ -5584,6 +6371,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) @@ -7484,6 +8298,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) } @@ -7497,6 +8312,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) @@ -7757,6 +8575,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) @@ -7893,6 +8769,72 @@ func (s *SupportedRuntimeVersion) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SupportedServerVersion. +func (s SupportedServerVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "server", s.Server) + populate(objectMap, "value", s.Value) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SupportedServerVersion. +func (s *SupportedServerVersion) UnmarshalJSON(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 "server": + err = unpopulate(val, "Server", &s.Server) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + 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 SupportedServerVersions. +func (s SupportedServerVersions) 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 SupportedServerVersions. +func (s *SupportedServerVersions) UnmarshalJSON(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 SupportedStackResource. func (s SupportedStackResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -8228,6 +9170,11 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { func (t TriggeredBuildResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", t.ID) + populate(objectMap, "image", t.Image) + populate(objectMap, "lastTransitionReason", t.LastTransitionReason) + populate(objectMap, "lastTransitionStatus", t.LastTransitionStatus) + populateDateTimeRFC3339(objectMap, "lastTransitionTime", t.LastTransitionTime) + populate(objectMap, "provisioningState", t.ProvisioningState) return json.Marshal(objectMap) } @@ -8243,6 +9190,21 @@ func (t *TriggeredBuildResult) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) + case "image": + err = unpopulate(val, "Image", &t.Image) + delete(rawMsg, key) + case "lastTransitionReason": + err = unpopulate(val, "LastTransitionReason", &t.LastTransitionReason) + delete(rawMsg, key) + case "lastTransitionStatus": + err = unpopulate(val, "LastTransitionStatus", &t.LastTransitionStatus) + delete(rawMsg, key) + case "lastTransitionTime": + err = unpopulateDateTimeRFC3339(val, "LastTransitionTime", &t.LastTransitionTime) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &t.ProvisioningState) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -8379,6 +9341,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, "duration", w.Duration) + 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 "duration": + err = unpopulate(val, "Duration", &w.Duration) + 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 d15fd5ee6e77..f14bfa712aea 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go @@ -47,7 +47,7 @@ func NewMonitoringSettingsClient(subscriptionID string, credential azcore.TokenC // Get - Get the Monitoring Setting and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -94,7 +94,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -112,7 +112,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that 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 +139,7 @@ func (client *MonitoringSettingsClient) BeginUpdatePatch(ctx context.Context, re // UpdatePatch - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *MonitoringSettingsClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, monitoringSettingResource MonitoringSettingResource, options *MonitoringSettingsClientBeginUpdatePatchOptions) (*http.Response, error) { var err error const operationName = "MonitoringSettingsClient.BeginUpdatePatch" @@ -181,7 +181,7 @@ func (client *MonitoringSettingsClient) updatePatchCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, monitoringSettingResource); err != nil { @@ -193,7 +193,7 @@ func (client *MonitoringSettingsClient) updatePatchCreateRequest(ctx context.Con // BeginUpdatePut - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that 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,7 +220,7 @@ func (client *MonitoringSettingsClient) BeginUpdatePut(ctx context.Context, reso // UpdatePut - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *MonitoringSettingsClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, monitoringSettingResource MonitoringSettingResource, options *MonitoringSettingsClientBeginUpdatePutOptions) (*http.Response, error) { var err error const operationName = "MonitoringSettingsClient.BeginUpdatePut" @@ -262,7 +262,7 @@ func (client *MonitoringSettingsClient) updatePutCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, monitoringSettingResource); err != 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 3aa7c63e8bd5..c11b32c3956e 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/operations_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/operations_client.go @@ -39,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 2024-01-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]{ @@ -72,7 +72,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", "2024-01-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 index a8e4e7530ca7..7f40fad94ae3 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/options.go +++ b/sdk/resourcemanager/appplatform/armappplatform/options.go @@ -61,6 +61,33 @@ 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 { @@ -233,6 +260,20 @@ type BuildServiceBuilderClientListOptions struct { // placeholder for future optional parameters } +// BuildServiceClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildServiceClient.BeginCreateOrUpdate +// method. +type BuildServiceClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BuildServiceClientBeginDeleteBuildOptions contains the optional parameters for the BuildServiceClient.BeginDeleteBuild +// method. +type BuildServiceClientBeginDeleteBuildOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // BuildServiceClientCreateOrUpdateBuildOptions contains the optional parameters for the BuildServiceClient.CreateOrUpdateBuild // method. type BuildServiceClientCreateOrUpdateBuildOptions struct { @@ -404,6 +445,13 @@ type ConfigurationServicesClientBeginValidateOptions struct { 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 @@ -415,6 +463,37 @@ 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 { @@ -568,12 +647,18 @@ type DeploymentsClientGetRemoteDebuggingConfigOptions struct { // DeploymentsClientListForClusterOptions contains the optional parameters for the DeploymentsClient.NewListForClusterPager // method. type DeploymentsClientListForClusterOptions struct { + // The expand expression to apply on the operation. + Expand *string + // Version of the deployments to be listed Version []string } // DeploymentsClientListOptions contains the optional parameters for the DeploymentsClient.NewListPager method. type DeploymentsClientListOptions struct { + // The expand expression to apply on the operation. + Expand *string + // Version of the deployments to be listed Version []string } @@ -601,6 +686,29 @@ 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 { @@ -662,6 +770,12 @@ type GatewaysClientBeginDeleteOptions struct { ResumeToken string } +// GatewaysClientBeginRestartOptions contains the optional parameters for the GatewaysClient.BeginRestart method. +type GatewaysClientBeginRestartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // GatewaysClientBeginUpdateCapacityOptions contains the optional parameters for the GatewaysClient.BeginUpdateCapacity method. type GatewaysClientBeginUpdateCapacityOptions struct { // Resumes the LRO from the provided token. @@ -784,6 +898,27 @@ type ServicesClientBeginDeleteOptions struct { ResumeToken string } +// ServicesClientBeginDisableApmGloballyOptions contains the optional parameters for the ServicesClient.BeginDisableApmGlobally +// method. +type ServicesClientBeginDisableApmGloballyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientBeginEnableApmGloballyOptions contains the optional parameters for the ServicesClient.BeginEnableApmGlobally +// method. +type ServicesClientBeginEnableApmGloballyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// 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. @@ -829,11 +964,29 @@ 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 +} + +// ServicesClientListSupportedServerVersionsOptions contains the optional parameters for the ServicesClient.NewListSupportedServerVersionsPager +// method. +type ServicesClientListSupportedServerVersionsOptions struct { + // placeholder for future optional parameters +} + // ServicesClientListTestKeysOptions contains the optional parameters for the ServicesClient.ListTestKeys method. type ServicesClientListTestKeysOptions 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 5e6defeeff77..da32d7396652 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go +++ b/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go @@ -58,6 +58,27 @@ func unmarshalCertificatePropertiesClassification(rawMsg json.RawMessage) (Certi 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) { if rawMsg == nil { return nil, nil @@ -79,6 +100,50 @@ func unmarshalCustomPersistentDiskPropertiesClassification(rawMsg json.RawMessag return b, nil } +func unmarshalGatewayResponseCachePropertiesClassification(rawMsg json.RawMessage) (GatewayResponseCachePropertiesClassification, 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 GatewayResponseCachePropertiesClassification + switch m["responseCacheType"] { + case "LocalCachePerInstance": + b = &GatewayLocalResponseCachePerInstanceProperties{} + case "LocalCachePerRoute": + b = &GatewayLocalResponseCachePerRouteProperties{} + default: + b = &GatewayResponseCacheProperties{} + } + 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) { if rawMsg == nil { return nil, nil @@ -147,6 +212,8 @@ func unmarshalUserSourceInfoClassification(rawMsg json.RawMessage) (UserSourceIn b = &SourceUploadedUserSourceInfo{} case "UploadedUserSourceInfo": b = &UploadedUserSourceInfo{} + case "War": + b = &WarUploadedUserSourceInfo{} default: b = &UserSourceInfo{} } diff --git a/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go b/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go index a806a7f87f4b..c4c921608d44 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -75,7 +75,7 @@ func (client *PredefinedAcceleratorsClient) BeginDisable(ctx context.Context, re // Disable - Disable predefined accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "PredefinedAcceleratorsClient.BeginDisable" @@ -125,7 +125,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -134,7 +134,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -162,7 +162,7 @@ func (client *PredefinedAcceleratorsClient) BeginEnable(ctx context.Context, res // Enable - Enable predefined accelerator. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "PredefinedAcceleratorsClient.BeginEnable" @@ -212,7 +212,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -221,7 +221,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -279,7 +279,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -296,7 +296,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -350,7 +350,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", "2024-01-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 58a78847cd75..451e85ecd2cd 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/response_types.go +++ b/sdk/resourcemanager/appplatform/armappplatform/response_types.go @@ -60,6 +60,35 @@ type APIPortalsClientValidateDomainResponse struct { 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 @@ -235,6 +264,17 @@ type BuildServiceClientCreateOrUpdateBuildResponse struct { 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 @@ -406,12 +446,47 @@ type ConfigurationServicesClientListResponse struct { 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. @@ -581,6 +656,30 @@ type DevToolPortalsClientListResponse struct { 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 @@ -656,6 +755,11 @@ type GatewaysClientListResponse struct { GatewayResourceCollection } +// GatewaysClientRestartResponse contains the response from method GatewaysClient.BeginRestart. +type GatewaysClientRestartResponse struct { + // placeholder for future response values +} + // GatewaysClientUpdateCapacityResponse contains the response from method GatewaysClient.BeginUpdateCapacity. type GatewaysClientUpdateCapacityResponse struct { // Spring Cloud Gateway resource @@ -764,17 +868,32 @@ 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 @@ -787,12 +906,30 @@ type ServicesClientListBySubscriptionResponse struct { 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 +} + +// ServicesClientListSupportedServerVersionsResponse contains the response from method ServicesClient.NewListSupportedServerVersionsPager. +type ServicesClientListSupportedServerVersionsResponse struct { + // Supported server versions. + SupportedServerVersions +} + // ServicesClientListTestKeysResponse contains the response from method ServicesClient.ListTestKeys. type ServicesClientListTestKeysResponse struct { // Test keys payload diff --git a/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go b/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go index 12f1dca4d360..e7153d2ada29 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go @@ -40,7 +40,7 @@ func NewRuntimeVersionsClient(credential azcore.TokenCredential, options *arm.Cl // ListRuntimeVersions - Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - options - RuntimeVersionsClientListRuntimeVersionsOptions contains the optional parameters for the RuntimeVersionsClient.ListRuntimeVersions // method. func (client *RuntimeVersionsClient) ListRuntimeVersions(ctx context.Context, options *RuntimeVersionsClientListRuntimeVersionsOptions) (RuntimeVersionsClientListRuntimeVersionsResponse, error) { @@ -73,7 +73,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", "2024-01-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 3e6362a251cb..e0de5364f9cb 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -74,7 +74,7 @@ func (client *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 2024-01-01-preview func (client *ServiceRegistriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, serviceRegistryName string, options *ServiceRegistriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServiceRegistriesClient.BeginCreateOrUpdate" @@ -120,7 +120,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -129,7 +129,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -156,7 +156,7 @@ func (client *ServiceRegistriesClient) BeginDelete(ctx context.Context, resource // Delete - Disable the default Service Registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *ServiceRegistriesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, serviceRegistryName string, options *ServiceRegistriesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServiceRegistriesClient.BeginDelete" @@ -202,7 +202,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,7 @@ func (client *ServiceRegistriesClient) deleteCreateRequest(ctx context.Context, // Get - Get the Service Registry and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -263,7 +263,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -329,7 +329,7 @@ func (client *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", "2024-01-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 c6d217f43f02..da4e805f4a15 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/services_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/services_client.go @@ -47,7 +47,7 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Checks that the resource name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - location - the region // - availabilityParameters - Parameters supplied to the operation. // - options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability @@ -90,7 +90,7 @@ func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, availabilityParameters); err != nil { @@ -111,7 +111,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that 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 +138,7 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a new Service or update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, resource ServiceResource, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginCreateOrUpdate" @@ -180,7 +180,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -192,7 +192,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Operation to delete a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -217,7 +217,7 @@ func (client *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 2024-01-01-preview func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginDelete" @@ -259,16 +259,98 @@ 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServicesClientDisableApmGloballyResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// DisableApmGlobally - Disable an APM globally. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ServicesClient) disableApmGlobally(ctx context.Context, resourceGroupName string, serviceName string, apm ApmReference, options *ServicesClientBeginDisableApmGloballyOptions) (*http.Response, error) { + var err error + const operationName = "ServicesClient.BeginDisableApmGlobally" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + 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", "2024-01-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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -315,16 +397,98 @@ 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServicesClientEnableApmGloballyResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// EnableApmGlobally - Enable an APM globally. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01-preview +func (client *ServicesClient) enableApmGlobally(ctx context.Context, resourceGroupName string, serviceName string, apm ApmReference, options *ServicesClientBeginEnableApmGloballyOptions) (*http.Response, error) { + var err error + const operationName = "ServicesClient.BeginEnableApmGlobally" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + 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", "2024-01-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 2024-01-01-preview // - resourceGroupName - The name of the resource group that 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 +536,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,10 +551,88 @@ 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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServicesClientFlushVnetDNSSettingResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// 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 2024-01-01-preview +func (client *ServicesClient) flushVnetDNSSetting(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginFlushVnetDNSSettingOptions) (*http.Response, error) { + var err error + const operationName = "ServicesClient.BeginFlushVnetDNSSetting" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + 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", "2024-01-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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -437,7 +679,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -454,7 +696,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 2024-01-01-preview // - resourceGroupName - 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. @@ -497,7 +739,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -514,7 +756,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 2024-01-01-preview // - options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager // method. func (client *ServicesClient) NewListBySubscriptionPager(options *ServicesClientListBySubscriptionOptions) *runtime.Pager[ServicesClientListBySubscriptionResponse] { @@ -552,7 +794,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -567,10 +809,208 @@ 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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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 + const operationName = "ServicesClient.ListGloballyEnabledApms" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + 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", "2024-01-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 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServicesClient.NewListSupportedApmTypesPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listSupportedApmTypesCreateRequest(ctx, resourceGroupName, serviceName, options) + }, nil) + if err != nil { + return ServicesClientListSupportedApmTypesResponse{}, err + } + return client.listSupportedApmTypesHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// 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", "2024-01-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 +} + +// NewListSupportedServerVersionsPager - Lists all of the available server versions supported by Microsoft.AppPlatform provider. +// +// Generated from API version 2024-01-01-preview +// - resourceGroupName - The name of the resource group that 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 - ServicesClientListSupportedServerVersionsOptions contains the optional parameters for the ServicesClient.NewListSupportedServerVersionsPager +// method. +func (client *ServicesClient) NewListSupportedServerVersionsPager(resourceGroupName string, serviceName string, options *ServicesClientListSupportedServerVersionsOptions) *runtime.Pager[ServicesClientListSupportedServerVersionsResponse] { + return runtime.NewPager(runtime.PagingHandler[ServicesClientListSupportedServerVersionsResponse]{ + More: func(page ServicesClientListSupportedServerVersionsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServicesClientListSupportedServerVersionsResponse) (ServicesClientListSupportedServerVersionsResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ServicesClient.NewListSupportedServerVersionsPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listSupportedServerVersionsCreateRequest(ctx, resourceGroupName, serviceName, options) + }, nil) + if err != nil { + return ServicesClientListSupportedServerVersionsResponse{}, err + } + return client.listSupportedServerVersionsHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listSupportedServerVersionsCreateRequest creates the ListSupportedServerVersions request. +func (client *ServicesClient) listSupportedServerVersionsCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientListSupportedServerVersionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/supportedServerVersions" + 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", "2024-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSupportedServerVersionsHandleResponse handles the ListSupportedServerVersions response. +func (client *ServicesClient) listSupportedServerVersionsHandleResponse(resp *http.Response) (ServicesClientListSupportedServerVersionsResponse, error) { + result := ServicesClientListSupportedServerVersionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SupportedServerVersions); err != nil { + return ServicesClientListSupportedServerVersionsResponse{}, 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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -617,7 +1057,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -635,7 +1075,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -684,7 +1124,7 @@ func (client *ServicesClient) regenerateTestKeyCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, regenerateTestKeyRequest); err != nil { @@ -705,7 +1145,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -730,7 +1170,7 @@ func (client *ServicesClient) BeginStart(ctx context.Context, resourceGroupName // Start - Start a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *ServicesClient) start(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginStart" @@ -772,7 +1212,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -781,7 +1221,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -806,7 +1246,7 @@ func (client *ServicesClient) BeginStop(ctx context.Context, resourceGroupName s // Stop - Stop a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *ServicesClient) stop(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginStop" @@ -848,7 +1288,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -857,7 +1297,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -883,7 +1323,7 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Operation to update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *ServicesClient) update(ctx context.Context, resourceGroupName string, serviceName string, resource ServiceResource, options *ServicesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginUpdate" @@ -925,7 +1365,7 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != 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 cce5630ac7c9..5f214b84bd17 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/skus_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/skus_client.go @@ -46,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 2024-01-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]{ @@ -83,7 +83,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", "2024-01-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 f0191626a92f..1da67b72261a 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/storages_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/storages_client.go @@ -47,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -75,7 +75,7 @@ func (client *StoragesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update storage resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-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 const operationName = "StoragesClient.BeginCreateOrUpdate" @@ -121,7 +121,7 @@ func (client *StoragesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-01-01-preview") + reqQP.Set("api-version", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, storageResource); err != nil { @@ -133,7 +133,7 @@ func (client *StoragesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete the storage resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -159,7 +159,7 @@ func (client *StoragesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete the storage resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview func (client *StoragesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "StoragesClient.BeginDelete" @@ -205,7 +205,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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -214,7 +214,7 @@ func (client *StoragesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the storage resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-01-01-preview +// Generated from API version 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -266,7 +266,7 @@ func (client *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", "2024-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,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 2024-01-01-preview // - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // - serviceName - The name of the Service resource. @@ -331,7 +331,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", "2024-01-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"), - // }, - // }}, - // } - } -}