diff --git a/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md b/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md index a3b5bb71e864..79bfba8a6bbe 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md +++ b/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md @@ -1,5 +1,246 @@ # Release History +## 2.0.0-beta.1 (2023-04-28) +### Breaking Changes + +- Type of `AppResourceProperties.AddonConfigs` has been changed from `map[string]map[string]any` to `map[string]any` +- Type of `BindingResourceProperties.BindingParameters` has been changed from `map[string]any` to `map[string]*string` +- Type of `DeploymentSettings.AddonConfigs` has been changed from `map[string]map[string]any` to `map[string]any` + +### Features Added + +- New value `BindingTypeCACertificates` added to enum type `BindingType` +- New enum type `APIPortalProvisioningState` with values `APIPortalProvisioningStateCreating`, `APIPortalProvisioningStateDeleting`, `APIPortalProvisioningStateFailed`, `APIPortalProvisioningStateSucceeded`, `APIPortalProvisioningStateUpdating` +- New enum type `ApmType` with values `ApmTypeAppDynamics`, `ApmTypeApplicationInsights`, `ApmTypeDynatrace`, `ApmTypeElasticAPM`, `ApmTypeNewRelic` +- New enum type `ApplicationAcceleratorProvisioningState` with values `ApplicationAcceleratorProvisioningStateCreating`, `ApplicationAcceleratorProvisioningStateDeleting`, `ApplicationAcceleratorProvisioningStateFailed`, `ApplicationAcceleratorProvisioningStateSucceeded`, `ApplicationAcceleratorProvisioningStateUpdating` +- New enum type `ApplicationLiveViewProvisioningState` with values `ApplicationLiveViewProvisioningStateCanceled`, `ApplicationLiveViewProvisioningStateCreating`, `ApplicationLiveViewProvisioningStateDeleting`, `ApplicationLiveViewProvisioningStateFailed`, `ApplicationLiveViewProvisioningStateSucceeded`, `ApplicationLiveViewProvisioningStateUpdating` +- New enum type `BackendProtocol` with values `BackendProtocolDefault`, `BackendProtocolGRPC` +- New enum type `CertificateResourceProvisioningState` with values `CertificateResourceProvisioningStateCreating`, `CertificateResourceProvisioningStateDeleting`, `CertificateResourceProvisioningStateFailed`, `CertificateResourceProvisioningStateSucceeded`, `CertificateResourceProvisioningStateUpdating` +- New enum type `CustomDomainResourceProvisioningState` with values `CustomDomainResourceProvisioningStateCreating`, `CustomDomainResourceProvisioningStateDeleting`, `CustomDomainResourceProvisioningStateFailed`, `CustomDomainResourceProvisioningStateSucceeded`, `CustomDomainResourceProvisioningStateUpdating` +- New enum type `CustomizedAcceleratorProvisioningState` with values `CustomizedAcceleratorProvisioningStateCreating`, `CustomizedAcceleratorProvisioningStateDeleting`, `CustomizedAcceleratorProvisioningStateFailed`, `CustomizedAcceleratorProvisioningStateSucceeded`, `CustomizedAcceleratorProvisioningStateUpdating` +- New enum type `CustomizedAcceleratorValidateResultState` with values `CustomizedAcceleratorValidateResultStateInvalid`, `CustomizedAcceleratorValidateResultStateValid` +- New enum type `DevToolPortalFeatureState` with values `DevToolPortalFeatureStateDisabled`, `DevToolPortalFeatureStateEnabled` +- New enum type `DevToolPortalProvisioningState` with values `DevToolPortalProvisioningStateCanceled`, `DevToolPortalProvisioningStateCreating`, `DevToolPortalProvisioningStateDeleting`, `DevToolPortalProvisioningStateFailed`, `DevToolPortalProvisioningStateSucceeded`, `DevToolPortalProvisioningStateUpdating` +- New enum type `GatewayProvisioningState` with values `GatewayProvisioningStateCreating`, `GatewayProvisioningStateDeleting`, `GatewayProvisioningStateFailed`, `GatewayProvisioningStateSucceeded`, `GatewayProvisioningStateUpdating` +- New enum type `GatewayRouteConfigProtocol` with values `GatewayRouteConfigProtocolHTTP`, `GatewayRouteConfigProtocolHTTPS` +- New enum type `HTTPSchemeType` with values `HTTPSchemeTypeHTTP`, `HTTPSchemeTypeHTTPS` +- New enum type `PowerState` with values `PowerStateRunning`, `PowerStateStopped` +- New enum type `PredefinedAcceleratorProvisioningState` with values `PredefinedAcceleratorProvisioningStateCreating`, `PredefinedAcceleratorProvisioningStateFailed`, `PredefinedAcceleratorProvisioningStateSucceeded`, `PredefinedAcceleratorProvisioningStateUpdating` +- New enum type `PredefinedAcceleratorState` with values `PredefinedAcceleratorStateDisabled`, `PredefinedAcceleratorStateEnabled` +- New enum type `ProbeActionType` with values `ProbeActionTypeExecAction`, `ProbeActionTypeHTTPGetAction`, `ProbeActionTypeTCPSocketAction` +- New enum type `SessionAffinity` with values `SessionAffinityCookie`, `SessionAffinityNone` +- New enum type `StorageType` with values `StorageTypeStorageAccount` +- New enum type `Type` with values `TypeAzureFileVolume` +- New function `NewAPIPortalCustomDomainsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APIPortalCustomDomainsClient, error)` +- New function `*APIPortalCustomDomainsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, APIPortalCustomDomainResource, *APIPortalCustomDomainsClientBeginCreateOrUpdateOptions) (*runtime.Poller[APIPortalCustomDomainsClientCreateOrUpdateResponse], error)` +- New function `*APIPortalCustomDomainsClient.BeginDelete(context.Context, string, string, string, string, *APIPortalCustomDomainsClientBeginDeleteOptions) (*runtime.Poller[APIPortalCustomDomainsClientDeleteResponse], error)` +- New function `*APIPortalCustomDomainsClient.Get(context.Context, string, string, string, string, *APIPortalCustomDomainsClientGetOptions) (APIPortalCustomDomainsClientGetResponse, error)` +- New function `*APIPortalCustomDomainsClient.NewListPager(string, string, string, *APIPortalCustomDomainsClientListOptions) *runtime.Pager[APIPortalCustomDomainsClientListResponse]` +- New function `NewAPIPortalsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APIPortalsClient, error)` +- New function `*APIPortalsClient.BeginCreateOrUpdate(context.Context, string, string, string, APIPortalResource, *APIPortalsClientBeginCreateOrUpdateOptions) (*runtime.Poller[APIPortalsClientCreateOrUpdateResponse], error)` +- New function `*APIPortalsClient.BeginDelete(context.Context, string, string, string, *APIPortalsClientBeginDeleteOptions) (*runtime.Poller[APIPortalsClientDeleteResponse], error)` +- New function `*APIPortalsClient.Get(context.Context, string, string, string, *APIPortalsClientGetOptions) (APIPortalsClientGetResponse, error)` +- New function `*APIPortalsClient.NewListPager(string, string, *APIPortalsClientListOptions) *runtime.Pager[APIPortalsClientListResponse]` +- New function `*APIPortalsClient.ValidateDomain(context.Context, string, string, string, CustomDomainValidatePayload, *APIPortalsClientValidateDomainOptions) (APIPortalsClientValidateDomainResponse, error)` +- New function `*AcceleratorAuthSetting.GetAcceleratorAuthSetting() *AcceleratorAuthSetting` +- New function `*AcceleratorBasicAuthSetting.GetAcceleratorAuthSetting() *AcceleratorAuthSetting` +- New function `*AcceleratorPublicSetting.GetAcceleratorAuthSetting() *AcceleratorAuthSetting` +- New function `*AcceleratorSSHSetting.GetAcceleratorAuthSetting() *AcceleratorAuthSetting` +- New function `NewApplicationAcceleratorsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ApplicationAcceleratorsClient, error)` +- New function `*ApplicationAcceleratorsClient.BeginCreateOrUpdate(context.Context, string, string, string, ApplicationAcceleratorResource, *ApplicationAcceleratorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ApplicationAcceleratorsClientCreateOrUpdateResponse], error)` +- New function `*ApplicationAcceleratorsClient.BeginDelete(context.Context, string, string, string, *ApplicationAcceleratorsClientBeginDeleteOptions) (*runtime.Poller[ApplicationAcceleratorsClientDeleteResponse], error)` +- New function `*ApplicationAcceleratorsClient.Get(context.Context, string, string, string, *ApplicationAcceleratorsClientGetOptions) (ApplicationAcceleratorsClientGetResponse, error)` +- New function `*ApplicationAcceleratorsClient.NewListPager(string, string, *ApplicationAcceleratorsClientListOptions) *runtime.Pager[ApplicationAcceleratorsClientListResponse]` +- New function `NewApplicationLiveViewsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ApplicationLiveViewsClient, error)` +- New function `*ApplicationLiveViewsClient.BeginCreateOrUpdate(context.Context, string, string, string, ApplicationLiveViewResource, *ApplicationLiveViewsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ApplicationLiveViewsClientCreateOrUpdateResponse], error)` +- New function `*ApplicationLiveViewsClient.BeginDelete(context.Context, string, string, string, *ApplicationLiveViewsClientBeginDeleteOptions) (*runtime.Poller[ApplicationLiveViewsClientDeleteResponse], error)` +- New function `*ApplicationLiveViewsClient.Get(context.Context, string, string, string, *ApplicationLiveViewsClientGetOptions) (ApplicationLiveViewsClientGetResponse, error)` +- New function `*ApplicationLiveViewsClient.NewListPager(string, string, *ApplicationLiveViewsClientListOptions) *runtime.Pager[ApplicationLiveViewsClientListResponse]` +- New function `*AzureFileVolume.GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties` +- New function `*BuildServiceBuilderClient.ListDeployments(context.Context, string, string, string, string, *BuildServiceBuilderClientListDeploymentsOptions) (BuildServiceBuilderClientListDeploymentsResponse, error)` +- New function `*BuildpackBindingClient.NewListForClusterPager(string, string, *BuildpackBindingClientListForClusterOptions) *runtime.Pager[BuildpackBindingClientListForClusterResponse]` +- New function `*ClientFactory.NewAPIPortalCustomDomainsClient() *APIPortalCustomDomainsClient` +- New function `*ClientFactory.NewAPIPortalsClient() *APIPortalsClient` +- New function `*ClientFactory.NewApplicationAcceleratorsClient() *ApplicationAcceleratorsClient` +- New function `*ClientFactory.NewApplicationLiveViewsClient() *ApplicationLiveViewsClient` +- New function `*ClientFactory.NewCustomizedAcceleratorsClient() *CustomizedAcceleratorsClient` +- New function `*ClientFactory.NewDevToolPortalsClient() *DevToolPortalsClient` +- New function `*ClientFactory.NewGatewayCustomDomainsClient() *GatewayCustomDomainsClient` +- New function `*ClientFactory.NewGatewayRouteConfigsClient() *GatewayRouteConfigsClient` +- New function `*ClientFactory.NewGatewaysClient() *GatewaysClient` +- New function `*ClientFactory.NewPredefinedAcceleratorsClient() *PredefinedAcceleratorsClient` +- New function `*ClientFactory.NewStoragesClient() *StoragesClient` +- New function `*CustomContainerUserSourceInfo.GetUserSourceInfo() *UserSourceInfo` +- New function `*CustomPersistentDiskProperties.GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties` +- New function `NewCustomizedAcceleratorsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*CustomizedAcceleratorsClient, error)` +- New function `*CustomizedAcceleratorsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, CustomizedAcceleratorResource, *CustomizedAcceleratorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[CustomizedAcceleratorsClientCreateOrUpdateResponse], error)` +- New function `*CustomizedAcceleratorsClient.BeginDelete(context.Context, string, string, string, string, *CustomizedAcceleratorsClientBeginDeleteOptions) (*runtime.Poller[CustomizedAcceleratorsClientDeleteResponse], error)` +- New function `*CustomizedAcceleratorsClient.Get(context.Context, string, string, string, string, *CustomizedAcceleratorsClientGetOptions) (CustomizedAcceleratorsClientGetResponse, error)` +- New function `*CustomizedAcceleratorsClient.NewListPager(string, string, string, *CustomizedAcceleratorsClientListOptions) *runtime.Pager[CustomizedAcceleratorsClientListResponse]` +- New function `*CustomizedAcceleratorsClient.Validate(context.Context, string, string, string, string, CustomizedAcceleratorProperties, *CustomizedAcceleratorsClientValidateOptions) (CustomizedAcceleratorsClientValidateResponse, error)` +- New function `*DeploymentsClient.BeginDisableRemoteDebugging(context.Context, string, string, string, string, *DeploymentsClientBeginDisableRemoteDebuggingOptions) (*runtime.Poller[DeploymentsClientDisableRemoteDebuggingResponse], error)` +- New function `*DeploymentsClient.BeginEnableRemoteDebugging(context.Context, string, string, string, string, *DeploymentsClientBeginEnableRemoteDebuggingOptions) (*runtime.Poller[DeploymentsClientEnableRemoteDebuggingResponse], error)` +- New function `*DeploymentsClient.GetRemoteDebuggingConfig(context.Context, string, string, string, string, *DeploymentsClientGetRemoteDebuggingConfigOptions) (DeploymentsClientGetRemoteDebuggingConfigResponse, error)` +- New function `NewDevToolPortalsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DevToolPortalsClient, error)` +- New function `*DevToolPortalsClient.BeginCreateOrUpdate(context.Context, string, string, string, DevToolPortalResource, *DevToolPortalsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DevToolPortalsClientCreateOrUpdateResponse], error)` +- New function `*DevToolPortalsClient.BeginDelete(context.Context, string, string, string, *DevToolPortalsClientBeginDeleteOptions) (*runtime.Poller[DevToolPortalsClientDeleteResponse], error)` +- New function `*DevToolPortalsClient.Get(context.Context, string, string, string, *DevToolPortalsClientGetOptions) (DevToolPortalsClientGetResponse, error)` +- New function `*DevToolPortalsClient.NewListPager(string, string, *DevToolPortalsClientListOptions) *runtime.Pager[DevToolPortalsClientListResponse]` +- New function `*ExecAction.GetProbeAction() *ProbeAction` +- New function `NewGatewayCustomDomainsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GatewayCustomDomainsClient, error)` +- New function `*GatewayCustomDomainsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, GatewayCustomDomainResource, *GatewayCustomDomainsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewayCustomDomainsClientCreateOrUpdateResponse], error)` +- New function `*GatewayCustomDomainsClient.BeginDelete(context.Context, string, string, string, string, *GatewayCustomDomainsClientBeginDeleteOptions) (*runtime.Poller[GatewayCustomDomainsClientDeleteResponse], error)` +- New function `*GatewayCustomDomainsClient.Get(context.Context, string, string, string, string, *GatewayCustomDomainsClientGetOptions) (GatewayCustomDomainsClientGetResponse, error)` +- New function `*GatewayCustomDomainsClient.NewListPager(string, string, string, *GatewayCustomDomainsClientListOptions) *runtime.Pager[GatewayCustomDomainsClientListResponse]` +- New function `NewGatewayRouteConfigsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GatewayRouteConfigsClient, error)` +- New function `*GatewayRouteConfigsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, GatewayRouteConfigResource, *GatewayRouteConfigsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewayRouteConfigsClientCreateOrUpdateResponse], error)` +- New function `*GatewayRouteConfigsClient.BeginDelete(context.Context, string, string, string, string, *GatewayRouteConfigsClientBeginDeleteOptions) (*runtime.Poller[GatewayRouteConfigsClientDeleteResponse], error)` +- New function `*GatewayRouteConfigsClient.Get(context.Context, string, string, string, string, *GatewayRouteConfigsClientGetOptions) (GatewayRouteConfigsClientGetResponse, error)` +- New function `*GatewayRouteConfigsClient.NewListPager(string, string, string, *GatewayRouteConfigsClientListOptions) *runtime.Pager[GatewayRouteConfigsClientListResponse]` +- New function `NewGatewaysClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GatewaysClient, error)` +- New function `*GatewaysClient.BeginCreateOrUpdate(context.Context, string, string, string, GatewayResource, *GatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewaysClientCreateOrUpdateResponse], error)` +- New function `*GatewaysClient.BeginDelete(context.Context, string, string, string, *GatewaysClientBeginDeleteOptions) (*runtime.Poller[GatewaysClientDeleteResponse], error)` +- New function `*GatewaysClient.Get(context.Context, string, string, string, *GatewaysClientGetOptions) (GatewaysClientGetResponse, error)` +- New function `*GatewaysClient.ListEnvSecrets(context.Context, string, string, string, *GatewaysClientListEnvSecretsOptions) (GatewaysClientListEnvSecretsResponse, error)` +- New function `*GatewaysClient.NewListPager(string, string, *GatewaysClientListOptions) *runtime.Pager[GatewaysClientListResponse]` +- New function `*GatewaysClient.BeginUpdateCapacity(context.Context, string, string, string, SKUObject, *GatewaysClientBeginUpdateCapacityOptions) (*runtime.Poller[GatewaysClientUpdateCapacityResponse], error)` +- New function `*GatewaysClient.ValidateDomain(context.Context, string, string, string, CustomDomainValidatePayload, *GatewaysClientValidateDomainOptions) (GatewaysClientValidateDomainResponse, error)` +- New function `*HTTPGetAction.GetProbeAction() *ProbeAction` +- New function `NewPredefinedAcceleratorsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PredefinedAcceleratorsClient, error)` +- New function `*PredefinedAcceleratorsClient.BeginDisable(context.Context, string, string, string, string, *PredefinedAcceleratorsClientBeginDisableOptions) (*runtime.Poller[PredefinedAcceleratorsClientDisableResponse], error)` +- New function `*PredefinedAcceleratorsClient.BeginEnable(context.Context, string, string, string, string, *PredefinedAcceleratorsClientBeginEnableOptions) (*runtime.Poller[PredefinedAcceleratorsClientEnableResponse], error)` +- New function `*PredefinedAcceleratorsClient.Get(context.Context, string, string, string, string, *PredefinedAcceleratorsClientGetOptions) (PredefinedAcceleratorsClientGetResponse, error)` +- New function `*PredefinedAcceleratorsClient.NewListPager(string, string, string, *PredefinedAcceleratorsClientListOptions) *runtime.Pager[PredefinedAcceleratorsClientListResponse]` +- New function `*ProbeAction.GetProbeAction() *ProbeAction` +- New function `*ServicesClient.BeginStart(context.Context, string, string, *ServicesClientBeginStartOptions) (*runtime.Poller[ServicesClientStartResponse], error)` +- New function `*ServicesClient.BeginStop(context.Context, string, string, *ServicesClientBeginStopOptions) (*runtime.Poller[ServicesClientStopResponse], error)` +- New function `*StorageAccount.GetStorageProperties() *StorageProperties` +- New function `*StorageProperties.GetStorageProperties() *StorageProperties` +- New function `NewStoragesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*StoragesClient, error)` +- New function `*StoragesClient.BeginCreateOrUpdate(context.Context, string, string, string, StorageResource, *StoragesClientBeginCreateOrUpdateOptions) (*runtime.Poller[StoragesClientCreateOrUpdateResponse], error)` +- New function `*StoragesClient.BeginDelete(context.Context, string, string, string, *StoragesClientBeginDeleteOptions) (*runtime.Poller[StoragesClientDeleteResponse], error)` +- New function `*StoragesClient.Get(context.Context, string, string, string, *StoragesClientGetOptions) (StoragesClientGetResponse, error)` +- New function `*StoragesClient.NewListPager(string, string, *StoragesClientListOptions) *runtime.Pager[StoragesClientListResponse]` +- New function `*TCPSocketAction.GetProbeAction() *ProbeAction` +- New struct `APIPortalCustomDomainProperties` +- New struct `APIPortalCustomDomainResource` +- New struct `APIPortalCustomDomainResourceCollection` +- New struct `APIPortalInstance` +- New struct `APIPortalProperties` +- New struct `APIPortalResource` +- New struct `APIPortalResourceCollection` +- New struct `APIPortalResourceRequests` +- New struct `AcceleratorBasicAuthSetting` +- New struct `AcceleratorGitRepository` +- New struct `AcceleratorPublicSetting` +- New struct `AcceleratorSSHSetting` +- New struct `AppVNetAddons` +- New struct `ApplicationAcceleratorComponent` +- New struct `ApplicationAcceleratorInstance` +- New struct `ApplicationAcceleratorProperties` +- New struct `ApplicationAcceleratorResource` +- New struct `ApplicationAcceleratorResourceCollection` +- New struct `ApplicationAcceleratorResourceRequests` +- New struct `ApplicationLiveViewComponent` +- New struct `ApplicationLiveViewInstance` +- New struct `ApplicationLiveViewProperties` +- New struct `ApplicationLiveViewResource` +- New struct `ApplicationLiveViewResourceCollection` +- New struct `ApplicationLiveViewResourceRequests` +- New struct `AzureFileVolume` +- New struct `BuildResourceRequests` +- New struct `ContainerProbeSettings` +- New struct `CustomContainer` +- New struct `CustomContainerUserSourceInfo` +- New struct `CustomPersistentDiskResource` +- New struct `CustomScaleRule` +- New struct `CustomizedAcceleratorProperties` +- New struct `CustomizedAcceleratorResource` +- New struct `CustomizedAcceleratorResourceCollection` +- New struct `CustomizedAcceleratorValidateResult` +- New struct `DeploymentList` +- New struct `DevToolPortalFeatureDetail` +- New struct `DevToolPortalFeatureSettings` +- New struct `DevToolPortalInstance` +- New struct `DevToolPortalProperties` +- New struct `DevToolPortalResource` +- New struct `DevToolPortalResourceCollection` +- New struct `DevToolPortalResourceRequests` +- New struct `DevToolPortalSsoProperties` +- New struct `ExecAction` +- New struct `GatewayAPIMetadataProperties` +- New struct `GatewayAPIRoute` +- New struct `GatewayCorsProperties` +- New struct `GatewayCustomDomainProperties` +- New struct `GatewayCustomDomainResource` +- New struct `GatewayCustomDomainResourceCollection` +- New struct `GatewayInstance` +- New struct `GatewayOperatorProperties` +- New struct `GatewayOperatorResourceRequests` +- New struct `GatewayProperties` +- New struct `GatewayPropertiesEnvironmentVariables` +- New struct `GatewayResource` +- New struct `GatewayResourceCollection` +- New struct `GatewayResourceRequests` +- New struct `GatewayRouteConfigOpenAPIProperties` +- New struct `GatewayRouteConfigProperties` +- New struct `GatewayRouteConfigResource` +- New struct `GatewayRouteConfigResourceCollection` +- New struct `HTTPGetAction` +- New struct `HTTPScaleRule` +- New struct `ImageRegistryCredential` +- New struct `IngressConfig` +- New struct `IngressSettings` +- New struct `IngressSettingsClientAuth` +- New struct `MarketplaceResource` +- New struct `PredefinedAcceleratorProperties` +- New struct `PredefinedAcceleratorResource` +- New struct `PredefinedAcceleratorResourceCollection` +- New struct `Probe` +- New struct `QueueScaleRule` +- New struct `RemoteDebugging` +- New struct `RemoteDebuggingPayload` +- New struct `SKUObject` +- New struct `Scale` +- New struct `ScaleRule` +- New struct `ScaleRuleAuth` +- New struct `Secret` +- New struct `ServiceVNetAddons` +- New struct `SsoProperties` +- New struct `StorageAccount` +- New struct `StorageResource` +- New struct `StorageResourceCollection` +- New struct `TCPScaleRule` +- New struct `TCPSocketAction` +- New struct `UserAssignedManagedIdentity` +- New field `CustomPersistentDisks` in struct `AppResourceProperties` +- New field `IngressSettings` in struct `AppResourceProperties` +- New field `Secrets` in struct `AppResourceProperties` +- New field `VnetAddons` in struct `AppResourceProperties` +- New field `ResourceRequests` in struct `BuildProperties` +- New field `Error` in struct `BuildResultProperties` +- New field `ExitCode` in struct `BuildStageProperties` +- New field `Reason` in struct `BuildStageProperties` +- New field `ProvisioningState` in struct `CertificateProperties` +- New field `InfraResourceGroup` in struct `ClusterResourceProperties` +- New field `ManagedEnvironmentID` in struct `ClusterResourceProperties` +- New field `MarketplaceResource` in struct `ClusterResourceProperties` +- New field `PowerState` in struct `ClusterResourceProperties` +- New field `VnetAddons` in struct `ClusterResourceProperties` +- New field `ProvisioningState` in struct `ContentCertificateProperties` +- New field `ProvisioningState` in struct `CustomDomainProperties` +- New field `ContainerProbeSettings` in struct `DeploymentSettings` +- New field `LivenessProbe` in struct `DeploymentSettings` +- New field `ReadinessProbe` in struct `DeploymentSettings` +- New field `Scale` in struct `DeploymentSettings` +- New field `StartupProbe` in struct `DeploymentSettings` +- New field `TerminationGracePeriodSeconds` in struct `DeploymentSettings` +- New field `ProvisioningState` in struct `KeyVaultCertificateProperties` +- New field `UserAssignedIdentities` in struct `ManagedIdentityProperties` +- New field `IngressConfig` in struct `NetworkProfile` +- New field `OutboundType` in struct `NetworkProfile` + + ## 1.1.0 (2023-04-06) ### Features Added diff --git a/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go new file mode 100644 index 000000000000..f388be7baed0 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client.go @@ -0,0 +1,344 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// APIPortalCustomDomainsClient contains the methods for the APIPortalCustomDomains group. +// Don't use this type directly, use NewAPIPortalCustomDomainsClient() instead. +type APIPortalCustomDomainsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAPIPortalCustomDomainsClient creates a new instance of APIPortalCustomDomainsClient 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 NewAPIPortalCustomDomainsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIPortalCustomDomainsClient, error) { + cl, err := arm.NewClient(moduleName+".APIPortalCustomDomainsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &APIPortalCustomDomainsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - apiPortalName - The name of API portal. +// - domainName - The name of the API portal custom domain. +// - apiPortalCustomDomainResource - The API portal custom domain for the create or update operation +// - options - APIPortalCustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the APIPortalCustomDomainsClient.BeginCreateOrUpdate +// method. +func (client *APIPortalCustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, apiPortalCustomDomainResource APIPortalCustomDomainResource, options *APIPortalCustomDomainsClientBeginCreateOrUpdateOptions) (*runtime.Poller[APIPortalCustomDomainsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[APIPortalCustomDomainsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[APIPortalCustomDomainsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *APIPortalCustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, apiPortalCustomDomainResource APIPortalCustomDomainResource, options *APIPortalCustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *APIPortalCustomDomainsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, apiPortalCustomDomainResource APIPortalCustomDomainResource, options *APIPortalCustomDomainsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" + 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 apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, apiPortalCustomDomainResource) +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - apiPortalName - The name of API portal. +// - domainName - The name of the API portal custom domain. +// - options - APIPortalCustomDomainsClientBeginDeleteOptions contains the optional parameters for the APIPortalCustomDomainsClient.BeginDelete +// method. +func (client *APIPortalCustomDomainsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientBeginDeleteOptions) (*runtime.Poller[APIPortalCustomDomainsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, apiPortalName, domainName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[APIPortalCustomDomainsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[APIPortalCustomDomainsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *APIPortalCustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, domainName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *APIPortalCustomDomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" + 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 apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - apiPortalName - The name of API portal. +// - domainName - The name of the API portal custom domain. +// - options - APIPortalCustomDomainsClientGetOptions contains the optional parameters for the APIPortalCustomDomainsClient.Get +// method. +func (client *APIPortalCustomDomainsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientGetOptions) (APIPortalCustomDomainsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, domainName, options) + if err != nil { + return APIPortalCustomDomainsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APIPortalCustomDomainsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIPortalCustomDomainsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *APIPortalCustomDomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" + 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 apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *APIPortalCustomDomainsClient) getHandleResponse(resp *http.Response) (APIPortalCustomDomainsClientGetResponse, error) { + result := APIPortalCustomDomainsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APIPortalCustomDomainResource); err != nil { + return APIPortalCustomDomainsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handle requests to list all API portal custom domains. +// +// Generated from API version 2023-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. +// - apiPortalName - The name of API portal. +// - options - APIPortalCustomDomainsClientListOptions contains the optional parameters for the APIPortalCustomDomainsClient.NewListPager +// method. +func (client *APIPortalCustomDomainsClient) NewListPager(resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalCustomDomainsClientListOptions) *runtime.Pager[APIPortalCustomDomainsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[APIPortalCustomDomainsClientListResponse]{ + More: func(page APIPortalCustomDomainsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *APIPortalCustomDomainsClientListResponse) (APIPortalCustomDomainsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return APIPortalCustomDomainsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APIPortalCustomDomainsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIPortalCustomDomainsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *APIPortalCustomDomainsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalCustomDomainsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" + 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 apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *APIPortalCustomDomainsClient) listHandleResponse(resp *http.Response) (APIPortalCustomDomainsClientListResponse, error) { + result := APIPortalCustomDomainsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APIPortalCustomDomainResourceCollection); err != nil { + return APIPortalCustomDomainsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client_example_test.go new file mode 100644 index 000000000000..3f2af14c1cb7 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/apiportalcustomdomains_client_example_test.go @@ -0,0 +1,164 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 new file mode 100644 index 000000000000..c2d241cbf658 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/apiportals_client.go @@ -0,0 +1,386 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// APIPortalsClient contains the methods for the APIPortals group. +// Don't use this type directly, use NewAPIPortalsClient() instead. +type APIPortalsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAPIPortalsClient creates a new instance of APIPortalsClient 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 NewAPIPortalsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIPortalsClient, error) { + cl, err := arm.NewClient(moduleName+".APIPortalsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &APIPortalsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - apiPortalName - The name of API portal. +// - apiPortalResource - The API portal for the create or update operation +// - options - APIPortalsClientBeginCreateOrUpdateOptions contains the optional parameters for the APIPortalsClient.BeginCreateOrUpdate +// method. +func (client *APIPortalsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, apiPortalResource APIPortalResource, options *APIPortalsClientBeginCreateOrUpdateOptions) (*runtime.Poller[APIPortalsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, apiPortalName, apiPortalResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[APIPortalsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[APIPortalsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *APIPortalsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, apiPortalResource APIPortalResource, options *APIPortalsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, apiPortalResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *APIPortalsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, apiPortalResource APIPortalResource, options *APIPortalsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" + 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 apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, apiPortalResource) +} + +// BeginDelete - Delete the default API portal. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - apiPortalName - The name of API portal. +// - options - APIPortalsClientBeginDeleteOptions contains the optional parameters for the APIPortalsClient.BeginDelete method. +func (client *APIPortalsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientBeginDeleteOptions) (*runtime.Poller[APIPortalsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, apiPortalName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[APIPortalsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[APIPortalsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete the default API portal. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *APIPortalsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *APIPortalsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" + 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 apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - apiPortalName - The name of API portal. +// - options - APIPortalsClientGetOptions contains the optional parameters for the APIPortalsClient.Get method. +func (client *APIPortalsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientGetOptions) (APIPortalsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, options) + if err != nil { + return APIPortalsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APIPortalsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIPortalsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *APIPortalsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" + 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 apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *APIPortalsClient) getHandleResponse(resp *http.Response) (APIPortalsClientGetResponse, error) { + result := APIPortalsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APIPortalResource); err != nil { + return APIPortalsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handles requests to list all resources in a Service. +// +// Generated from API version 2023-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 - APIPortalsClientListOptions contains the optional parameters for the APIPortalsClient.NewListPager method. +func (client *APIPortalsClient) NewListPager(resourceGroupName string, serviceName string, options *APIPortalsClientListOptions) *runtime.Pager[APIPortalsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[APIPortalsClientListResponse]{ + More: func(page APIPortalsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *APIPortalsClientListResponse) (APIPortalsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return APIPortalsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APIPortalsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIPortalsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *APIPortalsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *APIPortalsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *APIPortalsClient) listHandleResponse(resp *http.Response) (APIPortalsClientListResponse, error) { + result := APIPortalsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APIPortalResourceCollection); err != nil { + return APIPortalsClientListResponse{}, err + } + return result, nil +} + +// ValidateDomain - Check the domains are valid as well as not in use. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - apiPortalName - The name of API portal. +// - validatePayload - Custom domain payload to be validated +// - options - APIPortalsClientValidateDomainOptions contains the optional parameters for the APIPortalsClient.ValidateDomain +// method. +func (client *APIPortalsClient) ValidateDomain(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, validatePayload CustomDomainValidatePayload, options *APIPortalsClientValidateDomainOptions) (APIPortalsClientValidateDomainResponse, error) { + req, err := client.validateDomainCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, validatePayload, options) + if err != nil { + return APIPortalsClientValidateDomainResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APIPortalsClientValidateDomainResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIPortalsClientValidateDomainResponse{}, runtime.NewResponseError(resp) + } + return client.validateDomainHandleResponse(resp) +} + +// validateDomainCreateRequest creates the ValidateDomain request. +func (client *APIPortalsClient) validateDomainCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, validatePayload CustomDomainValidatePayload, options *APIPortalsClientValidateDomainOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" + 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 apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, validatePayload) +} + +// validateDomainHandleResponse handles the ValidateDomain response. +func (client *APIPortalsClient) validateDomainHandleResponse(resp *http.Response) (APIPortalsClientValidateDomainResponse, error) { + result := APIPortalsClientValidateDomainResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomDomainValidateResult); err != nil { + return APIPortalsClientValidateDomainResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/apiportals_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/apiportals_client_example_test.go new file mode 100644 index 000000000000..4b74776bc59f --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/apiportals_client_example_test.go @@ -0,0 +1,263 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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/applicationaccelerators_client.go b/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client.go new file mode 100644 index 000000000000..146bd52fc94b --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ApplicationAcceleratorsClient contains the methods for the ApplicationAccelerators group. +// Don't use this type directly, use NewApplicationAcceleratorsClient() instead. +type ApplicationAcceleratorsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewApplicationAcceleratorsClient creates a new instance of ApplicationAcceleratorsClient 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 NewApplicationAcceleratorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationAcceleratorsClient, error) { + cl, err := arm.NewClient(moduleName+".ApplicationAcceleratorsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ApplicationAcceleratorsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - applicationAcceleratorName - The name of the application accelerator. +// - applicationAcceleratorResource - The application accelerator for the create or update operation +// - options - ApplicationAcceleratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationAcceleratorsClient.BeginCreateOrUpdate +// method. +func (client *ApplicationAcceleratorsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, applicationAcceleratorResource ApplicationAcceleratorResource, options *ApplicationAcceleratorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ApplicationAcceleratorsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, applicationAcceleratorName, applicationAcceleratorResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ApplicationAcceleratorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[ApplicationAcceleratorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *ApplicationAcceleratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, applicationAcceleratorResource ApplicationAcceleratorResource, options *ApplicationAcceleratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, applicationAcceleratorResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ApplicationAcceleratorsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, applicationAcceleratorResource ApplicationAcceleratorResource, options *ApplicationAcceleratorsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" + 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 applicationAcceleratorName == "" { + return nil, errors.New("parameter applicationAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationAcceleratorName}", url.PathEscape(applicationAcceleratorName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, applicationAcceleratorResource) +} + +// BeginDelete - Delete the application accelerator. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - applicationAcceleratorName - The name of the application accelerator. +// - options - ApplicationAcceleratorsClientBeginDeleteOptions contains the optional parameters for the ApplicationAcceleratorsClient.BeginDelete +// method. +func (client *ApplicationAcceleratorsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, options *ApplicationAcceleratorsClientBeginDeleteOptions) (*runtime.Poller[ApplicationAcceleratorsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, applicationAcceleratorName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ApplicationAcceleratorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[ApplicationAcceleratorsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete the application accelerator. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *ApplicationAcceleratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, options *ApplicationAcceleratorsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ApplicationAcceleratorsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, options *ApplicationAcceleratorsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" + 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 applicationAcceleratorName == "" { + return nil, errors.New("parameter applicationAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationAcceleratorName}", url.PathEscape(applicationAcceleratorName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the application accelerator. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - applicationAcceleratorName - The name of the application accelerator. +// - options - ApplicationAcceleratorsClientGetOptions contains the optional parameters for the ApplicationAcceleratorsClient.Get +// method. +func (client *ApplicationAcceleratorsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, options *ApplicationAcceleratorsClientGetOptions) (ApplicationAcceleratorsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, options) + if err != nil { + return ApplicationAcceleratorsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationAcceleratorsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationAcceleratorsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ApplicationAcceleratorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, options *ApplicationAcceleratorsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}" + 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 applicationAcceleratorName == "" { + return nil, errors.New("parameter applicationAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationAcceleratorName}", url.PathEscape(applicationAcceleratorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *ApplicationAcceleratorsClient) getHandleResponse(resp *http.Response) (ApplicationAcceleratorsClientGetResponse, error) { + result := ApplicationAcceleratorsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationAcceleratorResource); err != nil { + return ApplicationAcceleratorsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handle requests to list all application accelerator. +// +// Generated from API version 2023-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 - ApplicationAcceleratorsClientListOptions contains the optional parameters for the ApplicationAcceleratorsClient.NewListPager +// method. +func (client *ApplicationAcceleratorsClient) NewListPager(resourceGroupName string, serviceName string, options *ApplicationAcceleratorsClientListOptions) *runtime.Pager[ApplicationAcceleratorsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationAcceleratorsClientListResponse]{ + More: func(page ApplicationAcceleratorsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationAcceleratorsClientListResponse) (ApplicationAcceleratorsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationAcceleratorsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationAcceleratorsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationAcceleratorsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ApplicationAcceleratorsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ApplicationAcceleratorsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *ApplicationAcceleratorsClient) listHandleResponse(resp *http.Response) (ApplicationAcceleratorsClientListResponse, error) { + result := ApplicationAcceleratorsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationAcceleratorResourceCollection); err != nil { + return ApplicationAcceleratorsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client_example_test.go new file mode 100644 index 000000000000..2f4600ea300c --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/applicationaccelerators_client_example_test.go @@ -0,0 +1,224 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 new file mode 100644 index 000000000000..81f3fa3feb81 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client.go @@ -0,0 +1,324 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ApplicationLiveViewsClient contains the methods for the ApplicationLiveViews group. +// Don't use this type directly, use NewApplicationLiveViewsClient() instead. +type ApplicationLiveViewsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewApplicationLiveViewsClient creates a new instance of ApplicationLiveViewsClient 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 NewApplicationLiveViewsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationLiveViewsClient, error) { + cl, err := arm.NewClient(moduleName+".ApplicationLiveViewsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ApplicationLiveViewsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - applicationLiveViewName - The name of Application Live View. +// - applicationLiveViewResource - Parameters for the update operation +// - options - ApplicationLiveViewsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationLiveViewsClient.BeginCreateOrUpdate +// method. +func (client *ApplicationLiveViewsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, applicationLiveViewResource ApplicationLiveViewResource, options *ApplicationLiveViewsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ApplicationLiveViewsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, applicationLiveViewName, applicationLiveViewResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ApplicationLiveViewsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[ApplicationLiveViewsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *ApplicationLiveViewsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, applicationLiveViewResource ApplicationLiveViewResource, options *ApplicationLiveViewsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, applicationLiveViewName, applicationLiveViewResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ApplicationLiveViewsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, applicationLiveViewResource ApplicationLiveViewResource, options *ApplicationLiveViewsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" + 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 applicationLiveViewName == "" { + return nil, errors.New("parameter applicationLiveViewName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationLiveViewName}", url.PathEscape(applicationLiveViewName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, applicationLiveViewResource) +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - applicationLiveViewName - The name of Application Live View. +// - options - ApplicationLiveViewsClientBeginDeleteOptions contains the optional parameters for the ApplicationLiveViewsClient.BeginDelete +// method. +func (client *ApplicationLiveViewsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, options *ApplicationLiveViewsClientBeginDeleteOptions) (*runtime.Poller[ApplicationLiveViewsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, applicationLiveViewName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ApplicationLiveViewsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[ApplicationLiveViewsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *ApplicationLiveViewsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, options *ApplicationLiveViewsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, applicationLiveViewName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ApplicationLiveViewsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, options *ApplicationLiveViewsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" + 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 applicationLiveViewName == "" { + return nil, errors.New("parameter applicationLiveViewName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationLiveViewName}", url.PathEscape(applicationLiveViewName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - applicationLiveViewName - The name of Application Live View. +// - options - ApplicationLiveViewsClientGetOptions contains the optional parameters for the ApplicationLiveViewsClient.Get +// method. +func (client *ApplicationLiveViewsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, options *ApplicationLiveViewsClientGetOptions) (ApplicationLiveViewsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, applicationLiveViewName, options) + if err != nil { + return ApplicationLiveViewsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationLiveViewsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationLiveViewsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ApplicationLiveViewsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationLiveViewName string, options *ApplicationLiveViewsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews/{applicationLiveViewName}" + 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 applicationLiveViewName == "" { + return nil, errors.New("parameter applicationLiveViewName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationLiveViewName}", url.PathEscape(applicationLiveViewName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *ApplicationLiveViewsClient) getHandleResponse(resp *http.Response) (ApplicationLiveViewsClientGetResponse, error) { + result := ApplicationLiveViewsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationLiveViewResource); err != nil { + return ApplicationLiveViewsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handles requests to list all resources in a Service. +// +// Generated from API version 2023-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 - ApplicationLiveViewsClientListOptions contains the optional parameters for the ApplicationLiveViewsClient.NewListPager +// method. +func (client *ApplicationLiveViewsClient) NewListPager(resourceGroupName string, serviceName string, options *ApplicationLiveViewsClientListOptions) *runtime.Pager[ApplicationLiveViewsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationLiveViewsClientListResponse]{ + More: func(page ApplicationLiveViewsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationLiveViewsClientListResponse) (ApplicationLiveViewsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationLiveViewsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ApplicationLiveViewsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationLiveViewsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ApplicationLiveViewsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ApplicationLiveViewsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationLiveViews" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *ApplicationLiveViewsClient) listHandleResponse(resp *http.Response) (ApplicationLiveViewsClientListResponse, error) { + result := ApplicationLiveViewsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationLiveViewResourceCollection); err != nil { + return ApplicationLiveViewsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client_example_test.go new file mode 100644 index 000000000000..30f4c8b8795a --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/applicationliveviews_client_example_test.go @@ -0,0 +1,242 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 7c2f8600edc2..f24da3c91272 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/apps_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/apps_client.go @@ -48,7 +48,7 @@ func NewAppsClient(subscriptionID string, credential azcore.TokenCredential, opt // BeginCreateOrUpdate - Create a new App or update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -62,9 +62,7 @@ func (client *AppsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AppsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[AppsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[AppsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,7 +71,7 @@ func (client *AppsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroup // CreateOrUpdate - Create a new App or update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *AppsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource AppResource, options *AppsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, appResource, options) if err != nil { @@ -113,7 +111,7 @@ func (client *AppsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, appResource) @@ -122,7 +120,7 @@ func (client *AppsClient) createOrUpdateCreateRequest(ctx context.Context, resou // BeginDelete - Operation to delete an App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -134,9 +132,7 @@ func (client *AppsClient) BeginDelete(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AppsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[AppsClientDeleteResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[AppsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,7 +141,7 @@ func (client *AppsClient) BeginDelete(ctx context.Context, resourceGroupName str // Delete - Operation to delete an App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *AppsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, options *AppsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, options) if err != nil { @@ -185,7 +181,7 @@ func (client *AppsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +190,7 @@ func (client *AppsClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Get an App and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -239,7 +235,7 @@ func (client *AppsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") if options != nil && options.SyncStatus != nil { reqQP.Set("syncStatus", *options.SyncStatus) } @@ -260,7 +256,7 @@ func (client *AppsClient) getHandleResponse(resp *http.Response) (AppsClientGetR // GetResourceUploadURL - Get an resource upload URL for an App, which may be artifacts or source archive. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -306,7 +302,7 @@ func (client *AppsClient) getResourceUploadURLCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,7 +319,7 @@ func (client *AppsClient) getResourceUploadURLHandleResponse(resp *http.Response // NewListPager - Handles requests to list all resources in a Service. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -376,7 +372,7 @@ func (client *AppsClient) listCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -394,7 +390,7 @@ func (client *AppsClient) listHandleResponse(resp *http.Response) (AppsClientLis // BeginSetActiveDeployments - Set existing Deployment under the app as active // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -408,9 +404,7 @@ func (client *AppsClient) BeginSetActiveDeployments(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AppsClientSetActiveDeploymentsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[AppsClientSetActiveDeploymentsResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[AppsClientSetActiveDeploymentsResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -419,7 +413,7 @@ func (client *AppsClient) BeginSetActiveDeployments(ctx context.Context, resourc // SetActiveDeployments - Set existing Deployment under the app as active // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *AppsClient) setActiveDeployments(ctx context.Context, resourceGroupName string, serviceName string, appName string, activeDeploymentCollection ActiveDeploymentCollection, options *AppsClientBeginSetActiveDeploymentsOptions) (*http.Response, error) { req, err := client.setActiveDeploymentsCreateRequest(ctx, resourceGroupName, serviceName, appName, activeDeploymentCollection, options) if err != nil { @@ -459,7 +453,7 @@ func (client *AppsClient) setActiveDeploymentsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, activeDeploymentCollection) @@ -468,7 +462,7 @@ func (client *AppsClient) setActiveDeploymentsCreateRequest(ctx context.Context, // BeginUpdate - Operation to update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -481,9 +475,7 @@ func (client *AppsClient) BeginUpdate(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AppsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[AppsClientUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[AppsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -492,7 +484,7 @@ func (client *AppsClient) BeginUpdate(ctx context.Context, resourceGroupName str // Update - Operation to update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *AppsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource AppResource, options *AppsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, appResource, options) if err != nil { @@ -532,7 +524,7 @@ func (client *AppsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, appResource) @@ -541,7 +533,7 @@ func (client *AppsClient) updateCreateRequest(ctx context.Context, resourceGroup // ValidateDomain - Check the resource name is valid as well as not in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -587,7 +579,7 @@ func (client *AppsClient) validateDomainCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, validatePayload) diff --git a/sdk/resourcemanager/appplatform/armappplatform/apps_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/apps_client_example_test.go index 7235929fd25d..861b066bcefd 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/apps_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/apps_client_example_test.go @@ -15,11 +15,11 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_Get.json -func ExampleAppsClient_Get() { +// Generated from 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) @@ -49,42 +49,159 @@ func ExampleAppsClient_Get() { // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), // }, // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssigned), + // 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{ - // EnableEndToEndTLS: to.Ptr(false), - // Fqdn: to.Ptr("myapp.mydomain.com"), - // HTTPSOnly: to.Ptr(false), - // LoadedCertificates: []*armappplatform.LoadedCertificate{ + // CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ // { - // LoadTrustStore: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1"), + // 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), // }, - // { - // 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"), // }, - // ProvisioningState: to.Ptr(armappplatform.AppResourceProvisioningStateSucceeded), - // Public: to.Ptr(true), - // TemporaryDisk: &armappplatform.TemporaryDisk{ - // MountPath: to.Ptr("/mytemporarydisk"), - // SizeInGB: to.Ptr[int32](2), + // } +} + +// Generated from 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"), + // }, // }, - // URL: to.Ptr("myapp.myservice.azuremicroservices.io"), // }, - // } + // 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_CreateOrUpdate.json -func ExampleAppsClient_BeginCreateOrUpdate() { +// Generated from 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) @@ -96,20 +213,38 @@ func ExampleAppsClient_BeginCreateOrUpdate() { } poller, err := clientFactory.NewAppsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.AppResource{ Identity: &armappplatform.ManagedIdentityProperties{ - Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssigned), + 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]map[string]any{ - "ApplicationConfigurationService": { + 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": { + "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), LoadedCertificates: []*armappplatform.LoadedCertificate{ { @@ -154,13 +289,23 @@ func ExampleAppsClient_BeginCreateOrUpdate() { // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), // }, // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssigned), + // 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]map[string]any{ + // AddonConfigs: map[string]any{ // "ApplicationConfigurationService": map[string]any{ // "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs", // }, @@ -168,26 +313,193 @@ func ExampleAppsClient_BeginCreateOrUpdate() { // "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry", // }, // }, - // 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), + // 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"), // }, - // ProvisioningState: to.Ptr(armappplatform.AppResourceProvisioningStateSucceeded), - // Public: to.Ptr(true), - // TemporaryDisk: &armappplatform.TemporaryDisk{ - // MountPath: to.Ptr("/mytemporarydisk"), - // SizeInGB: to.Ptr[int32](2), + // } +} + +// Generated from 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"), + // }, // }, - // URL: to.Ptr("myapp.myservice.azuremicroservices.io"), // }, - // } + // 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_Delete.json +// Generated from 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 { @@ -208,8 +520,8 @@ func ExampleAppsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_Update.json -func ExampleAppsClient_BeginUpdate() { +// Generated from 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) @@ -221,12 +533,25 @@ func ExampleAppsClient_BeginUpdate() { } poller, err := clientFactory.NewAppsClient().BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", armappplatform.AppResource{ Identity: &armappplatform.ManagedIdentityProperties{ - Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssigned), + 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), - Fqdn: to.Ptr("myapp.mydomain.com"), HTTPSOnly: to.Ptr(false), PersistentDisk: &armappplatform.PersistentDisk{ MountPath: to.Ptr("/mypersistentdisk"), @@ -262,12 +587,33 @@ func ExampleAppsClient_BeginUpdate() { // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), // }, // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssigned), + // 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), @@ -287,8 +633,128 @@ func ExampleAppsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_List.json -func ExampleAppsClient_NewListPager() { +// Generated from 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) @@ -324,43 +790,168 @@ func ExampleAppsClient_NewListPager() { // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), // }, // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssigned), + // 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{ - // EnableEndToEndTLS: to.Ptr(false), - // Fqdn: to.Ptr("myapp.mydomain.com"), - // HTTPSOnly: to.Ptr(false), - // LoadedCertificates: []*armappplatform.LoadedCertificate{ + // CustomPersistentDisks: []*armappplatform.CustomPersistentDiskResource{ // { - // LoadTrustStore: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1"), + // 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), // }, - // { - // 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"), // }, - // ProvisioningState: to.Ptr(armappplatform.AppResourceProvisioningStateSucceeded), - // Public: to.Ptr(true), - // TemporaryDisk: &armappplatform.TemporaryDisk{ - // MountPath: to.Ptr("/mytemporarydisk"), - // SizeInGB: to.Ptr[int32](2), + // }}, + // } + } +} + +// Generated from 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"), + // }, // }, - // URL: to.Ptr("myapp.myservice.azuremicroservices.io"), // }, - // }}, - // } + // 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_GetResourceUploadUrl.json +// Generated from 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 { @@ -384,7 +975,7 @@ func ExampleAppsClient_GetResourceUploadURL() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_SetActiveDeployments.json +// Generated from 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 { @@ -422,12 +1013,33 @@ func ExampleAppsClient_BeginSetActiveDeployments() { // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), // }, // Identity: &armappplatform.ManagedIdentityProperties{ - // Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssigned), + // 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), @@ -447,7 +1059,7 @@ func ExampleAppsClient_BeginSetActiveDeployments() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_ValidateDomain.json +// Generated from 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 { diff --git a/sdk/resourcemanager/appplatform/armappplatform/autorest.md b/sdk/resourcemanager/appplatform/armappplatform/autorest.md index 5c73ca91f9a9..efeb986f3edc 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/autorest.md +++ b/sdk/resourcemanager/appplatform/armappplatform/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/readme.go.md +- 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 license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.0 -tag: package-2022-04 +module-version: 2.0.0-beta.1 +tag: package-preview-2023-01 ``` \ 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 9923b414446a..d9eee6f8e26d 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/bindings_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/bindings_client.go @@ -48,7 +48,7 @@ func NewBindingsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create a new Binding or update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -63,9 +63,7 @@ func (client *BindingsClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BindingsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BindingsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[BindingsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,7 +72,7 @@ func (client *BindingsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a new Binding or update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, bindingResource, options) if err != nil { @@ -118,7 +116,7 @@ func (client *BindingsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bindingResource) @@ -127,7 +125,7 @@ func (client *BindingsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Operation to delete a Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -140,9 +138,7 @@ func (client *BindingsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BindingsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BindingsClientDeleteResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[BindingsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -151,7 +147,7 @@ func (client *BindingsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Operation to delete a Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *BindingsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, options *BindingsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, options) if err != nil { @@ -195,7 +191,7 @@ func (client *BindingsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +200,7 @@ func (client *BindingsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a Binding and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -254,7 +250,7 @@ func (client *BindingsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +267,7 @@ func (client *BindingsClient) getHandleResponse(resp *http.Response) (BindingsCl // NewListPager - Handles requests to list all resources in an App. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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 +325,7 @@ func (client *BindingsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +343,7 @@ func (client *BindingsClient) listHandleResponse(resp *http.Response) (BindingsC // BeginUpdate - Operation to update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -361,9 +357,7 @@ func (client *BindingsClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BindingsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BindingsClientUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[BindingsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -372,7 +366,7 @@ func (client *BindingsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Operation to update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, bindingResource, options) if err != nil { @@ -416,7 +410,7 @@ func (client *BindingsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bindingResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/bindings_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/bindings_client_example_test.go index 1acb793a92c9..e2775b122e5b 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/bindings_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/bindings_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Bindings_Get.json +// Generated from 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 { @@ -49,9 +49,9 @@ func ExampleBindingsClient_Get() { // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), // }, // Properties: &armappplatform.BindingResourceProperties{ - // BindingParameters: map[string]any{ - // "apiType": "SQL", - // "databaseName": "db1", + // BindingParameters: map[string]*string{ + // "apiType": to.Ptr("SQL"), + // "databaseName": to.Ptr("db1"), // }, // CreatedAt: to.Ptr("2019-01-01T12:34:56.000Z"), // GeneratedProperties: to.Ptr(""), @@ -63,7 +63,7 @@ func ExampleBindingsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Bindings_CreateOrUpdate.json +// Generated from 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 { @@ -76,9 +76,9 @@ func ExampleBindingsClient_BeginCreateOrUpdate() { } poller, err := clientFactory.NewBindingsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", armappplatform.BindingResource{ Properties: &armappplatform.BindingResourceProperties{ - BindingParameters: map[string]any{ - "apiType": "SQL", - "databaseName": "db1", + 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"), @@ -107,9 +107,9 @@ func ExampleBindingsClient_BeginCreateOrUpdate() { // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), // }, // Properties: &armappplatform.BindingResourceProperties{ - // BindingParameters: map[string]any{ - // "apiType": "SQL", - // "databaseName": "db1", + // BindingParameters: map[string]*string{ + // "apiType": to.Ptr("SQL"), + // "databaseName": to.Ptr("db1"), // }, // CreatedAt: to.Ptr("2019-01-01T12:34:56.000Z"), // GeneratedProperties: to.Ptr(""), @@ -121,7 +121,7 @@ func ExampleBindingsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Bindings_Delete.json +// Generated from 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 { @@ -142,7 +142,7 @@ func ExampleBindingsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Bindings_Update.json +// Generated from 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 { @@ -155,9 +155,9 @@ func ExampleBindingsClient_BeginUpdate() { } poller, err := clientFactory.NewBindingsClient().BeginUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mybinding", armappplatform.BindingResource{ Properties: &armappplatform.BindingResourceProperties{ - BindingParameters: map[string]any{ - "apiType": "SQL", - "databaseName": "db1", + BindingParameters: map[string]*string{ + "apiType": to.Ptr("SQL"), + "databaseName": to.Ptr("db1"), }, Key: to.Ptr("xxxx"), }, @@ -185,9 +185,9 @@ func ExampleBindingsClient_BeginUpdate() { // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), // }, // Properties: &armappplatform.BindingResourceProperties{ - // BindingParameters: map[string]any{ - // "apiType": "SQL", - // "databaseName": "db1", + // BindingParameters: map[string]*string{ + // "apiType": to.Ptr("SQL"), + // "databaseName": to.Ptr("db1"), // }, // CreatedAt: to.Ptr("2019-01-01T12:34:56.000Z"), // GeneratedProperties: to.Ptr(""), @@ -199,7 +199,7 @@ func ExampleBindingsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Bindings_List.json +// Generated from 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 { @@ -236,9 +236,9 @@ func ExampleBindingsClient_NewListPager() { // LastModifiedByType: to.Ptr(armappplatform.LastModifiedByTypeUser), // }, // Properties: &armappplatform.BindingResourceProperties{ - // BindingParameters: map[string]any{ - // "apiType": "SQL", - // "databaseName": "db1", + // BindingParameters: map[string]*string{ + // "apiType": to.Ptr("SQL"), + // "databaseName": to.Ptr("db1"), // }, // CreatedAt: to.Ptr("2019-01-01T12:34:56.000Z"), // GeneratedProperties: to.Ptr(""), diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client.go b/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client.go index 56532d7be9e1..d9a330601cc5 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client.go @@ -48,7 +48,7 @@ func NewBuildpackBindingClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Create or update a buildpack binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -64,9 +64,7 @@ func (client *BuildpackBindingClient) BeginCreateOrUpdate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildpackBindingClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BuildpackBindingClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[BuildpackBindingClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -75,7 +73,7 @@ func (client *BuildpackBindingClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Create or update a buildpack binding. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, buildpackBinding, options) if err != nil { @@ -123,7 +121,7 @@ func (client *BuildpackBindingClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, buildpackBinding) @@ -132,7 +130,7 @@ func (client *BuildpackBindingClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Operation to delete a Buildpack Binding // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -147,9 +145,7 @@ func (client *BuildpackBindingClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildpackBindingClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BuildpackBindingClientDeleteResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[BuildpackBindingClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -158,7 +154,7 @@ func (client *BuildpackBindingClient) BeginDelete(ctx context.Context, resourceG // Delete - Operation to delete a Buildpack Binding // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, options) if err != nil { @@ -206,7 +202,7 @@ func (client *BuildpackBindingClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +211,7 @@ func (client *BuildpackBindingClient) deleteCreateRequest(ctx context.Context, r // Get - Get a buildpack binding by name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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 +266,7 @@ func (client *BuildpackBindingClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +283,7 @@ func (client *BuildpackBindingClient) getHandleResponse(resp *http.Response) (Bu // NewListPager - Handles requests to list all buildpack bindings in a builder. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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 +347,7 @@ func (client *BuildpackBindingClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,3 +361,74 @@ func (client *BuildpackBindingClient) listHandleResponse(resp *http.Response) (B } return result, nil } + +// NewListForClusterPager - Get collection of buildpack bindings under all builders. +// +// Generated from API version 2023-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 - BuildpackBindingClientListForClusterOptions contains the optional parameters for the BuildpackBindingClient.NewListForClusterPager +// method. +func (client *BuildpackBindingClient) NewListForClusterPager(resourceGroupName string, serviceName string, options *BuildpackBindingClientListForClusterOptions) *runtime.Pager[BuildpackBindingClientListForClusterResponse] { + return runtime.NewPager(runtime.PagingHandler[BuildpackBindingClientListForClusterResponse]{ + More: func(page BuildpackBindingClientListForClusterResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *BuildpackBindingClientListForClusterResponse) (BuildpackBindingClientListForClusterResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listForClusterCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return BuildpackBindingClientListForClusterResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return BuildpackBindingClientListForClusterResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BuildpackBindingClientListForClusterResponse{}, runtime.NewResponseError(resp) + } + return client.listForClusterHandleResponse(resp) + }, + }) +} + +// listForClusterCreateRequest creates the ListForCluster request. +func (client *BuildpackBindingClient) listForClusterCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *BuildpackBindingClientListForClusterOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildpackBindings" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listForClusterHandleResponse handles the ListForCluster response. +func (client *BuildpackBindingClient) listForClusterHandleResponse(resp *http.Response) (BuildpackBindingClientListForClusterResponse, error) { + result := BuildpackBindingClientListForClusterResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BuildpackBindingResourceCollection); err != nil { + return BuildpackBindingClientListForClusterResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client_example_test.go index 6ec09ae65f0b..268d2699e495 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildpackbinding_client_example_test.go @@ -15,10 +15,89 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildpackBinding_Get.json +// Generated from 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 { @@ -64,7 +143,7 @@ func ExampleBuildpackBindingClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildpackBinding_CreateOrUpdate.json +// Generated from 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 { @@ -128,7 +207,7 @@ func ExampleBuildpackBindingClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildpackBinding_Delete.json +// Generated from 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 { @@ -149,7 +228,7 @@ func ExampleBuildpackBindingClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildpackBinding_List.json +// Generated from 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 { diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildservice_client.go b/sdk/resourcemanager/appplatform/armappplatform/buildservice_client.go index 19bd6279153a..c10751378438 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildservice_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildservice_client.go @@ -48,7 +48,7 @@ func NewBuildServiceClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdateBuild - Create or update a KPack build. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -100,7 +100,7 @@ func (client *BuildServiceClient) createOrUpdateBuildCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, buildParam) @@ -118,7 +118,7 @@ func (client *BuildServiceClient) createOrUpdateBuildHandleResponse(resp *http.R // GetBuild - Get a KPack build. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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 *BuildServiceClient) getBuildCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +186,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 2022-04-01 +// Generated from API version 2023-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. @@ -242,7 +242,7 @@ func (client *BuildServiceClient) getBuildResultCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,7 +260,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 2022-04-01 +// Generated from API version 2023-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. @@ -316,7 +316,7 @@ func (client *BuildServiceClient) getBuildResultLogCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,7 +334,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 2022-04-01 +// Generated from API version 2023-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. @@ -380,7 +380,7 @@ func (client *BuildServiceClient) getBuildServiceCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -398,7 +398,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 2022-04-01 +// Generated from API version 2023-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. @@ -444,7 +444,7 @@ func (client *BuildServiceClient) getResourceUploadURLCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -462,7 +462,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 2022-04-01 +// Generated from API version 2023-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. @@ -513,7 +513,7 @@ func (client *BuildServiceClient) getSupportedBuildpackCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -531,7 +531,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 2022-04-01 +// Generated from API version 2023-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. @@ -582,7 +582,7 @@ func (client *BuildServiceClient) getSupportedStackCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -599,7 +599,7 @@ func (client *BuildServiceClient) getSupportedStackHandleResponse(resp *http.Res // NewListBuildResultsPager - List KPack build results. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -663,7 +663,7 @@ func (client *BuildServiceClient) listBuildResultsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -680,7 +680,7 @@ func (client *BuildServiceClient) listBuildResultsHandleResponse(resp *http.Resp // NewListBuildServicesPager - List build services resource. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -734,7 +734,7 @@ func (client *BuildServiceClient) listBuildServicesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -751,7 +751,7 @@ func (client *BuildServiceClient) listBuildServicesHandleResponse(resp *http.Res // NewListBuildsPager - List KPack builds. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -810,7 +810,7 @@ func (client *BuildServiceClient) listBuildsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -828,7 +828,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 2022-04-01 +// Generated from API version 2023-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. @@ -874,7 +874,7 @@ func (client *BuildServiceClient) listSupportedBuildpacksCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -892,7 +892,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 2022-04-01 +// Generated from API version 2023-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. @@ -938,7 +938,7 @@ func (client *BuildServiceClient) listSupportedStacksCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-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 index a4289d200748..e37e370e06cb 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildservice_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildservice_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_ListBuildServices.json +// Generated from 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 { @@ -67,7 +67,7 @@ func ExampleBuildServiceClient_NewListBuildServicesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetBuildService.json +// Generated from 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 { @@ -108,7 +108,7 @@ func ExampleBuildServiceClient_GetBuildService() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_ListBuilds.json +// Generated from 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 { @@ -152,13 +152,17 @@ func ExampleBuildServiceClient_NewListBuildsPager() { // }, // 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetBuild.json +// Generated from 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 { @@ -196,11 +200,15 @@ func ExampleBuildServiceClient_GetBuild() { // }, // 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_CreateOrUpdateBuild.json +// Generated from 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 { @@ -219,6 +227,10 @@ func ExampleBuildServiceClient_CreateOrUpdateBuild() { "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 { @@ -247,11 +259,15 @@ func ExampleBuildServiceClient_CreateOrUpdateBuild() { // }, // 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_ListBuildResults.json +// Generated from 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 { @@ -293,28 +309,43 @@ func ExampleBuildServiceClient_NewListBuildResultsPager() { // BuildStages: []*armappplatform.BuildStageProperties{ // { // Name: to.Ptr("prepare"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateRunning), + // ExitCode: to.Ptr("0"), + // Reason: to.Ptr("Completed"), + // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), // }, // { // Name: to.Ptr("detect"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateNotStarted), + // ExitCode: to.Ptr("0"), + // Reason: to.Ptr("Completed"), + // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), // }, // { // Name: to.Ptr("analyze"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateNotStarted), + // ExitCode: to.Ptr("0"), + // Reason: to.Ptr("Completed"), + // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), // }, // { // Name: to.Ptr("restore"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateNotStarted), + // ExitCode: to.Ptr("0"), + // Reason: to.Ptr("Completed"), + // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), // }, // { // Name: to.Ptr("build"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateNotStarted), + // 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), // }, // }}, @@ -322,7 +353,7 @@ func ExampleBuildServiceClient_NewListBuildResultsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetBuildResult.json +// Generated from 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 { @@ -358,34 +389,49 @@ func ExampleBuildServiceClient_GetBuildResult() { // BuildStages: []*armappplatform.BuildStageProperties{ // { // Name: to.Ptr("prepare"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateRunning), + // ExitCode: to.Ptr("0"), + // Reason: to.Ptr("Completed"), + // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), // }, // { // Name: to.Ptr("detect"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateNotStarted), + // ExitCode: to.Ptr("0"), + // Reason: to.Ptr("Completed"), + // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), // }, // { // Name: to.Ptr("analyze"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateNotStarted), + // ExitCode: to.Ptr("0"), + // Reason: to.Ptr("Completed"), + // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), // }, // { // Name: to.Ptr("restore"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateNotStarted), + // ExitCode: to.Ptr("0"), + // Reason: to.Ptr("Completed"), + // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateSucceeded), // }, // { // Name: to.Ptr("build"), - // Status: to.Ptr(armappplatform.KPackBuildStageProvisioningStateNotStarted), + // 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetBuildResultLog.json +// Generated from 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 { @@ -408,7 +454,7 @@ func ExampleBuildServiceClient_GetBuildResultLog() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetResourceUploadUrl.json +// Generated from 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 { @@ -432,7 +478,7 @@ func ExampleBuildServiceClient_GetResourceUploadURL() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_ListSupportedBuildpacks.json +// Generated from 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 { @@ -471,7 +517,7 @@ func ExampleBuildServiceClient_ListSupportedBuildpacks() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetSupportedBuildpack.json +// Generated from 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 { @@ -507,7 +553,7 @@ func ExampleBuildServiceClient_GetSupportedBuildpack() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_ListSupportedStacks.json +// Generated from 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 { @@ -547,7 +593,7 @@ func ExampleBuildServiceClient_ListSupportedStacks() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetSupportedStack.json +// Generated from 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 { diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client.go b/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client.go index f8b3896b8e6c..5cd5e2670538 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client.go @@ -48,7 +48,7 @@ func NewBuildServiceAgentPoolClient(subscriptionID string, credential azcore.Tok // Get - Get build service agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -99,7 +99,7 @@ func (client *BuildServiceAgentPoolClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *BuildServiceAgentPoolClient) getHandleResponse(resp *http.Response // NewListPager - List build service agent pool. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -175,7 +175,7 @@ func (client *BuildServiceAgentPoolClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *BuildServiceAgentPoolClient) listHandleResponse(resp *http.Respons // BeginUpdatePut - Create or update build service agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -208,9 +208,7 @@ func (client *BuildServiceAgentPoolClient) BeginUpdatePut(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildServiceAgentPoolClientUpdatePutResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BuildServiceAgentPoolClientUpdatePutResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[BuildServiceAgentPoolClientUpdatePutResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -219,7 +217,7 @@ func (client *BuildServiceAgentPoolClient) BeginUpdatePut(ctx context.Context, r // UpdatePut - Create or update build service agent pool. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource, options) if err != nil { @@ -263,7 +261,7 @@ func (client *BuildServiceAgentPoolClient) updatePutCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, agentPoolResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client_example_test.go index dd358e9d17a6..1b9be0331c95 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildserviceagentpool_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceAgentPool_List.json +// Generated from 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 { @@ -67,7 +67,7 @@ func ExampleBuildServiceAgentPoolClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceAgentPool_Get.json +// Generated from 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 { @@ -108,7 +108,7 @@ func ExampleBuildServiceAgentPoolClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceAgentPool_UpdatePut.json +// Generated from 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 { diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client.go b/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client.go index 5b4ce6bff2c4..addbf30af2a4 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client.go @@ -48,7 +48,7 @@ func NewBuildServiceBuilderClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Create or update a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -63,9 +63,7 @@ func (client *BuildServiceBuilderClient) BeginCreateOrUpdate(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildServiceBuilderClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BuildServiceBuilderClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[BuildServiceBuilderClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,7 +72,7 @@ func (client *BuildServiceBuilderClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Create or update a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, builderResource, options) if err != nil { @@ -118,7 +116,7 @@ func (client *BuildServiceBuilderClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, builderResource) @@ -127,7 +125,7 @@ func (client *BuildServiceBuilderClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -141,9 +139,7 @@ func (client *BuildServiceBuilderClient) BeginDelete(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BuildServiceBuilderClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BuildServiceBuilderClientDeleteResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[BuildServiceBuilderClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -152,7 +148,7 @@ func (client *BuildServiceBuilderClient) BeginDelete(ctx context.Context, resour // Delete - Delete a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *BuildServiceBuilderClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, options *BuildServiceBuilderClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, options) if err != nil { @@ -196,7 +192,7 @@ func (client *BuildServiceBuilderClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +201,7 @@ func (client *BuildServiceBuilderClient) deleteCreateRequest(ctx context.Context // Get - Get a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -255,7 +251,7 @@ func (client *BuildServiceBuilderClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +268,7 @@ func (client *BuildServiceBuilderClient) getHandleResponse(resp *http.Response) // NewListPager - List KPack builders result. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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 +327,7 @@ func (client *BuildServiceBuilderClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,3 +341,72 @@ func (client *BuildServiceBuilderClient) listHandleResponse(resp *http.Response) } return result, nil } + +// 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 +// - resourceGroupName - The name of the resource group that 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. +// - builderName - The name of the builder resource. +// - options - BuildServiceBuilderClientListDeploymentsOptions contains the optional parameters for the BuildServiceBuilderClient.ListDeployments +// method. +func (client *BuildServiceBuilderClient) ListDeployments(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, options *BuildServiceBuilderClientListDeploymentsOptions) (BuildServiceBuilderClientListDeploymentsResponse, error) { + req, err := client.listDeploymentsCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, options) + if err != nil { + return BuildServiceBuilderClientListDeploymentsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return BuildServiceBuilderClientListDeploymentsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BuildServiceBuilderClientListDeploymentsResponse{}, runtime.NewResponseError(resp) + } + return client.listDeploymentsHandleResponse(resp) +} + +// listDeploymentsCreateRequest creates the ListDeployments request. +func (client *BuildServiceBuilderClient) listDeploymentsCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, options *BuildServiceBuilderClientListDeploymentsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/buildServices/{buildServiceName}/builders/{builderName}/listUsingDeployments" + 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 builderName == "" { + return nil, errors.New("parameter builderName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{builderName}", url.PathEscape(builderName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listDeploymentsHandleResponse handles the ListDeployments response. +func (client *BuildServiceBuilderClient) listDeploymentsHandleResponse(resp *http.Response) (BuildServiceBuilderClientListDeploymentsResponse, error) { + result := BuildServiceBuilderClientListDeploymentsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DeploymentList); err != nil { + return BuildServiceBuilderClientListDeploymentsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client_example_test.go index 66033a13bdf5..d5efd0363dc4 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/buildservicebuilder_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceBuilder_Get.json +// Generated from 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 { @@ -66,7 +66,7 @@ func ExampleBuildServiceBuilderClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceBuilder_CreateOrUpdate.json +// Generated from 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 { @@ -136,7 +136,7 @@ func ExampleBuildServiceBuilderClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceBuilder_Delete.json +// Generated from 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 { @@ -157,7 +157,7 @@ func ExampleBuildServiceBuilderClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceBuilder_List.json +// Generated from 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 { @@ -212,3 +212,28 @@ func ExampleBuildServiceBuilderClient_NewListPager() { // } } } + +// Generated from 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 79a70bf0100e..86c83f3da072 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/certificates_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/certificates_client.go @@ -48,7 +48,7 @@ func NewCertificatesClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Create or update certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -62,9 +62,7 @@ func (client *CertificatesClient) BeginCreateOrUpdate(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificatesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[CertificatesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[CertificatesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,7 +71,7 @@ func (client *CertificatesClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Create or update certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *CertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, certificateName string, certificateResource CertificateResource, options *CertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, certificateName, certificateResource, options) if err != nil { @@ -113,7 +111,7 @@ func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, certificateResource) @@ -122,7 +120,7 @@ func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete the certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -135,9 +133,7 @@ func (client *CertificatesClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CertificatesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[CertificatesClientDeleteResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[CertificatesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -146,7 +142,7 @@ func (client *CertificatesClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete the certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *CertificatesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, certificateName string, options *CertificatesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, certificateName, options) if err != nil { @@ -186,7 +182,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,7 +191,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou // Get - Get the certificate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -240,7 +236,7 @@ func (client *CertificatesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +253,7 @@ func (client *CertificatesClient) getHandleResponse(resp *http.Response) (Certif // NewListPager - List all the certificates of one user. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -310,7 +306,7 @@ func (client *CertificatesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-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 index 674dc224c0fe..f6c0419b667e 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/certificates_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/certificates_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Certificates_Get.json +// Generated from 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 { @@ -58,6 +58,7 @@ func ExampleCertificatesClient_Get() { // 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"), @@ -68,7 +69,7 @@ func ExampleCertificatesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Certificates_CreateOrUpdate.json +// Generated from 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 { @@ -129,7 +130,7 @@ func ExampleCertificatesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Certificates_Delete.json +// Generated from 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 { @@ -150,7 +151,7 @@ func ExampleCertificatesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Certificates_List.json +// Generated from 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 { @@ -161,7 +162,7 @@ func ExampleCertificatesClient_NewListPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewCertificatesClient().NewListPager("myResourceGroup", "myService", nil) + pager := clientFactory.NewCertificatesClient().NewListPager("myResourceGroup", "myservice", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -196,6 +197,7 @@ func ExampleCertificatesClient_NewListPager() { // 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"), diff --git a/sdk/resourcemanager/appplatform/armappplatform/client_factory.go b/sdk/resourcemanager/appplatform/armappplatform/client_factory.go index 6480dc6e8df5..1f68b46b9274 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/client_factory.go +++ b/sdk/resourcemanager/appplatform/armappplatform/client_factory.go @@ -59,6 +59,16 @@ func (c *ClientFactory) NewServiceRegistriesClient() *ServiceRegistriesClient { return subClient } +func (c *ClientFactory) NewApplicationLiveViewsClient() *ApplicationLiveViewsClient { + subClient, _ := NewApplicationLiveViewsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewDevToolPortalsClient() *DevToolPortalsClient { + subClient, _ := NewDevToolPortalsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewBuildServiceClient() *BuildServiceClient { subClient, _ := NewBuildServiceClient(c.subscriptionID, c.credential, c.options) return subClient @@ -94,6 +104,11 @@ func (c *ClientFactory) NewBindingsClient() *BindingsClient { return subClient } +func (c *ClientFactory) NewStoragesClient() *StoragesClient { + subClient, _ := NewStoragesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + func (c *ClientFactory) NewCertificatesClient() *CertificatesClient { subClient, _ := NewCertificatesClient(c.subscriptionID, c.credential, c.options) return subClient @@ -123,3 +138,43 @@ func (c *ClientFactory) NewSKUsClient() *SKUsClient { subClient, _ := NewSKUsClient(c.subscriptionID, c.credential, c.options) return subClient } + +func (c *ClientFactory) NewGatewaysClient() *GatewaysClient { + subClient, _ := NewGatewaysClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewGatewayRouteConfigsClient() *GatewayRouteConfigsClient { + subClient, _ := NewGatewayRouteConfigsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewGatewayCustomDomainsClient() *GatewayCustomDomainsClient { + subClient, _ := NewGatewayCustomDomainsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAPIPortalsClient() *APIPortalsClient { + subClient, _ := NewAPIPortalsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAPIPortalCustomDomainsClient() *APIPortalCustomDomainsClient { + subClient, _ := NewAPIPortalCustomDomainsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewApplicationAcceleratorsClient() *ApplicationAcceleratorsClient { + subClient, _ := NewApplicationAcceleratorsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewCustomizedAcceleratorsClient() *CustomizedAcceleratorsClient { + subClient, _ := NewCustomizedAcceleratorsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewPredefinedAcceleratorsClient() *PredefinedAcceleratorsClient { + subClient, _ := NewPredefinedAcceleratorsClient(c.subscriptionID, c.credential, c.options) + return subClient +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go b/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go index 27947394155d..54b0df009902 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/configservers_client.go @@ -48,7 +48,7 @@ func NewConfigServersClient(subscriptionID string, credential azcore.TokenCreden // Get - Get the config server and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -88,7 +88,7 @@ func (client *ConfigServersClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +106,7 @@ func (client *ConfigServersClient) getHandleResponse(resp *http.Response) (Confi // BeginUpdatePatch - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -119,9 +119,7 @@ func (client *ConfigServersClient) BeginUpdatePatch(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigServersClientUpdatePatchResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ConfigServersClientUpdatePatchResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[ConfigServersClientUpdatePatchResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -130,7 +128,7 @@ func (client *ConfigServersClient) BeginUpdatePatch(ctx context.Context, resourc // UpdatePatch - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *ConfigServersClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, configServerResource ConfigServerResource, options *ConfigServersClientBeginUpdatePatchOptions) (*http.Response, error) { req, err := client.updatePatchCreateRequest(ctx, resourceGroupName, serviceName, configServerResource, options) if err != nil { @@ -166,7 +164,7 @@ func (client *ConfigServersClient) updatePatchCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configServerResource) @@ -175,7 +173,7 @@ func (client *ConfigServersClient) updatePatchCreateRequest(ctx context.Context, // BeginUpdatePut - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -188,9 +186,7 @@ func (client *ConfigServersClient) BeginUpdatePut(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigServersClientUpdatePutResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ConfigServersClientUpdatePutResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[ConfigServersClientUpdatePutResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -199,7 +195,7 @@ func (client *ConfigServersClient) BeginUpdatePut(ctx context.Context, resourceG // UpdatePut - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *ConfigServersClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, configServerResource ConfigServerResource, options *ConfigServersClientBeginUpdatePutOptions) (*http.Response, error) { req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, configServerResource, options) if err != nil { @@ -235,7 +231,7 @@ func (client *ConfigServersClient) updatePutCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configServerResource) @@ -244,7 +240,7 @@ func (client *ConfigServersClient) updatePutCreateRequest(ctx context.Context, r // BeginValidate - Check if the config server settings are valid. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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 +264,7 @@ func (client *ConfigServersClient) BeginValidate(ctx context.Context, resourceGr // Validate - Check if the config server settings are valid. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *ConfigServersClient) validate(ctx context.Context, resourceGroupName string, serviceName string, configServerSettings ConfigServerSettings, options *ConfigServersClientBeginValidateOptions) (*http.Response, error) { req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, configServerSettings, options) if err != nil { @@ -304,7 +300,7 @@ func (client *ConfigServersClient) validateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configServerSettings) diff --git a/sdk/resourcemanager/appplatform/armappplatform/configservers_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/configservers_client_example_test.go index ca8bee970082..f9d0e0e1bd01 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/configservers_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/configservers_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigServers_Get.json +// Generated from 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 { @@ -62,7 +62,7 @@ func ExampleConfigServersClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigServers_UpdatePut.json +// Generated from 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 { @@ -121,7 +121,7 @@ func ExampleConfigServersClient_BeginUpdatePut() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigServers_UpdatePatch.json +// Generated from 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 { @@ -180,7 +180,7 @@ func ExampleConfigServersClient_BeginUpdatePatch() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigServers_Validate.json +// Generated from 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 { diff --git a/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client.go b/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client.go index 541abb296ac8..b9b69e87f2a4 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client.go @@ -49,7 +49,7 @@ func NewConfigurationServicesClient(subscriptionID string, credential azcore.Tok // Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -63,9 +63,7 @@ func (client *ConfigurationServicesClient) BeginCreateOrUpdate(ctx context.Conte if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationServicesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ConfigurationServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[ConfigurationServicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -75,7 +73,7 @@ func (client *ConfigurationServicesClient) BeginCreateOrUpdate(ctx context.Conte // Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *ConfigurationServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, configurationServiceResource ConfigurationServiceResource, options *ConfigurationServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, options) if err != nil { @@ -115,7 +113,7 @@ func (client *ConfigurationServicesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configurationServiceResource) @@ -124,7 +122,7 @@ func (client *ConfigurationServicesClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Disable the default Application Configuration Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -137,9 +135,7 @@ func (client *ConfigurationServicesClient) BeginDelete(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ConfigurationServicesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ConfigurationServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[ConfigurationServicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -148,7 +144,7 @@ func (client *ConfigurationServicesClient) BeginDelete(ctx context.Context, reso // Delete - Disable the default Application Configuration Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *ConfigurationServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, options *ConfigurationServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, options) if err != nil { @@ -188,7 +184,7 @@ func (client *ConfigurationServicesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,7 +193,7 @@ func (client *ConfigurationServicesClient) deleteCreateRequest(ctx context.Conte // Get - Get the Application Configuration Service and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -243,7 +239,7 @@ func (client *ConfigurationServicesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,7 +256,7 @@ func (client *ConfigurationServicesClient) getHandleResponse(resp *http.Response // NewListPager - Handles requests to list all resources in a Service. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -314,7 +310,7 @@ func (client *ConfigurationServicesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,7 +328,7 @@ func (client *ConfigurationServicesClient) listHandleResponse(resp *http.Respons // BeginValidate - Check if the Application Configuration Service settings are valid. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -357,7 +353,7 @@ func (client *ConfigurationServicesClient) BeginValidate(ctx context.Context, re // Validate - Check if the Application Configuration Service settings are valid. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *ConfigurationServicesClient) validate(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, settings ConfigurationServiceSettings, options *ConfigurationServicesClientBeginValidateOptions) (*http.Response, error) { req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, settings, options) if err != nil { @@ -397,7 +393,7 @@ func (client *ConfigurationServicesClient) validateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, settings) diff --git a/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client_example_test.go index 75a11456a324..09b7b61910ca 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/configurationservices_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigurationServices_Get.json +// Generated from 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 { @@ -81,7 +81,7 @@ func ExampleConfigurationServicesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigurationServices_CreateOrUpdate.json +// Generated from 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 { @@ -162,7 +162,7 @@ func ExampleConfigurationServicesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigurationServices_Delete.json +// Generated from 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 { @@ -183,7 +183,7 @@ func ExampleConfigurationServicesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigurationServices_List.json +// Generated from 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 { @@ -254,7 +254,7 @@ func ExampleConfigurationServicesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigurationServices_Validate.json +// Generated from 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 { diff --git a/sdk/resourcemanager/appplatform/armappplatform/constants.go b/sdk/resourcemanager/appplatform/armappplatform/constants.go index 219c2609669e..a328ef950627 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/constants.go +++ b/sdk/resourcemanager/appplatform/armappplatform/constants.go @@ -11,9 +11,31 @@ package armappplatform const ( moduleName = "armappplatform" - moduleVersion = "v1.1.0" + moduleVersion = "v2.0.0-beta.1" ) +// APIPortalProvisioningState - State of the API portal. +type APIPortalProvisioningState string + +const ( + APIPortalProvisioningStateCreating APIPortalProvisioningState = "Creating" + APIPortalProvisioningStateDeleting APIPortalProvisioningState = "Deleting" + APIPortalProvisioningStateFailed APIPortalProvisioningState = "Failed" + APIPortalProvisioningStateSucceeded APIPortalProvisioningState = "Succeeded" + APIPortalProvisioningStateUpdating APIPortalProvisioningState = "Updating" +) + +// PossibleAPIPortalProvisioningStateValues returns the possible values for the APIPortalProvisioningState const type. +func PossibleAPIPortalProvisioningStateValues() []APIPortalProvisioningState { + return []APIPortalProvisioningState{ + APIPortalProvisioningStateCreating, + APIPortalProvisioningStateDeleting, + APIPortalProvisioningStateFailed, + APIPortalProvisioningStateSucceeded, + APIPortalProvisioningStateUpdating, + } +} + // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. type ActionType string @@ -28,6 +50,28 @@ func PossibleActionTypeValues() []ActionType { } } +// ApmType - Type of application performance monitoring +type ApmType string + +const ( + ApmTypeAppDynamics ApmType = "AppDynamics" + ApmTypeApplicationInsights ApmType = "ApplicationInsights" + ApmTypeDynatrace ApmType = "Dynatrace" + ApmTypeElasticAPM ApmType = "ElasticAPM" + ApmTypeNewRelic ApmType = "NewRelic" +) + +// PossibleApmTypeValues returns the possible values for the ApmType const type. +func PossibleApmTypeValues() []ApmType { + return []ApmType{ + ApmTypeAppDynamics, + ApmTypeApplicationInsights, + ApmTypeDynatrace, + ApmTypeElasticAPM, + ApmTypeNewRelic, + } +} + // AppResourceProvisioningState - Provisioning state of the App type AppResourceProvisioningState string @@ -50,6 +94,68 @@ func PossibleAppResourceProvisioningStateValues() []AppResourceProvisioningState } } +// ApplicationAcceleratorProvisioningState - State of the application accelerator. +type ApplicationAcceleratorProvisioningState string + +const ( + ApplicationAcceleratorProvisioningStateCreating ApplicationAcceleratorProvisioningState = "Creating" + ApplicationAcceleratorProvisioningStateDeleting ApplicationAcceleratorProvisioningState = "Deleting" + ApplicationAcceleratorProvisioningStateFailed ApplicationAcceleratorProvisioningState = "Failed" + ApplicationAcceleratorProvisioningStateSucceeded ApplicationAcceleratorProvisioningState = "Succeeded" + ApplicationAcceleratorProvisioningStateUpdating ApplicationAcceleratorProvisioningState = "Updating" +) + +// PossibleApplicationAcceleratorProvisioningStateValues returns the possible values for the ApplicationAcceleratorProvisioningState const type. +func PossibleApplicationAcceleratorProvisioningStateValues() []ApplicationAcceleratorProvisioningState { + return []ApplicationAcceleratorProvisioningState{ + ApplicationAcceleratorProvisioningStateCreating, + ApplicationAcceleratorProvisioningStateDeleting, + ApplicationAcceleratorProvisioningStateFailed, + ApplicationAcceleratorProvisioningStateSucceeded, + ApplicationAcceleratorProvisioningStateUpdating, + } +} + +// ApplicationLiveViewProvisioningState - State of the Application Live View. +type ApplicationLiveViewProvisioningState string + +const ( + ApplicationLiveViewProvisioningStateCanceled ApplicationLiveViewProvisioningState = "Canceled" + ApplicationLiveViewProvisioningStateCreating ApplicationLiveViewProvisioningState = "Creating" + ApplicationLiveViewProvisioningStateDeleting ApplicationLiveViewProvisioningState = "Deleting" + ApplicationLiveViewProvisioningStateFailed ApplicationLiveViewProvisioningState = "Failed" + ApplicationLiveViewProvisioningStateSucceeded ApplicationLiveViewProvisioningState = "Succeeded" + ApplicationLiveViewProvisioningStateUpdating ApplicationLiveViewProvisioningState = "Updating" +) + +// PossibleApplicationLiveViewProvisioningStateValues returns the possible values for the ApplicationLiveViewProvisioningState const type. +func PossibleApplicationLiveViewProvisioningStateValues() []ApplicationLiveViewProvisioningState { + return []ApplicationLiveViewProvisioningState{ + ApplicationLiveViewProvisioningStateCanceled, + ApplicationLiveViewProvisioningStateCreating, + ApplicationLiveViewProvisioningStateDeleting, + ApplicationLiveViewProvisioningStateFailed, + ApplicationLiveViewProvisioningStateSucceeded, + ApplicationLiveViewProvisioningStateUpdating, + } +} + +// BackendProtocol - How ingress should communicate with this app backend service. +type BackendProtocol string + +const ( + BackendProtocolDefault BackendProtocol = "Default" + BackendProtocolGRPC BackendProtocol = "GRPC" +) + +// PossibleBackendProtocolValues returns the possible values for the BackendProtocol const type. +func PossibleBackendProtocolValues() []BackendProtocol { + return []BackendProtocol{ + BackendProtocolDefault, + BackendProtocolGRPC, + } +} + // BindingType - Buildpack Binding Type type BindingType string @@ -57,6 +163,7 @@ const ( BindingTypeApacheSkyWalking BindingType = "ApacheSkyWalking" BindingTypeAppDynamics BindingType = "AppDynamics" BindingTypeApplicationInsights BindingType = "ApplicationInsights" + BindingTypeCACertificates BindingType = "CACertificates" BindingTypeDynatrace BindingType = "Dynatrace" BindingTypeElasticAPM BindingType = "ElasticAPM" BindingTypeNewRelic BindingType = "NewRelic" @@ -68,6 +175,7 @@ func PossibleBindingTypeValues() []BindingType { BindingTypeApacheSkyWalking, BindingTypeAppDynamics, BindingTypeApplicationInsights, + BindingTypeCACertificates, BindingTypeDynatrace, BindingTypeElasticAPM, BindingTypeNewRelic, @@ -184,6 +292,28 @@ func PossibleBuildpackBindingProvisioningStateValues() []BuildpackBindingProvisi } } +// CertificateResourceProvisioningState - Provisioning state of the Certificate +type CertificateResourceProvisioningState string + +const ( + CertificateResourceProvisioningStateCreating CertificateResourceProvisioningState = "Creating" + CertificateResourceProvisioningStateDeleting CertificateResourceProvisioningState = "Deleting" + CertificateResourceProvisioningStateFailed CertificateResourceProvisioningState = "Failed" + CertificateResourceProvisioningStateSucceeded CertificateResourceProvisioningState = "Succeeded" + CertificateResourceProvisioningStateUpdating CertificateResourceProvisioningState = "Updating" +) + +// PossibleCertificateResourceProvisioningStateValues returns the possible values for the CertificateResourceProvisioningState const type. +func PossibleCertificateResourceProvisioningStateValues() []CertificateResourceProvisioningState { + return []CertificateResourceProvisioningState{ + CertificateResourceProvisioningStateCreating, + CertificateResourceProvisioningStateDeleting, + CertificateResourceProvisioningStateFailed, + CertificateResourceProvisioningStateSucceeded, + CertificateResourceProvisioningStateUpdating, + } +} + // ConfigServerState - State of the config server. type ConfigServerState string @@ -248,6 +378,68 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// CustomDomainResourceProvisioningState - Provisioning state of the Domain +type CustomDomainResourceProvisioningState string + +const ( + CustomDomainResourceProvisioningStateCreating CustomDomainResourceProvisioningState = "Creating" + CustomDomainResourceProvisioningStateDeleting CustomDomainResourceProvisioningState = "Deleting" + CustomDomainResourceProvisioningStateFailed CustomDomainResourceProvisioningState = "Failed" + CustomDomainResourceProvisioningStateSucceeded CustomDomainResourceProvisioningState = "Succeeded" + CustomDomainResourceProvisioningStateUpdating CustomDomainResourceProvisioningState = "Updating" +) + +// PossibleCustomDomainResourceProvisioningStateValues returns the possible values for the CustomDomainResourceProvisioningState const type. +func PossibleCustomDomainResourceProvisioningStateValues() []CustomDomainResourceProvisioningState { + return []CustomDomainResourceProvisioningState{ + CustomDomainResourceProvisioningStateCreating, + CustomDomainResourceProvisioningStateDeleting, + CustomDomainResourceProvisioningStateFailed, + CustomDomainResourceProvisioningStateSucceeded, + CustomDomainResourceProvisioningStateUpdating, + } +} + +// CustomizedAcceleratorProvisioningState - State of the customized accelerator. +type CustomizedAcceleratorProvisioningState string + +const ( + CustomizedAcceleratorProvisioningStateCreating CustomizedAcceleratorProvisioningState = "Creating" + CustomizedAcceleratorProvisioningStateDeleting CustomizedAcceleratorProvisioningState = "Deleting" + CustomizedAcceleratorProvisioningStateFailed CustomizedAcceleratorProvisioningState = "Failed" + CustomizedAcceleratorProvisioningStateSucceeded CustomizedAcceleratorProvisioningState = "Succeeded" + CustomizedAcceleratorProvisioningStateUpdating CustomizedAcceleratorProvisioningState = "Updating" +) + +// PossibleCustomizedAcceleratorProvisioningStateValues returns the possible values for the CustomizedAcceleratorProvisioningState const type. +func PossibleCustomizedAcceleratorProvisioningStateValues() []CustomizedAcceleratorProvisioningState { + return []CustomizedAcceleratorProvisioningState{ + CustomizedAcceleratorProvisioningStateCreating, + CustomizedAcceleratorProvisioningStateDeleting, + CustomizedAcceleratorProvisioningStateFailed, + CustomizedAcceleratorProvisioningStateSucceeded, + CustomizedAcceleratorProvisioningStateUpdating, + } +} + +// CustomizedAcceleratorValidateResultState - State of the customized accelerator validation result +type CustomizedAcceleratorValidateResultState string + +const ( + // CustomizedAcceleratorValidateResultStateInvalid - Customized accelerator properties are invalid. + CustomizedAcceleratorValidateResultStateInvalid CustomizedAcceleratorValidateResultState = "Invalid" + // CustomizedAcceleratorValidateResultStateValid - Customized accelerator properties are valid. + CustomizedAcceleratorValidateResultStateValid CustomizedAcceleratorValidateResultState = "Valid" +) + +// PossibleCustomizedAcceleratorValidateResultStateValues returns the possible values for the CustomizedAcceleratorValidateResultState const type. +func PossibleCustomizedAcceleratorValidateResultStateValues() []CustomizedAcceleratorValidateResultState { + return []CustomizedAcceleratorValidateResultState{ + CustomizedAcceleratorValidateResultStateInvalid, + CustomizedAcceleratorValidateResultStateValid, + } +} + // DeploymentResourceProvisioningState - Provisioning state of the Deployment type DeploymentResourceProvisioningState string @@ -284,6 +476,105 @@ func PossibleDeploymentResourceStatusValues() []DeploymentResourceStatus { } } +// DevToolPortalFeatureState - State of the plugin +type DevToolPortalFeatureState string + +const ( + // DevToolPortalFeatureStateDisabled - Disable the plugin in Dev Tool Portal. + DevToolPortalFeatureStateDisabled DevToolPortalFeatureState = "Disabled" + // DevToolPortalFeatureStateEnabled - Enable the plugin in Dev Tool Portal. + DevToolPortalFeatureStateEnabled DevToolPortalFeatureState = "Enabled" +) + +// PossibleDevToolPortalFeatureStateValues returns the possible values for the DevToolPortalFeatureState const type. +func PossibleDevToolPortalFeatureStateValues() []DevToolPortalFeatureState { + return []DevToolPortalFeatureState{ + DevToolPortalFeatureStateDisabled, + DevToolPortalFeatureStateEnabled, + } +} + +// DevToolPortalProvisioningState - State of the Dev Tool Portal. +type DevToolPortalProvisioningState string + +const ( + DevToolPortalProvisioningStateCanceled DevToolPortalProvisioningState = "Canceled" + DevToolPortalProvisioningStateCreating DevToolPortalProvisioningState = "Creating" + DevToolPortalProvisioningStateDeleting DevToolPortalProvisioningState = "Deleting" + DevToolPortalProvisioningStateFailed DevToolPortalProvisioningState = "Failed" + DevToolPortalProvisioningStateSucceeded DevToolPortalProvisioningState = "Succeeded" + DevToolPortalProvisioningStateUpdating DevToolPortalProvisioningState = "Updating" +) + +// PossibleDevToolPortalProvisioningStateValues returns the possible values for the DevToolPortalProvisioningState const type. +func PossibleDevToolPortalProvisioningStateValues() []DevToolPortalProvisioningState { + return []DevToolPortalProvisioningState{ + DevToolPortalProvisioningStateCanceled, + DevToolPortalProvisioningStateCreating, + DevToolPortalProvisioningStateDeleting, + DevToolPortalProvisioningStateFailed, + DevToolPortalProvisioningStateSucceeded, + DevToolPortalProvisioningStateUpdating, + } +} + +// GatewayProvisioningState - State of the Spring Cloud Gateway. +type GatewayProvisioningState string + +const ( + GatewayProvisioningStateCreating GatewayProvisioningState = "Creating" + GatewayProvisioningStateDeleting GatewayProvisioningState = "Deleting" + GatewayProvisioningStateFailed GatewayProvisioningState = "Failed" + GatewayProvisioningStateSucceeded GatewayProvisioningState = "Succeeded" + GatewayProvisioningStateUpdating GatewayProvisioningState = "Updating" +) + +// PossibleGatewayProvisioningStateValues returns the possible values for the GatewayProvisioningState const type. +func PossibleGatewayProvisioningStateValues() []GatewayProvisioningState { + return []GatewayProvisioningState{ + GatewayProvisioningStateCreating, + GatewayProvisioningStateDeleting, + GatewayProvisioningStateFailed, + GatewayProvisioningStateSucceeded, + GatewayProvisioningStateUpdating, + } +} + +// GatewayRouteConfigProtocol - Protocol of routed Azure Spring Apps applications. +type GatewayRouteConfigProtocol string + +const ( + GatewayRouteConfigProtocolHTTP GatewayRouteConfigProtocol = "HTTP" + GatewayRouteConfigProtocolHTTPS GatewayRouteConfigProtocol = "HTTPS" +) + +// PossibleGatewayRouteConfigProtocolValues returns the possible values for the GatewayRouteConfigProtocol const type. +func PossibleGatewayRouteConfigProtocolValues() []GatewayRouteConfigProtocol { + return []GatewayRouteConfigProtocol{ + GatewayRouteConfigProtocolHTTP, + GatewayRouteConfigProtocolHTTPS, + } +} + +// HTTPSchemeType - Scheme to use for connecting to the host. Defaults to HTTP. +// Possible enum values: +// * "HTTP" means that the scheme used will be http:// +// * "HTTPS" means that the scheme used will be https:// +type HTTPSchemeType string + +const ( + HTTPSchemeTypeHTTP HTTPSchemeType = "HTTP" + HTTPSchemeTypeHTTPS HTTPSchemeType = "HTTPS" +) + +// PossibleHTTPSchemeTypeValues returns the possible values for the HTTPSchemeType const type. +func PossibleHTTPSchemeTypeValues() []HTTPSchemeType { + return []HTTPSchemeType{ + HTTPSchemeTypeHTTP, + HTTPSchemeTypeHTTPS, + } +} + // KPackBuildStageProvisioningState - The provisioning state of this build stage resource. type KPackBuildStageProvisioningState string @@ -364,6 +655,78 @@ func PossibleMonitoringSettingStateValues() []MonitoringSettingState { } } +// PowerState - Power state of the Service +type PowerState string + +const ( + PowerStateRunning PowerState = "Running" + PowerStateStopped PowerState = "Stopped" +) + +// PossiblePowerStateValues returns the possible values for the PowerState const type. +func PossiblePowerStateValues() []PowerState { + return []PowerState{ + PowerStateRunning, + PowerStateStopped, + } +} + +// PredefinedAcceleratorProvisioningState - Provisioning state of the predefined accelerator. +type PredefinedAcceleratorProvisioningState string + +const ( + PredefinedAcceleratorProvisioningStateCreating PredefinedAcceleratorProvisioningState = "Creating" + PredefinedAcceleratorProvisioningStateFailed PredefinedAcceleratorProvisioningState = "Failed" + PredefinedAcceleratorProvisioningStateSucceeded PredefinedAcceleratorProvisioningState = "Succeeded" + PredefinedAcceleratorProvisioningStateUpdating PredefinedAcceleratorProvisioningState = "Updating" +) + +// PossiblePredefinedAcceleratorProvisioningStateValues returns the possible values for the PredefinedAcceleratorProvisioningState const type. +func PossiblePredefinedAcceleratorProvisioningStateValues() []PredefinedAcceleratorProvisioningState { + return []PredefinedAcceleratorProvisioningState{ + PredefinedAcceleratorProvisioningStateCreating, + PredefinedAcceleratorProvisioningStateFailed, + PredefinedAcceleratorProvisioningStateSucceeded, + PredefinedAcceleratorProvisioningStateUpdating, + } +} + +// PredefinedAcceleratorState - State of the predefined accelerator. +type PredefinedAcceleratorState string + +const ( + // PredefinedAcceleratorStateDisabled - Disable the predefined accelerator. + PredefinedAcceleratorStateDisabled PredefinedAcceleratorState = "Disabled" + // PredefinedAcceleratorStateEnabled - Enable the predefined accelerator. + PredefinedAcceleratorStateEnabled PredefinedAcceleratorState = "Enabled" +) + +// PossiblePredefinedAcceleratorStateValues returns the possible values for the PredefinedAcceleratorState const type. +func PossiblePredefinedAcceleratorStateValues() []PredefinedAcceleratorState { + return []PredefinedAcceleratorState{ + PredefinedAcceleratorStateDisabled, + PredefinedAcceleratorStateEnabled, + } +} + +// ProbeActionType - The type of the action to take to perform the health check. +type ProbeActionType string + +const ( + ProbeActionTypeExecAction ProbeActionType = "ExecAction" + ProbeActionTypeHTTPGetAction ProbeActionType = "HTTPGetAction" + ProbeActionTypeTCPSocketAction ProbeActionType = "TCPSocketAction" +) + +// PossibleProbeActionTypeValues returns the possible values for the ProbeActionType const type. +func PossibleProbeActionTypeValues() []ProbeActionType { + return []ProbeActionType{ + ProbeActionTypeExecAction, + ProbeActionTypeHTTPGetAction, + ProbeActionTypeTCPSocketAction, + } +} + // ProvisioningState - Provisioning state of the Service type ProvisioningState string @@ -470,6 +833,36 @@ func PossibleServiceRegistryProvisioningStateValues() []ServiceRegistryProvision } } +// SessionAffinity - Type of the affinity, set this to Cookie to enable session affinity. +type SessionAffinity string + +const ( + SessionAffinityCookie SessionAffinity = "Cookie" + SessionAffinityNone SessionAffinity = "None" +) + +// PossibleSessionAffinityValues returns the possible values for the SessionAffinity const type. +func PossibleSessionAffinityValues() []SessionAffinity { + return []SessionAffinity{ + SessionAffinityCookie, + SessionAffinityNone, + } +} + +// StorageType - The type of the storage. +type StorageType string + +const ( + StorageTypeStorageAccount StorageType = "StorageAccount" +) + +// PossibleStorageTypeValues returns the possible values for the StorageType const type. +func PossibleStorageTypeValues() []StorageType { + return []StorageType{ + StorageTypeStorageAccount, + } +} + // SupportedRuntimePlatform - The platform of this runtime version (possible values: "Java" or ".NET"). type SupportedRuntimePlatform string @@ -537,3 +930,17 @@ func PossibleTrafficDirectionValues() []TrafficDirection { TrafficDirectionOutbound, } } + +// Type - The type of the underlying resource to mount as a persistent disk. +type Type string + +const ( + TypeAzureFileVolume Type = "AzureFileVolume" +) + +// PossibleTypeValues returns the possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{ + TypeAzureFileVolume, + } +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go index dae076232108..b772e4d460c5 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/customdomains_client.go @@ -48,7 +48,7 @@ func NewCustomDomainsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Create or update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -63,9 +63,7 @@ func (client *CustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CustomDomainsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[CustomDomainsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[CustomDomainsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,7 +72,7 @@ func (client *CustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Create or update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, domainResource, options) if err != nil { @@ -118,7 +116,7 @@ func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, domainResource) @@ -127,7 +125,7 @@ func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Delete the custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -141,9 +139,7 @@ func (client *CustomDomainsClient) BeginDelete(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CustomDomainsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[CustomDomainsClientDeleteResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[CustomDomainsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -152,7 +148,7 @@ func (client *CustomDomainsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Delete the custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *CustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, domainName string, options *CustomDomainsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, options) if err != nil { @@ -196,7 +192,7 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -205,7 +201,7 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso // Get - Get the custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -255,7 +251,7 @@ func (client *CustomDomainsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +268,7 @@ func (client *CustomDomainsClient) getHandleResponse(resp *http.Response) (Custo // NewListPager - List the custom domains of one lifecycle application. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -330,7 +326,7 @@ func (client *CustomDomainsClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,7 +344,7 @@ func (client *CustomDomainsClient) listHandleResponse(resp *http.Response) (Cust // BeginUpdate - Update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -363,9 +359,7 @@ func (client *CustomDomainsClient) BeginUpdate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[CustomDomainsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[CustomDomainsClientUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[CustomDomainsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -374,7 +368,7 @@ func (client *CustomDomainsClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, domainResource, options) if err != nil { @@ -418,7 +412,7 @@ func (client *CustomDomainsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, domainResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/customdomains_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/customdomains_client_example_test.go index bab6448d8ea2..8b3aaabdbf2b 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/customdomains_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/customdomains_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/CustomDomains_Get.json +// Generated from 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 { @@ -51,12 +51,13 @@ func ExampleCustomDomainsClient_Get() { // 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/CustomDomains_CreateOrUpdate.json +// Generated from 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 { @@ -103,7 +104,7 @@ func ExampleCustomDomainsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/CustomDomains_Delete.json +// Generated from 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 { @@ -124,7 +125,7 @@ func ExampleCustomDomainsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/CustomDomains_Update.json +// Generated from 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 { @@ -171,7 +172,7 @@ func ExampleCustomDomainsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/CustomDomains_List.json +// Generated from 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 { @@ -210,6 +211,7 @@ func ExampleCustomDomainsClient_NewListPager() { // 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 new file mode 100644 index 000000000000..1a4ad8551f17 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client.go @@ -0,0 +1,414 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// CustomizedAcceleratorsClient contains the methods for the CustomizedAccelerators group. +// Don't use this type directly, use NewCustomizedAcceleratorsClient() instead. +type CustomizedAcceleratorsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewCustomizedAcceleratorsClient creates a new instance of CustomizedAcceleratorsClient 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 NewCustomizedAcceleratorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CustomizedAcceleratorsClient, error) { + cl, err := arm.NewClient(moduleName+".CustomizedAcceleratorsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &CustomizedAcceleratorsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - applicationAcceleratorName - The name of the application accelerator. +// - customizedAcceleratorName - The name of the customized accelerator. +// - customizedAcceleratorResource - The customized accelerator for the create or update operation +// - options - CustomizedAcceleratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomizedAcceleratorsClient.BeginCreateOrUpdate +// method. +func (client *CustomizedAcceleratorsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, customizedAcceleratorResource CustomizedAcceleratorResource, options *CustomizedAcceleratorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[CustomizedAcceleratorsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, customizedAcceleratorResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[CustomizedAcceleratorsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[CustomizedAcceleratorsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *CustomizedAcceleratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, customizedAcceleratorResource CustomizedAcceleratorResource, options *CustomizedAcceleratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, customizedAcceleratorResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *CustomizedAcceleratorsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, customizedAcceleratorResource CustomizedAcceleratorResource, options *CustomizedAcceleratorsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" + 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 applicationAcceleratorName == "" { + return nil, errors.New("parameter applicationAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationAcceleratorName}", url.PathEscape(applicationAcceleratorName)) + if customizedAcceleratorName == "" { + return nil, errors.New("parameter customizedAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{customizedAcceleratorName}", url.PathEscape(customizedAcceleratorName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, customizedAcceleratorResource) +} + +// BeginDelete - Delete the customized accelerator. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - applicationAcceleratorName - The name of the application accelerator. +// - customizedAcceleratorName - The name of the customized accelerator. +// - options - CustomizedAcceleratorsClientBeginDeleteOptions contains the optional parameters for the CustomizedAcceleratorsClient.BeginDelete +// method. +func (client *CustomizedAcceleratorsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, options *CustomizedAcceleratorsClientBeginDeleteOptions) (*runtime.Poller[CustomizedAcceleratorsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[CustomizedAcceleratorsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[CustomizedAcceleratorsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete the customized accelerator. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *CustomizedAcceleratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, options *CustomizedAcceleratorsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *CustomizedAcceleratorsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, options *CustomizedAcceleratorsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" + 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 applicationAcceleratorName == "" { + return nil, errors.New("parameter applicationAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationAcceleratorName}", url.PathEscape(applicationAcceleratorName)) + if customizedAcceleratorName == "" { + return nil, errors.New("parameter customizedAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{customizedAcceleratorName}", url.PathEscape(customizedAcceleratorName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the customized accelerator. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - applicationAcceleratorName - The name of the application accelerator. +// - customizedAcceleratorName - The name of the customized accelerator. +// - options - CustomizedAcceleratorsClientGetOptions contains the optional parameters for the CustomizedAcceleratorsClient.Get +// method. +func (client *CustomizedAcceleratorsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, options *CustomizedAcceleratorsClientGetOptions) (CustomizedAcceleratorsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, options) + if err != nil { + return CustomizedAcceleratorsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CustomizedAcceleratorsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CustomizedAcceleratorsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *CustomizedAcceleratorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, options *CustomizedAcceleratorsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}" + 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 applicationAcceleratorName == "" { + return nil, errors.New("parameter applicationAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationAcceleratorName}", url.PathEscape(applicationAcceleratorName)) + if customizedAcceleratorName == "" { + return nil, errors.New("parameter customizedAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{customizedAcceleratorName}", url.PathEscape(customizedAcceleratorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *CustomizedAcceleratorsClient) getHandleResponse(resp *http.Response) (CustomizedAcceleratorsClientGetResponse, error) { + result := CustomizedAcceleratorsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomizedAcceleratorResource); err != nil { + return CustomizedAcceleratorsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handle requests to list all customized accelerators. +// +// Generated from API version 2023-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. +// - applicationAcceleratorName - The name of the application accelerator. +// - options - CustomizedAcceleratorsClientListOptions contains the optional parameters for the CustomizedAcceleratorsClient.NewListPager +// method. +func (client *CustomizedAcceleratorsClient) NewListPager(resourceGroupName string, serviceName string, applicationAcceleratorName string, options *CustomizedAcceleratorsClientListOptions) *runtime.Pager[CustomizedAcceleratorsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CustomizedAcceleratorsClientListResponse]{ + More: func(page CustomizedAcceleratorsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CustomizedAcceleratorsClientListResponse) (CustomizedAcceleratorsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return CustomizedAcceleratorsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CustomizedAcceleratorsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CustomizedAcceleratorsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *CustomizedAcceleratorsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, options *CustomizedAcceleratorsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators" + 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 applicationAcceleratorName == "" { + return nil, errors.New("parameter applicationAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationAcceleratorName}", url.PathEscape(applicationAcceleratorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *CustomizedAcceleratorsClient) listHandleResponse(resp *http.Response) (CustomizedAcceleratorsClientListResponse, error) { + result := CustomizedAcceleratorsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomizedAcceleratorResourceCollection); err != nil { + return CustomizedAcceleratorsClientListResponse{}, err + } + return result, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - applicationAcceleratorName - The name of the application accelerator. +// - customizedAcceleratorName - The name of the customized accelerator. +// - properties - Customized accelerator properties to be validated +// - options - CustomizedAcceleratorsClientValidateOptions contains the optional parameters for the CustomizedAcceleratorsClient.Validate +// method. +func (client *CustomizedAcceleratorsClient) Validate(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, properties CustomizedAcceleratorProperties, options *CustomizedAcceleratorsClientValidateOptions) (CustomizedAcceleratorsClientValidateResponse, error) { + req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, customizedAcceleratorName, properties, options) + if err != nil { + return CustomizedAcceleratorsClientValidateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CustomizedAcceleratorsClientValidateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return CustomizedAcceleratorsClientValidateResponse{}, runtime.NewResponseError(resp) + } + return client.validateHandleResponse(resp) +} + +// validateCreateRequest creates the Validate request. +func (client *CustomizedAcceleratorsClient) validateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, customizedAcceleratorName string, properties CustomizedAcceleratorProperties, options *CustomizedAcceleratorsClientValidateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/customizedAccelerators/{customizedAcceleratorName}/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 applicationAcceleratorName == "" { + return nil, errors.New("parameter applicationAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationAcceleratorName}", url.PathEscape(applicationAcceleratorName)) + if customizedAcceleratorName == "" { + return nil, errors.New("parameter customizedAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{customizedAcceleratorName}", url.PathEscape(customizedAcceleratorName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, properties) +} + +// validateHandleResponse handles the Validate response. +func (client *CustomizedAcceleratorsClient) validateHandleResponse(resp *http.Response) (CustomizedAcceleratorsClientValidateResponse, error) { + result := CustomizedAcceleratorsClientValidateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomizedAcceleratorValidateResult); err != nil { + return CustomizedAcceleratorsClientValidateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client_example_test.go new file mode 100644 index 000000000000..2f528dbdfabd --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/customizedaccelerators_client_example_test.go @@ -0,0 +1,294 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 a86442d3473e..41a9d5ed042e 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/deployments_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/deployments_client.go @@ -48,7 +48,7 @@ func NewDeploymentsClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Create a new Deployment or update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -63,9 +63,7 @@ func (client *DeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -74,7 +72,7 @@ func (client *DeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Create a new Deployment or update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, deploymentResource, options) if err != nil { @@ -118,7 +116,7 @@ func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, deploymentResource) @@ -127,7 +125,7 @@ func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Operation to delete a Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -140,9 +138,7 @@ func (client *DeploymentsClient) BeginDelete(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientDeleteResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -151,7 +147,7 @@ func (client *DeploymentsClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Operation to delete a Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *DeploymentsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -195,16 +191,171 @@ func (client *DeploymentsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// BeginDisableRemoteDebugging - Disable remote debugging. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - appName - The name of the App resource. +// - deploymentName - The name of the Deployment resource. +// - options - DeploymentsClientBeginDisableRemoteDebuggingOptions contains the optional parameters for the DeploymentsClient.BeginDisableRemoteDebugging +// method. +func (client *DeploymentsClient) BeginDisableRemoteDebugging(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginDisableRemoteDebuggingOptions) (*runtime.Poller[DeploymentsClientDisableRemoteDebuggingResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.disableRemoteDebugging(ctx, resourceGroupName, serviceName, appName, deploymentName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[DeploymentsClientDisableRemoteDebuggingResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[DeploymentsClientDisableRemoteDebuggingResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// DisableRemoteDebugging - Disable remote debugging. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *DeploymentsClient) disableRemoteDebugging(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginDisableRemoteDebuggingOptions) (*http.Response, error) { + req, err := client.disableRemoteDebuggingCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// disableRemoteDebuggingCreateRequest creates the DisableRemoteDebugging request. +func (client *DeploymentsClient) disableRemoteDebuggingCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginDisableRemoteDebuggingOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/disableRemoteDebugging" + 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 appName == "" { + return nil, errors.New("parameter appName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{appName}", url.PathEscape(appName)) + if deploymentName == "" { + return nil, errors.New("parameter deploymentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginEnableRemoteDebugging - Enable remote debugging. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - appName - The name of the App resource. +// - deploymentName - The name of the Deployment resource. +// - options - DeploymentsClientBeginEnableRemoteDebuggingOptions contains the optional parameters for the DeploymentsClient.BeginEnableRemoteDebugging +// method. +func (client *DeploymentsClient) BeginEnableRemoteDebugging(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginEnableRemoteDebuggingOptions) (*runtime.Poller[DeploymentsClientEnableRemoteDebuggingResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.enableRemoteDebugging(ctx, resourceGroupName, serviceName, appName, deploymentName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[DeploymentsClientEnableRemoteDebuggingResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[DeploymentsClientEnableRemoteDebuggingResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// EnableRemoteDebugging - Enable remote debugging. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *DeploymentsClient) enableRemoteDebugging(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginEnableRemoteDebuggingOptions) (*http.Response, error) { + req, err := client.enableRemoteDebuggingCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// enableRemoteDebuggingCreateRequest creates the EnableRemoteDebugging request. +func (client *DeploymentsClient) enableRemoteDebuggingCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginEnableRemoteDebuggingOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/enableRemoteDebugging" + 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 appName == "" { + return nil, errors.New("parameter appName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{appName}", url.PathEscape(appName)) + if deploymentName == "" { + return nil, errors.New("parameter deploymentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.RemoteDebuggingPayload != nil { + return req, runtime.MarshalAsJSON(req, *options.RemoteDebuggingPayload) + } + return req, nil +} + // BeginGenerateHeapDump - Generate Heap Dump // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -219,9 +370,7 @@ func (client *DeploymentsClient) BeginGenerateHeapDump(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientGenerateHeapDumpResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientGenerateHeapDumpResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientGenerateHeapDumpResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -230,7 +379,7 @@ func (client *DeploymentsClient) BeginGenerateHeapDump(ctx context.Context, reso // GenerateHeapDump - Generate Heap Dump // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.generateHeapDumpCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, options) if err != nil { @@ -274,7 +423,7 @@ func (client *DeploymentsClient) generateHeapDumpCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, diagnosticParameters) @@ -283,7 +432,7 @@ func (client *DeploymentsClient) generateHeapDumpCreateRequest(ctx context.Conte // BeginGenerateThreadDump - Generate Thread Dump // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -298,9 +447,7 @@ func (client *DeploymentsClient) BeginGenerateThreadDump(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientGenerateThreadDumpResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientGenerateThreadDumpResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientGenerateThreadDumpResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -309,7 +456,7 @@ func (client *DeploymentsClient) BeginGenerateThreadDump(ctx context.Context, re // GenerateThreadDump - Generate Thread Dump // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.generateThreadDumpCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, options) if err != nil { @@ -353,7 +500,7 @@ func (client *DeploymentsClient) generateThreadDumpCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, diagnosticParameters) @@ -362,7 +509,7 @@ func (client *DeploymentsClient) generateThreadDumpCreateRequest(ctx context.Con // Get - Get a Deployment and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -412,7 +559,7 @@ func (client *DeploymentsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -430,7 +577,7 @@ func (client *DeploymentsClient) getHandleResponse(resp *http.Response) (Deploym // GetLogFileURL - Get deployment log file URL // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -481,7 +628,7 @@ func (client *DeploymentsClient) getLogFileURLCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -496,9 +643,78 @@ func (client *DeploymentsClient) getLogFileURLHandleResponse(resp *http.Response return result, nil } +// GetRemoteDebuggingConfig - Get remote debugging config. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - appName - The name of the App resource. +// - deploymentName - The name of the Deployment resource. +// - options - DeploymentsClientGetRemoteDebuggingConfigOptions contains the optional parameters for the DeploymentsClient.GetRemoteDebuggingConfig +// method. +func (client *DeploymentsClient) GetRemoteDebuggingConfig(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientGetRemoteDebuggingConfigOptions) (DeploymentsClientGetRemoteDebuggingConfigResponse, error) { + req, err := client.getRemoteDebuggingConfigCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) + if err != nil { + return DeploymentsClientGetRemoteDebuggingConfigResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DeploymentsClientGetRemoteDebuggingConfigResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DeploymentsClientGetRemoteDebuggingConfigResponse{}, runtime.NewResponseError(resp) + } + return client.getRemoteDebuggingConfigHandleResponse(resp) +} + +// getRemoteDebuggingConfigCreateRequest creates the GetRemoteDebuggingConfig request. +func (client *DeploymentsClient) getRemoteDebuggingConfigCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientGetRemoteDebuggingConfigOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apps/{appName}/deployments/{deploymentName}/getRemoteDebuggingConfig" + 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 appName == "" { + return nil, errors.New("parameter appName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{appName}", url.PathEscape(appName)) + if deploymentName == "" { + return nil, errors.New("parameter deploymentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{deploymentName}", url.PathEscape(deploymentName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getRemoteDebuggingConfigHandleResponse handles the GetRemoteDebuggingConfig response. +func (client *DeploymentsClient) getRemoteDebuggingConfigHandleResponse(resp *http.Response) (DeploymentsClientGetRemoteDebuggingConfigResponse, error) { + result := DeploymentsClientGetRemoteDebuggingConfigResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RemoteDebugging); err != nil { + return DeploymentsClientGetRemoteDebuggingConfigResponse{}, err + } + return result, nil +} + // NewListPager - Handles requests to list all resources in an App. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -556,7 +772,7 @@ func (client *DeploymentsClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") if options != nil && options.Version != nil { for _, qv := range options.Version { reqQP.Add("version", qv) @@ -578,7 +794,7 @@ func (client *DeploymentsClient) listHandleResponse(resp *http.Response) (Deploy // NewListForClusterPager - List deployments for a certain service // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -632,7 +848,7 @@ func (client *DeploymentsClient) listForClusterCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") if options != nil && options.Version != nil { for _, qv := range options.Version { reqQP.Add("version", qv) @@ -655,7 +871,7 @@ func (client *DeploymentsClient) listForClusterHandleResponse(resp *http.Respons // BeginRestart - Restart the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -669,9 +885,7 @@ func (client *DeploymentsClient) BeginRestart(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientRestartResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientRestartResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientRestartResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -680,7 +894,7 @@ func (client *DeploymentsClient) BeginRestart(ctx context.Context, resourceGroup // Restart - Restart the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *DeploymentsClient) restart(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginRestartOptions) (*http.Response, error) { req, err := client.restartCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -724,7 +938,7 @@ func (client *DeploymentsClient) restartCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -733,7 +947,7 @@ func (client *DeploymentsClient) restartCreateRequest(ctx context.Context, resou // BeginStart - Start the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -746,9 +960,7 @@ func (client *DeploymentsClient) BeginStart(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientStartResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientStartResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientStartResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -757,7 +969,7 @@ func (client *DeploymentsClient) BeginStart(ctx context.Context, resourceGroupNa // Start - Start the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *DeploymentsClient) start(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -801,7 +1013,7 @@ func (client *DeploymentsClient) startCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -810,7 +1022,7 @@ func (client *DeploymentsClient) startCreateRequest(ctx context.Context, resourc // BeginStartJFR - Start JFR // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -825,9 +1037,7 @@ func (client *DeploymentsClient) BeginStartJFR(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientStartJFRResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientStartJFRResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientStartJFRResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -836,7 +1046,7 @@ func (client *DeploymentsClient) BeginStartJFR(ctx context.Context, resourceGrou // StartJFR - Start JFR // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.startJFRCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, options) if err != nil { @@ -880,7 +1090,7 @@ func (client *DeploymentsClient) startJFRCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, diagnosticParameters) @@ -889,7 +1099,7 @@ func (client *DeploymentsClient) startJFRCreateRequest(ctx context.Context, reso // BeginStop - Stop the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -902,9 +1112,7 @@ func (client *DeploymentsClient) BeginStop(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientStopResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientStopResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientStopResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -913,7 +1121,7 @@ func (client *DeploymentsClient) BeginStop(ctx context.Context, resourceGroupNam // Stop - Stop the deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *DeploymentsClient) stop(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -957,7 +1165,7 @@ func (client *DeploymentsClient) stopCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -966,7 +1174,7 @@ func (client *DeploymentsClient) stopCreateRequest(ctx context.Context, resource // BeginUpdate - Operation to update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -980,9 +1188,7 @@ func (client *DeploymentsClient) BeginUpdate(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DeploymentsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -991,7 +1197,7 @@ func (client *DeploymentsClient) BeginUpdate(ctx context.Context, resourceGroupN // Update - Operation to update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, deploymentResource, options) if err != nil { @@ -1035,7 +1241,7 @@ func (client *DeploymentsClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, deploymentResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/deployments_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/deployments_client_example_test.go index 060f051b6732..b33f6931ded8 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/deployments_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/deployments_client_example_test.go @@ -15,11 +15,11 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_Get.json -func ExampleDeploymentsClient_Get() { +// Generated from 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) @@ -83,8 +83,84 @@ func ExampleDeploymentsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_CreateOrUpdate.json -func ExampleDeploymentsClient_BeginCreateOrUpdate() { +// Generated from 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) @@ -97,8 +173,8 @@ func ExampleDeploymentsClient_BeginCreateOrUpdate() { poller, err := clientFactory.NewDeploymentsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myservice", "myapp", "mydeployment", armappplatform.DeploymentResource{ Properties: &armappplatform.DeploymentResourceProperties{ DeploymentSettings: &armappplatform.DeploymentSettings{ - AddonConfigs: map[string]map[string]any{ - "ApplicationConfigurationService": { + AddonConfigs: map[string]any{ + "ApplicationConfigurationService": map[string]any{ "patterns": []any{ "mypattern", }, @@ -107,10 +183,33 @@ func ExampleDeploymentsClient_BeginCreateOrUpdate() { 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"), @@ -153,10 +252,33 @@ func ExampleDeploymentsClient_BeginCreateOrUpdate() { // 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{ // { @@ -182,7 +304,157 @@ func ExampleDeploymentsClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_Delete.json +// Generated from 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 { @@ -203,8 +475,8 @@ func ExampleDeploymentsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_Update.json -func ExampleDeploymentsClient_BeginUpdate() { +// Generated from 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) @@ -281,7 +553,100 @@ func ExampleDeploymentsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_List.json +// Generated from 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 { @@ -354,7 +719,7 @@ func ExampleDeploymentsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_ListForCluster.json +// Generated from 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 { @@ -427,7 +792,7 @@ func ExampleDeploymentsClient_NewListForClusterPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_Start.json +// Generated from 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 { @@ -448,7 +813,7 @@ func ExampleDeploymentsClient_BeginStart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_Stop.json +// Generated from 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 { @@ -469,7 +834,7 @@ func ExampleDeploymentsClient_BeginStop() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_Restart.json +// Generated from 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 { @@ -490,7 +855,87 @@ func ExampleDeploymentsClient_BeginRestart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_GetLogFileUrl.json +// Generated from 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 { @@ -513,7 +958,7 @@ func ExampleDeploymentsClient_GetLogFileURL() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_GenerateHeapDump.json +// Generated from 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 { @@ -537,7 +982,7 @@ func ExampleDeploymentsClient_BeginGenerateHeapDump() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_GenerateThreadDump.json +// Generated from 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 { @@ -561,7 +1006,7 @@ func ExampleDeploymentsClient_BeginGenerateThreadDump() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_StartJFR.json +// Generated from 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 { diff --git a/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client.go b/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client.go new file mode 100644 index 000000000000..023a0373639e --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client.go @@ -0,0 +1,322 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DevToolPortalsClient contains the methods for the DevToolPortals group. +// Don't use this type directly, use NewDevToolPortalsClient() instead. +type DevToolPortalsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDevToolPortalsClient creates a new instance of DevToolPortalsClient 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 NewDevToolPortalsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DevToolPortalsClient, error) { + cl, err := arm.NewClient(moduleName+".DevToolPortalsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DevToolPortalsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - devToolPortalName - The name of Dev Tool Portal. +// - devToolPortalResource - Parameters for the create or update operation +// - options - DevToolPortalsClientBeginCreateOrUpdateOptions contains the optional parameters for the DevToolPortalsClient.BeginCreateOrUpdate +// method. +func (client *DevToolPortalsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, devToolPortalResource DevToolPortalResource, options *DevToolPortalsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DevToolPortalsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, devToolPortalName, devToolPortalResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[DevToolPortalsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[DevToolPortalsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *DevToolPortalsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, devToolPortalResource DevToolPortalResource, options *DevToolPortalsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, devToolPortalName, devToolPortalResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DevToolPortalsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, devToolPortalResource DevToolPortalResource, options *DevToolPortalsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" + 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 devToolPortalName == "" { + return nil, errors.New("parameter devToolPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{devToolPortalName}", url.PathEscape(devToolPortalName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, devToolPortalResource) +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - devToolPortalName - The name of Dev Tool Portal. +// - options - DevToolPortalsClientBeginDeleteOptions contains the optional parameters for the DevToolPortalsClient.BeginDelete +// method. +func (client *DevToolPortalsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, options *DevToolPortalsClientBeginDeleteOptions) (*runtime.Poller[DevToolPortalsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, devToolPortalName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[DevToolPortalsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[DevToolPortalsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *DevToolPortalsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, options *DevToolPortalsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, devToolPortalName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DevToolPortalsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, options *DevToolPortalsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" + 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 devToolPortalName == "" { + return nil, errors.New("parameter devToolPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{devToolPortalName}", url.PathEscape(devToolPortalName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - devToolPortalName - The name of Dev Tool Portal. +// - options - DevToolPortalsClientGetOptions contains the optional parameters for the DevToolPortalsClient.Get method. +func (client *DevToolPortalsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, options *DevToolPortalsClientGetOptions) (DevToolPortalsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, devToolPortalName, options) + if err != nil { + return DevToolPortalsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DevToolPortalsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DevToolPortalsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DevToolPortalsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, devToolPortalName string, options *DevToolPortalsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals/{devToolPortalName}" + 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 devToolPortalName == "" { + return nil, errors.New("parameter devToolPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{devToolPortalName}", url.PathEscape(devToolPortalName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *DevToolPortalsClient) getHandleResponse(resp *http.Response) (DevToolPortalsClientGetResponse, error) { + result := DevToolPortalsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DevToolPortalResource); err != nil { + return DevToolPortalsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handles requests to list all resources in a Service. +// +// Generated from API version 2023-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 - DevToolPortalsClientListOptions contains the optional parameters for the DevToolPortalsClient.NewListPager method. +func (client *DevToolPortalsClient) NewListPager(resourceGroupName string, serviceName string, options *DevToolPortalsClientListOptions) *runtime.Pager[DevToolPortalsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DevToolPortalsClientListResponse]{ + More: func(page DevToolPortalsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DevToolPortalsClientListResponse) (DevToolPortalsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DevToolPortalsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DevToolPortalsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DevToolPortalsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DevToolPortalsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *DevToolPortalsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/DevToolPortals" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *DevToolPortalsClient) listHandleResponse(resp *http.Response) (DevToolPortalsClientListResponse, error) { + result := DevToolPortalsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DevToolPortalResourceCollection); err != nil { + return DevToolPortalsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client_example_test.go new file mode 100644 index 000000000000..7b603d898bcc --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/devtoolportals_client_example_test.go @@ -0,0 +1,263 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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/gatewaycustomdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go new file mode 100644 index 000000000000..9acf6bfbaa10 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client.go @@ -0,0 +1,344 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// GatewayCustomDomainsClient contains the methods for the GatewayCustomDomains group. +// Don't use this type directly, use NewGatewayCustomDomainsClient() instead. +type GatewayCustomDomainsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewGatewayCustomDomainsClient creates a new instance of GatewayCustomDomainsClient 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 NewGatewayCustomDomainsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayCustomDomainsClient, error) { + cl, err := arm.NewClient(moduleName+".GatewayCustomDomainsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GatewayCustomDomainsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that 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. +// - domainName - The name of the Spring Cloud Gateway custom domain. +// - gatewayCustomDomainResource - The gateway custom domain resource for the create or update operation +// - options - GatewayCustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewayCustomDomainsClient.BeginCreateOrUpdate +// method. +func (client *GatewayCustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, gatewayCustomDomainResource GatewayCustomDomainResource, options *GatewayCustomDomainsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewayCustomDomainsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GatewayCustomDomainsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[GatewayCustomDomainsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *GatewayCustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, gatewayCustomDomainResource GatewayCustomDomainResource, options *GatewayCustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GatewayCustomDomainsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, gatewayCustomDomainResource GatewayCustomDomainResource, options *GatewayCustomDomainsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" + 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)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, gatewayCustomDomainResource) +} + +// 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 +// - resourceGroupName - The name of the resource group that 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. +// - domainName - The name of the Spring Cloud Gateway custom domain. +// - options - GatewayCustomDomainsClientBeginDeleteOptions contains the optional parameters for the GatewayCustomDomainsClient.BeginDelete +// method. +func (client *GatewayCustomDomainsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientBeginDeleteOptions) (*runtime.Poller[GatewayCustomDomainsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, gatewayName, domainName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GatewayCustomDomainsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[GatewayCustomDomainsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *GatewayCustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, domainName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *GatewayCustomDomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" + 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)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that 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. +// - domainName - The name of the Spring Cloud Gateway custom domain. +// - options - GatewayCustomDomainsClientGetOptions contains the optional parameters for the GatewayCustomDomainsClient.Get +// method. +func (client *GatewayCustomDomainsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientGetOptions) (GatewayCustomDomainsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, domainName, options) + if err != nil { + return GatewayCustomDomainsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GatewayCustomDomainsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewayCustomDomainsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *GatewayCustomDomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" + 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)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *GatewayCustomDomainsClient) getHandleResponse(resp *http.Response) (GatewayCustomDomainsClientGetResponse, error) { + result := GatewayCustomDomainsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayCustomDomainResource); err != nil { + return GatewayCustomDomainsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handle requests to list all Spring Cloud Gateway custom domains. +// +// Generated from API version 2023-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 - GatewayCustomDomainsClientListOptions contains the optional parameters for the GatewayCustomDomainsClient.NewListPager +// method. +func (client *GatewayCustomDomainsClient) NewListPager(resourceGroupName string, serviceName string, gatewayName string, options *GatewayCustomDomainsClientListOptions) *runtime.Pager[GatewayCustomDomainsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GatewayCustomDomainsClientListResponse]{ + More: func(page GatewayCustomDomainsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GatewayCustomDomainsClientListResponse) (GatewayCustomDomainsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GatewayCustomDomainsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GatewayCustomDomainsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewayCustomDomainsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *GatewayCustomDomainsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewayCustomDomainsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *GatewayCustomDomainsClient) listHandleResponse(resp *http.Response) (GatewayCustomDomainsClientListResponse, error) { + result := GatewayCustomDomainsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayCustomDomainResourceCollection); err != nil { + return GatewayCustomDomainsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client_example_test.go new file mode 100644 index 000000000000..de37593b139c --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/gatewaycustomdomains_client_example_test.go @@ -0,0 +1,164 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 new file mode 100644 index 000000000000..90d505522e67 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client.go @@ -0,0 +1,345 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// GatewayRouteConfigsClient contains the methods for the GatewayRouteConfigs group. +// Don't use this type directly, use NewGatewayRouteConfigsClient() instead. +type GatewayRouteConfigsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewGatewayRouteConfigsClient creates a new instance of GatewayRouteConfigsClient 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 NewGatewayRouteConfigsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayRouteConfigsClient, error) { + cl, err := arm.NewClient(moduleName+".GatewayRouteConfigsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GatewayRouteConfigsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway +// route configs. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - routeConfigName - The name of the Spring Cloud Gateway route config. +// - gatewayRouteConfigResource - The Spring Cloud Gateway route config for the create or update operation +// - options - GatewayRouteConfigsClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewayRouteConfigsClient.BeginCreateOrUpdate +// method. +func (client *GatewayRouteConfigsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, gatewayRouteConfigResource GatewayRouteConfigResource, options *GatewayRouteConfigsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewayRouteConfigsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GatewayRouteConfigsClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[GatewayRouteConfigsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route +// configs. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GatewayRouteConfigsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, gatewayRouteConfigResource GatewayRouteConfigResource, options *GatewayRouteConfigsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" + 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)) + if routeConfigName == "" { + return nil, errors.New("parameter routeConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeConfigName}", url.PathEscape(routeConfigName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, gatewayRouteConfigResource) +} + +// 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 +// - resourceGroupName - The name of the resource group that 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. +// - routeConfigName - The name of the Spring Cloud Gateway route config. +// - options - GatewayRouteConfigsClientBeginDeleteOptions contains the optional parameters for the GatewayRouteConfigsClient.BeginDelete +// method. +func (client *GatewayRouteConfigsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientBeginDeleteOptions) (*runtime.Poller[GatewayRouteConfigsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GatewayRouteConfigsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[GatewayRouteConfigsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *GatewayRouteConfigsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *GatewayRouteConfigsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" + 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)) + if routeConfigName == "" { + return nil, errors.New("parameter routeConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeConfigName}", url.PathEscape(routeConfigName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that 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. +// - routeConfigName - The name of the Spring Cloud Gateway route config. +// - options - GatewayRouteConfigsClientGetOptions contains the optional parameters for the GatewayRouteConfigsClient.Get method. +func (client *GatewayRouteConfigsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientGetOptions) (GatewayRouteConfigsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, options) + if err != nil { + return GatewayRouteConfigsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GatewayRouteConfigsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewayRouteConfigsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *GatewayRouteConfigsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" + 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)) + if routeConfigName == "" { + return nil, errors.New("parameter routeConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeConfigName}", url.PathEscape(routeConfigName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *GatewayRouteConfigsClient) getHandleResponse(resp *http.Response) (GatewayRouteConfigsClientGetResponse, error) { + result := GatewayRouteConfigsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayRouteConfigResource); err != nil { + return GatewayRouteConfigsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handle requests to list all Spring Cloud Gateway route configs. +// +// Generated from API version 2023-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 - GatewayRouteConfigsClientListOptions contains the optional parameters for the GatewayRouteConfigsClient.NewListPager +// method. +func (client *GatewayRouteConfigsClient) NewListPager(resourceGroupName string, serviceName string, gatewayName string, options *GatewayRouteConfigsClientListOptions) *runtime.Pager[GatewayRouteConfigsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GatewayRouteConfigsClientListResponse]{ + More: func(page GatewayRouteConfigsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GatewayRouteConfigsClientListResponse) (GatewayRouteConfigsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GatewayRouteConfigsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GatewayRouteConfigsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewayRouteConfigsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *GatewayRouteConfigsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewayRouteConfigsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *GatewayRouteConfigsClient) listHandleResponse(resp *http.Response) (GatewayRouteConfigsClientListResponse, error) { + result := GatewayRouteConfigsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayRouteConfigResourceCollection); err != nil { + return GatewayRouteConfigsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client_example_test.go new file mode 100644 index 000000000000..493aebb6dbd4 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/gatewayrouteconfigs_client_example_test.go @@ -0,0 +1,223 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 new file mode 100644 index 000000000000..275f4933c785 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/gateways_client.go @@ -0,0 +1,522 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// GatewaysClient contains the methods for the Gateways group. +// Don't use this type directly, use NewGatewaysClient() instead. +type GatewaysClient struct { + internal *arm.Client + subscriptionID string +} + +// NewGatewaysClient creates a new instance of GatewaysClient 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 NewGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewaysClient, error) { + cl, err := arm.NewClient(moduleName+".GatewaysClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GatewaysClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that 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. +// - gatewayResource - The gateway for the create or update operation +// - options - GatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewaysClient.BeginCreateOrUpdate +// method. +func (client *GatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayResource GatewayResource, options *GatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewaysClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, gatewayName, gatewayResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GatewaysClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[GatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *GatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayResource GatewayResource, options *GatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, gatewayResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayResource GatewayResource, options *GatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" + 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, gatewayResource) +} + +// 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 +// - resourceGroupName - The name of the resource group that 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 - GatewaysClientBeginDeleteOptions contains the optional parameters for the GatewaysClient.BeginDelete method. +func (client *GatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*runtime.Poller[GatewaysClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, gatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GatewaysClientDeleteResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[GatewaysClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *GatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *GatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" + 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.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - gatewayName - The name of Spring Cloud Gateway. +// - options - GatewaysClientGetOptions contains the optional parameters for the GatewaysClient.Get method. +func (client *GatewaysClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientGetOptions) (GatewaysClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) + if err != nil { + return GatewaysClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GatewaysClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewaysClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *GatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *GatewaysClient) getHandleResponse(resp *http.Response) (GatewaysClientGetResponse, error) { + result := GatewaysClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayResource); err != nil { + return GatewaysClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handles requests to list all resources in a Service. +// +// Generated from API version 2023-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 - GatewaysClientListOptions contains the optional parameters for the GatewaysClient.NewListPager method. +func (client *GatewaysClient) NewListPager(resourceGroupName string, serviceName string, options *GatewaysClientListOptions) *runtime.Pager[GatewaysClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GatewaysClientListResponse]{ + More: func(page GatewaysClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GatewaysClientListResponse) (GatewaysClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GatewaysClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GatewaysClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewaysClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *GatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *GatewaysClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *GatewaysClient) listHandleResponse(resp *http.Response) (GatewaysClientListResponse, error) { + result := GatewaysClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayResourceCollection); err != nil { + return GatewaysClientListResponse{}, err + } + return result, nil +} + +// 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 +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serviceName - The name of the Service resource. +// - gatewayName - The name of Spring Cloud Gateway. +// - options - GatewaysClientListEnvSecretsOptions contains the optional parameters for the GatewaysClient.ListEnvSecrets method. +func (client *GatewaysClient) ListEnvSecrets(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientListEnvSecretsOptions) (GatewaysClientListEnvSecretsResponse, error) { + req, err := client.listEnvSecretsCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) + if err != nil { + return GatewaysClientListEnvSecretsResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GatewaysClientListEnvSecretsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewaysClientListEnvSecretsResponse{}, runtime.NewResponseError(resp) + } + return client.listEnvSecretsHandleResponse(resp) +} + +// listEnvSecretsCreateRequest creates the ListEnvSecrets request. +func (client *GatewaysClient) listEnvSecretsCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientListEnvSecretsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/listEnvSecrets" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listEnvSecretsHandleResponse handles the ListEnvSecrets response. +func (client *GatewaysClient) listEnvSecretsHandleResponse(resp *http.Response) (GatewaysClientListEnvSecretsResponse, error) { + result := GatewaysClientListEnvSecretsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Value); err != nil { + return GatewaysClientListEnvSecretsResponse{}, err + } + return result, 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 +// - resourceGroupName - The name of the resource group that 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. +// - gatewayCapacityResource - The gateway capacity for the update operation +// - options - GatewaysClientBeginUpdateCapacityOptions contains the optional parameters for the GatewaysClient.BeginUpdateCapacity +// method. +func (client *GatewaysClient) BeginUpdateCapacity(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayCapacityResource SKUObject, options *GatewaysClientBeginUpdateCapacityOptions) (*runtime.Poller[GatewaysClientUpdateCapacityResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateCapacity(ctx, resourceGroupName, serviceName, gatewayName, gatewayCapacityResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GatewaysClientUpdateCapacityResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[GatewaysClientUpdateCapacityResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *GatewaysClient) updateCapacity(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayCapacityResource SKUObject, options *GatewaysClientBeginUpdateCapacityOptions) (*http.Response, error) { + req, err := client.updateCapacityCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, gatewayCapacityResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCapacityCreateRequest creates the UpdateCapacity request. +func (client *GatewaysClient) updateCapacityCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayCapacityResource SKUObject, options *GatewaysClientBeginUpdateCapacityOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" + 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.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, gatewayCapacityResource) +} + +// 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 +// - resourceGroupName - The name of the resource group that 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. +// - validatePayload - Custom domain payload to be validated +// - options - GatewaysClientValidateDomainOptions contains the optional parameters for the GatewaysClient.ValidateDomain method. +func (client *GatewaysClient) ValidateDomain(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, validatePayload CustomDomainValidatePayload, options *GatewaysClientValidateDomainOptions) (GatewaysClientValidateDomainResponse, error) { + req, err := client.validateDomainCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, validatePayload, options) + if err != nil { + return GatewaysClientValidateDomainResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GatewaysClientValidateDomainResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewaysClientValidateDomainResponse{}, runtime.NewResponseError(resp) + } + return client.validateDomainHandleResponse(resp) +} + +// validateDomainCreateRequest creates the ValidateDomain request. +func (client *GatewaysClient) validateDomainCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, validatePayload CustomDomainValidatePayload, options *GatewaysClientValidateDomainOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, validatePayload) +} + +// validateDomainHandleResponse handles the ValidateDomain response. +func (client *GatewaysClient) validateDomainHandleResponse(resp *http.Response) (GatewaysClientValidateDomainResponse, error) { + result := GatewaysClientValidateDomainResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomDomainValidateResult); err != nil { + return GatewaysClientValidateDomainResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/gateways_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/gateways_client_example_test.go new file mode 100644 index 000000000000..402dcf47af7c --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/gateways_client_example_test.go @@ -0,0 +1,412 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 074279dcde55..f0e2aa6cad47 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/go.mod +++ b/sdk/resourcemanager/appplatform/armappplatform/go.mod @@ -1,4 +1,4 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform/v2 go 1.18 diff --git a/sdk/resourcemanager/appplatform/armappplatform/models.go b/sdk/resourcemanager/appplatform/armappplatform/models.go index 29d2274f8f08..284ee43869f5 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/models.go +++ b/sdk/resourcemanager/appplatform/armappplatform/models.go @@ -11,82 +11,550 @@ package armappplatform import "time" +// APIPortalCustomDomainProperties - The properties of custom domain for API portal +type APIPortalCustomDomainProperties struct { + // The thumbprint of bound certificate. + Thumbprint *string +} + +// APIPortalCustomDomainResource - Custom domain of the API portal +type APIPortalCustomDomainResource struct { + // The properties of custom domain for API portal + Properties *APIPortalCustomDomainProperties + + // 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 +} + +// APIPortalCustomDomainResourceCollection - Object that includes an array of API portal custom domain resources and a possible +// link for next set +type APIPortalCustomDomainResourceCollection 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 API portal custom domain resources + Value []*APIPortalCustomDomainResource +} + +// APIPortalCustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the APIPortalCustomDomainsClient.BeginCreateOrUpdate +// method. +type APIPortalCustomDomainsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIPortalCustomDomainsClientBeginDeleteOptions contains the optional parameters for the APIPortalCustomDomainsClient.BeginDelete +// method. +type APIPortalCustomDomainsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIPortalCustomDomainsClientGetOptions contains the optional parameters for the APIPortalCustomDomainsClient.Get method. +type APIPortalCustomDomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIPortalCustomDomainsClientListOptions contains the optional parameters for the APIPortalCustomDomainsClient.NewListPager +// method. +type APIPortalCustomDomainsClientListOptions struct { + // placeholder for future optional parameters +} + +// APIPortalInstance - Collection of instances belong to the API portal +type APIPortalInstance struct { + // READ-ONLY; Name of the API portal instance + Name *string + + // READ-ONLY; Status of the API portal instance + Status *string +} + +// APIPortalProperties - API portal properties payload +type APIPortalProperties struct { + // The array of resource Ids of gateway to integrate with API portal. + GatewayIDs []*string + + // Indicate if only https is allowed. + HTTPSOnly *bool + + // Indicates whether the API portal exposes endpoint. + Public *bool + + // Collection of OpenAPI source URL locations. + SourceUrls []*string + + // Single sign-on related configuration + SsoProperties *SsoProperties + + // READ-ONLY; Collection of instances belong to API portal. + Instances []*APIPortalInstance + + // READ-ONLY; State of the API portal. + ProvisioningState *APIPortalProvisioningState + + // READ-ONLY; The requested resource quantity for required CPU and Memory. + ResourceRequests *APIPortalResourceRequests + + // READ-ONLY; URL of the API portal, exposed when 'public' is true. + URL *string +} + +// APIPortalResource - API portal resource +type APIPortalResource struct { + // API portal properties payload + Properties *APIPortalProperties + + // Sku of the API portal resource + SKU *SKU + + // 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 +} + +// APIPortalResourceCollection - Object that includes an array of API portal resources and a possible link for next set +type APIPortalResourceCollection 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 API portal resources + Value []*APIPortalResource +} + +// APIPortalResourceRequests - Resource requests of the API portal +type APIPortalResourceRequests struct { + // READ-ONLY; Cpu allocated to each API portal instance + CPU *string + + // READ-ONLY; Memory allocated to each API portal instance + Memory *string +} + +// APIPortalsClientBeginCreateOrUpdateOptions contains the optional parameters for the APIPortalsClient.BeginCreateOrUpdate +// method. +type APIPortalsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIPortalsClientBeginDeleteOptions contains the optional parameters for the APIPortalsClient.BeginDelete method. +type APIPortalsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIPortalsClientGetOptions contains the optional parameters for the APIPortalsClient.Get method. +type APIPortalsClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIPortalsClientListOptions contains the optional parameters for the APIPortalsClient.NewListPager method. +type APIPortalsClientListOptions struct { + // placeholder for future optional parameters +} + +// APIPortalsClientValidateDomainOptions contains the optional parameters for the APIPortalsClient.ValidateDomain method. +type APIPortalsClientValidateDomainOptions struct { + // placeholder for future optional parameters +} + +// AcceleratorAuthSettingClassification provides polymorphic access to related types. +// Call the interface's GetAcceleratorAuthSetting() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AcceleratorAuthSetting, *AcceleratorBasicAuthSetting, *AcceleratorPublicSetting, *AcceleratorSSHSetting +type AcceleratorAuthSettingClassification interface { + // GetAcceleratorAuthSetting returns the AcceleratorAuthSetting content of the underlying type. + GetAcceleratorAuthSetting() *AcceleratorAuthSetting +} + +// AcceleratorAuthSetting - Auth setting payload. +type AcceleratorAuthSetting struct { + // REQUIRED; The type of the auth setting. + AuthType *string +} + +// GetAcceleratorAuthSetting implements the AcceleratorAuthSettingClassification interface for type AcceleratorAuthSetting. +func (a *AcceleratorAuthSetting) GetAcceleratorAuthSetting() *AcceleratorAuthSetting { return a } + +// AcceleratorBasicAuthSetting - Auth setting for basic auth. +type AcceleratorBasicAuthSetting struct { + // REQUIRED; The type of the auth setting. + AuthType *string + + // REQUIRED; Username of git repository basic auth. + Username *string + + // Password of git repository basic auth. + Password *string +} + +// GetAcceleratorAuthSetting implements the AcceleratorAuthSettingClassification interface for type AcceleratorBasicAuthSetting. +func (a *AcceleratorBasicAuthSetting) GetAcceleratorAuthSetting() *AcceleratorAuthSetting { + return &AcceleratorAuthSetting{ + AuthType: a.AuthType, + } +} + +type AcceleratorGitRepository struct { + // REQUIRED; Properties of the auth setting payload. + AuthSetting AcceleratorAuthSettingClassification + + // REQUIRED; Git repository URL for the accelerator. + URL *string + + // Git repository branch to be used. + Branch *string + + // Git repository commit to be used. + Commit *string + + // Git repository tag to be used. + GitTag *string + + // Interval for checking for updates to Git or image repository. + IntervalInSeconds *int32 +} + +// AcceleratorPublicSetting - Auth setting for public url. +type AcceleratorPublicSetting struct { + // REQUIRED; The type of the auth setting. + AuthType *string +} + +// GetAcceleratorAuthSetting implements the AcceleratorAuthSettingClassification interface for type AcceleratorPublicSetting. +func (a *AcceleratorPublicSetting) GetAcceleratorAuthSetting() *AcceleratorAuthSetting { + return &AcceleratorAuthSetting{ + AuthType: a.AuthType, + } +} + +// AcceleratorSSHSetting - Auth setting for SSH auth. +type AcceleratorSSHSetting struct { + // REQUIRED; The type of the auth setting. + AuthType *string + + // Public SSH Key of git repository. + HostKey *string + + // SSH Key algorithm of git repository. + HostKeyAlgorithm *string + + // Private SSH Key algorithm of git repository. + PrivateKey *string +} + +// GetAcceleratorAuthSetting implements the AcceleratorAuthSettingClassification interface for type AcceleratorSSHSetting. +func (a *AcceleratorSSHSetting) GetAcceleratorAuthSetting() *AcceleratorAuthSetting { + return &AcceleratorAuthSetting{ + AuthType: a.AuthType, + } +} + // ActiveDeploymentCollection - Object that includes an array of Deployment resource name and set them as active. type ActiveDeploymentCollection struct { // Collection of Deployment name. - ActiveDeploymentNames []*string `json:"activeDeploymentNames,omitempty"` + ActiveDeploymentNames []*string } // AppResource - App resource payload type AppResource struct { // The Managed Identity type of the app resource - Identity *ManagedIdentityProperties `json:"identity,omitempty"` + Identity *ManagedIdentityProperties // The GEO location of the application, always the same with its parent resource - Location *string `json:"location,omitempty"` + Location *string // Properties of the App resource - Properties *AppResourceProperties `json:"properties,omitempty"` + Properties *AppResourceProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // AppResourceCollection - Object that includes an array of App resources and a possible link for next set type AppResourceCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of App resources - Value []*AppResource `json:"value,omitempty"` + Value []*AppResource } // AppResourceProperties - App resource properties payload type AppResourceProperties struct { // Collection of addons - AddonConfigs map[string]map[string]any `json:"addonConfigs,omitempty"` + AddonConfigs map[string]any - // Indicate if end to end TLS is enabled. - EnableEndToEndTLS *bool `json:"enableEndToEndTLS,omitempty"` + // List of custom persistent disks + CustomPersistentDisks []*CustomPersistentDiskResource - // Fully qualified dns Name. - Fqdn *string `json:"fqdn,omitempty"` + // Indicate if end to end TLS is enabled. + EnableEndToEndTLS *bool // Indicate if only https is allowed. - HTTPSOnly *bool `json:"httpsOnly,omitempty"` + HTTPSOnly *bool + + // App ingress settings payload. + IngressSettings *IngressSettings // Collection of loaded certificates - LoadedCertificates []*LoadedCertificate `json:"loadedCertificates,omitempty"` + LoadedCertificates []*LoadedCertificate // Persistent disk settings - PersistentDisk *PersistentDisk `json:"persistentDisk,omitempty"` + PersistentDisk *PersistentDisk // Indicates whether the App exposes public endpoint - Public *bool `json:"public,omitempty"` + Public *bool + + // Collection of auth secrets + Secrets []*Secret // Temporary disk settings - TemporaryDisk *TemporaryDisk `json:"temporaryDisk,omitempty"` + TemporaryDisk *TemporaryDisk + + // Additional App settings in vnet injection instance + VnetAddons *AppVNetAddons + + // READ-ONLY; Fully qualified dns Name. + Fqdn *string // READ-ONLY; Provisioning state of the App - ProvisioningState *AppResourceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *AppResourceProvisioningState // READ-ONLY; URL of the App - URL *string `json:"url,omitempty" azure:"ro"` + URL *string +} + +// AppVNetAddons - Additional App settings in vnet injection instance +type AppVNetAddons struct { + // Indicates whether the App in vnet injection instance exposes endpoint which could be accessed from internet. + PublicEndpoint *bool + + // READ-ONLY; URL of the App in vnet injection instance which could be accessed from internet + PublicEndpointURL *string +} + +type ApplicationAcceleratorComponent struct { + ResourceRequests *ApplicationAcceleratorResourceRequests + + // READ-ONLY + Instances []*ApplicationAcceleratorInstance + + // READ-ONLY + Name *string +} + +type ApplicationAcceleratorInstance struct { + // READ-ONLY; Name of the Application Accelerator instance. + Name *string + + // READ-ONLY; Status of the Application Accelerator instance. It can be Pending, Running, Succeeded, Failed, Unknown. + Status *string +} + +// ApplicationAcceleratorProperties - Application accelerator properties payload +type ApplicationAcceleratorProperties struct { + // READ-ONLY; Collection of components belong to application accelerator. + Components []*ApplicationAcceleratorComponent + + // READ-ONLY; State of the application accelerator. + ProvisioningState *ApplicationAcceleratorProvisioningState +} + +// ApplicationAcceleratorResource - Application accelerator resource +type ApplicationAcceleratorResource struct { + // Application accelerator properties payload + Properties *ApplicationAcceleratorProperties + + // Sku of the application accelerator resource + SKU *SKU + + // 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 +} + +// ApplicationAcceleratorResourceCollection - Object that includes an array of application accelerator resources and a possible +// link for next set +type ApplicationAcceleratorResourceCollection 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 application accelerator resources + Value []*ApplicationAcceleratorResource +} + +type ApplicationAcceleratorResourceRequests struct { + // READ-ONLY; Cpu allocated to each application accelerator component. 1 core can be represented by 1 or 1000m + CPU *string + + // READ-ONLY; Instance count of the application accelerator component. + InstanceCount *int32 + + // READ-ONLY; Memory allocated to each application accelerator component. 1 GB can be represented by 1Gi or 1024Mi. + Memory *string +} + +// ApplicationAcceleratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationAcceleratorsClient.BeginCreateOrUpdate +// method. +type ApplicationAcceleratorsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationAcceleratorsClientBeginDeleteOptions contains the optional parameters for the ApplicationAcceleratorsClient.BeginDelete +// method. +type ApplicationAcceleratorsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationAcceleratorsClientGetOptions contains the optional parameters for the ApplicationAcceleratorsClient.Get method. +type ApplicationAcceleratorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationAcceleratorsClientListOptions contains the optional parameters for the ApplicationAcceleratorsClient.NewListPager +// method. +type ApplicationAcceleratorsClientListOptions struct { + // placeholder for future optional parameters } // ApplicationInsightsAgentVersions - Application Insights agent versions properties payload type ApplicationInsightsAgentVersions struct { // READ-ONLY; Indicates the version of application insight java agent - Java *string `json:"java,omitempty" azure:"ro"` + Java *string +} + +// ApplicationLiveViewComponent - Application Live View properties payload +type ApplicationLiveViewComponent struct { + // READ-ONLY; Collection of instances belong to Application Live View. + Instances []*ApplicationLiveViewInstance + + // READ-ONLY; Name of the component. + Name any + + // READ-ONLY; The requested resource quantity for required CPU and Memory. + ResourceRequests *ApplicationLiveViewResourceRequests +} + +// ApplicationLiveViewInstance - Collection of instances belong to the Application Live View +type ApplicationLiveViewInstance struct { + // READ-ONLY; Name of the Application Live View instance. + Name *string + + // READ-ONLY; Status of the Application Live View instance. It can be Pending, Running, Succeeded, Failed, Unknown. + Status *string +} + +// ApplicationLiveViewProperties - Application Live View properties payload +type ApplicationLiveViewProperties struct { + // READ-ONLY; Component details of Application Live View + Components []*ApplicationLiveViewComponent + + // READ-ONLY; State of the Application Live View. + ProvisioningState *ApplicationLiveViewProvisioningState +} + +// ApplicationLiveViewResource - Application Live View resource +type ApplicationLiveViewResource struct { + // Application Live View properties payload + Properties *ApplicationLiveViewProperties + + // 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 +} + +// ApplicationLiveViewResourceCollection - Object that includes an array of Application Live View resources and a possible +// link for next set +type ApplicationLiveViewResourceCollection 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 Application Live View resources + Value []*ApplicationLiveViewResource +} + +// ApplicationLiveViewResourceRequests - The resource quantity for required CPU and Memory of Application Live View component +type ApplicationLiveViewResourceRequests struct { + // READ-ONLY; Cpu quantity allocated to each Application Live View component instance. 1 core can be represented by 1 or 1000m. + CPU *string + + // READ-ONLY; Desired instance count of Application Live View component instance. + InstanceCount *int32 + + // READ-ONLY; Memory quantity allocated to each Application Live View component instance. 1 GB can be represented by 1Gi or + // 1024Mi. + Memory *string +} + +// ApplicationLiveViewsClientBeginCreateOrUpdateOptions contains the optional parameters for the ApplicationLiveViewsClient.BeginCreateOrUpdate +// method. +type ApplicationLiveViewsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationLiveViewsClientBeginDeleteOptions contains the optional parameters for the ApplicationLiveViewsClient.BeginDelete +// method. +type ApplicationLiveViewsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ApplicationLiveViewsClientGetOptions contains the optional parameters for the ApplicationLiveViewsClient.Get method. +type ApplicationLiveViewsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationLiveViewsClientListOptions contains the optional parameters for the ApplicationLiveViewsClient.NewListPager +// method. +type ApplicationLiveViewsClientListOptions struct { + // placeholder for future optional parameters } // AppsClientBeginCreateOrUpdateOptions contains the optional parameters for the AppsClient.BeginCreateOrUpdate method. @@ -138,69 +606,101 @@ type AppsClientValidateDomainOptions struct { // AvailableOperations - Available operations of the service type AvailableOperations struct { // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // Collection of available operation details - Value []*OperationDetail `json:"value,omitempty"` + Value []*OperationDetail } type AvailableRuntimeVersions struct { // READ-ONLY; A list of all supported runtime versions. - Value []*SupportedRuntimeVersion `json:"value,omitempty" azure:"ro"` + Value []*SupportedRuntimeVersion +} + +// AzureFileVolume - The properties of the Azure File volume. Azure File shares are mounted as volumes. +type AzureFileVolume struct { + // REQUIRED; The mount path of the persistent disk. + MountPath *string + + // REQUIRED; The type of the underlying resource to mount as a persistent disk. + Type *Type + + // If set to true, it will create and mount a dedicated directory for every individual app instance. + EnableSubPath *bool + + // These are the mount options for a persistent disk. + MountOptions []*string + + // Indicates whether the persistent disk is a readOnly one. + ReadOnly *bool + + // The share name of the Azure File share. + ShareName *string +} + +// GetCustomPersistentDiskProperties implements the CustomPersistentDiskPropertiesClassification interface for type AzureFileVolume. +func (a *AzureFileVolume) GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties { + return &CustomPersistentDiskProperties{ + Type: a.Type, + MountPath: a.MountPath, + ReadOnly: a.ReadOnly, + EnableSubPath: a.EnableSubPath, + MountOptions: a.MountOptions, + } } // BindingResource - Binding resource payload type BindingResource struct { // Properties of the Binding resource - Properties *BindingResourceProperties `json:"properties,omitempty"` + Properties *BindingResourceProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // BindingResourceCollection - Object that includes an array of Binding resources and a possible link for next set type BindingResourceCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of Binding resources - Value []*BindingResource `json:"value,omitempty"` + Value []*BindingResource } // BindingResourceProperties - Binding resource properties payload type BindingResourceProperties struct { // Binding parameters of the Binding resource - BindingParameters map[string]any `json:"bindingParameters,omitempty"` + BindingParameters map[string]*string // The key of the bound resource - Key *string `json:"key,omitempty"` + Key *string // The Azure resource id of the bound resource - ResourceID *string `json:"resourceId,omitempty"` + ResourceID *string // READ-ONLY; Creation time of the Binding resource - CreatedAt *string `json:"createdAt,omitempty" azure:"ro"` + CreatedAt *string // READ-ONLY; The generated Spring Boot property file for this binding. The secret will be deducted. - GeneratedProperties *string `json:"generatedProperties,omitempty" azure:"ro"` + GeneratedProperties *string // READ-ONLY; The name of the bound resource - ResourceName *string `json:"resourceName,omitempty" azure:"ro"` + ResourceName *string // READ-ONLY; The standard Azure resource type of the bound resource - ResourceType *string `json:"resourceType,omitempty" azure:"ro"` + ResourceType *string // READ-ONLY; Update time of the Binding resource - UpdatedAt *string `json:"updatedAt,omitempty" azure:"ro"` + UpdatedAt *string } // BindingsClientBeginCreateOrUpdateOptions contains the optional parameters for the BindingsClient.BeginCreateOrUpdate method. @@ -234,109 +734,126 @@ type BindingsClientListOptions struct { // Build resource payload type Build struct { // Properties of the build resource - Properties *BuildProperties `json:"properties,omitempty"` + Properties *BuildProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // BuildCollection - Object that includes an array of Build resources and a possible link for next set type BuildCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of Build resources - Value []*Build `json:"value,omitempty"` + Value []*Build } // BuildProperties - Build resource properties payload type BuildProperties struct { // The resource id of agent pool - AgentPool *string `json:"agentPool,omitempty"` + AgentPool *string // The resource id of builder to build the source code - Builder *string `json:"builder,omitempty"` + Builder *string // The environment variables for this build - Env map[string]*string `json:"env,omitempty"` + Env map[string]*string // The relative path of source code - RelativePath *string `json:"relativePath,omitempty"` + RelativePath *string + + // The customized build resource for this build + ResourceRequests *BuildResourceRequests // READ-ONLY; Provisioning state of the KPack build result - ProvisioningState *BuildProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *BuildProvisioningState // READ-ONLY; The build result triggered by this build - TriggeredBuildResult *TriggeredBuildResult `json:"triggeredBuildResult,omitempty" azure:"ro"` + TriggeredBuildResult *TriggeredBuildResult +} + +// BuildResourceRequests - Resource request payload of Build Resource. +type BuildResourceRequests struct { + // Optional Cpu allocated to the build resource. 1 core can be represented by 1 or 1000m. The default value is 1, this should + // not exceed build service agent pool cpu size. + CPU *string + + // Optional Memory allocated to the build resource. 1 GB can be represented by 1Gi or 1024Mi. The default value is 2Gi, this + // should not exceed build service agent pool memory size. + Memory *string } // BuildResult - Build result resource payload type BuildResult struct { // Properties of the build result resource - Properties *BuildResultProperties `json:"properties,omitempty"` + Properties *BuildResultProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // BuildResultCollection - Object that includes an array of Build result resources and a possible link for next set type BuildResultCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of Build result resources - Value []*BuildResult `json:"value,omitempty"` + Value []*BuildResult } // BuildResultLog - Build result log resource properties payload type BuildResultLog struct { // The public download URL of this build result log - BlobURL *string `json:"blobUrl,omitempty"` + BlobURL *string } // BuildResultProperties - Build result resource properties payload type BuildResultProperties struct { // The build pod name which can be used to get the build log streaming. - BuildPodName *string `json:"buildPodName,omitempty"` + BuildPodName *string + + // Error when build is failed. + Error *Error // The name of this build result - Name *string `json:"name,omitempty"` + Name *string // READ-ONLY; All of the build stage (init-container and container) resources in build pod. - BuildStages []*BuildStageProperties `json:"buildStages,omitempty" azure:"ro"` + BuildStages []*BuildStageProperties // READ-ONLY; Provisioning state of the KPack build result - ProvisioningState *BuildResultProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *BuildResultProvisioningState } // BuildResultUserSourceInfo - Reference to a build result type BuildResultUserSourceInfo struct { // REQUIRED; Type of the source uploaded - Type *string `json:"type,omitempty"` + Type *string // Resource id of an existing succeeded build result under the same Spring instance. - BuildResultID *string `json:"buildResultId,omitempty"` + BuildResultID *string // Version of the source - Version *string `json:"version,omitempty"` + Version *string } // GetUserSourceInfo implements the UserSourceInfoClassification interface for type BuildResultUserSourceInfo. @@ -350,19 +867,19 @@ func (b *BuildResultUserSourceInfo) GetUserSourceInfo() *UserSourceInfo { // BuildService - Build service resource payload type BuildService struct { // Properties of the build resource - Properties *BuildServiceProperties `json:"properties,omitempty"` + Properties *BuildServiceProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // BuildServiceAgentPoolClientBeginUpdatePutOptions contains the optional parameters for the BuildServiceAgentPoolClient.BeginUpdatePut @@ -386,50 +903,50 @@ type BuildServiceAgentPoolClientListOptions struct { // BuildServiceAgentPoolProperties - Build service agent pool properties type BuildServiceAgentPoolProperties struct { // build service agent pool size properties - PoolSize *BuildServiceAgentPoolSizeProperties `json:"poolSize,omitempty"` + PoolSize *BuildServiceAgentPoolSizeProperties // READ-ONLY; Provisioning state of the build service agent pool - ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *string } // BuildServiceAgentPoolResource - The build service agent pool resource type BuildServiceAgentPoolResource struct { // build service agent pool properties - Properties *BuildServiceAgentPoolProperties `json:"properties,omitempty"` + Properties *BuildServiceAgentPoolProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // BuildServiceAgentPoolResourceCollection - Object that includes an array of build service agent pool resources and a possible // link for next set type BuildServiceAgentPoolResourceCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of build service agent pool resource - Value []*BuildServiceAgentPoolResource `json:"value,omitempty"` + Value []*BuildServiceAgentPoolResource } // BuildServiceAgentPoolSizeProperties - Build service agent pool size properties type BuildServiceAgentPoolSizeProperties struct { // The name of build service agent pool size - Name *string `json:"name,omitempty"` + Name *string // READ-ONLY; The cpu property of build service agent pool size - CPU *string `json:"cpu,omitempty" azure:"ro"` + CPU *string // READ-ONLY; The memory property of build service agent pool size - Memory *string `json:"memory,omitempty" azure:"ro"` + Memory *string } // BuildServiceBuilderClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildServiceBuilderClient.BeginCreateOrUpdate @@ -451,6 +968,12 @@ type BuildServiceBuilderClientGetOptions struct { // placeholder for future optional parameters } +// BuildServiceBuilderClientListDeploymentsOptions contains the optional parameters for the BuildServiceBuilderClient.ListDeployments +// method. +type BuildServiceBuilderClientListDeploymentsOptions struct { + // placeholder for future optional parameters +} + // BuildServiceBuilderClientListOptions contains the optional parameters for the BuildServiceBuilderClient.NewListPager method. type BuildServiceBuilderClientListOptions struct { // placeholder for future optional parameters @@ -533,79 +1056,85 @@ type BuildServiceClientListSupportedStacksOptions struct { // BuildServiceCollection - Object that includes an array of Build service resources and a possible link for next set type BuildServiceCollection struct { // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // Collection of Build service resources - Value []*BuildService `json:"value,omitempty"` + Value []*BuildService } // BuildServiceProperties - Build service resource properties payload type BuildServiceProperties struct { // The installed KPack version in this build service. - KPackVersion *string `json:"kPackVersion,omitempty"` + KPackVersion *string // The runtime resource configuration of this build service. - ResourceRequests *BuildServicePropertiesResourceRequests `json:"resourceRequests,omitempty"` + ResourceRequests *BuildServicePropertiesResourceRequests // READ-ONLY; Provisioning state of the KPack build result - ProvisioningState *BuildServiceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *BuildServiceProvisioningState } // BuildServicePropertiesResourceRequests - The runtime resource configuration of this build service. type BuildServicePropertiesResourceRequests struct { // READ-ONLY; vCPU allocated to the entire build service node pool. - CPU *string `json:"cpu,omitempty" azure:"ro"` + CPU *string // READ-ONLY; Memory allocated to the entire build service node pool. - Memory *string `json:"memory,omitempty" azure:"ro"` + Memory *string } // BuildStageProperties - The build stage (init-container and container) resources in build pod. type BuildStageProperties struct { + // READ-ONLY; The exit code of this build init container. + ExitCode *string + // READ-ONLY; The name of this build stage resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string + + // READ-ONLY; The reason of this build init container. + Reason *string // READ-ONLY; The provisioning state of this build stage resource. - Status *KPackBuildStageProvisioningState `json:"status,omitempty" azure:"ro"` + Status *KPackBuildStageProvisioningState } // BuilderProperties - KPack Builder properties payload type BuilderProperties struct { // Builder buildpack groups. - BuildpackGroups []*BuildpacksGroupProperties `json:"buildpackGroups,omitempty"` + BuildpackGroups []*BuildpacksGroupProperties // Builder cluster stack property. - Stack *StackProperties `json:"stack,omitempty"` + Stack *StackProperties // READ-ONLY; Builder provision status. - ProvisioningState *BuilderProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *BuilderProvisioningState } // BuilderResource - KPack Builder resource type BuilderResource struct { // Property of the Builder resource. - Properties *BuilderProperties `json:"properties,omitempty"` + Properties *BuilderProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // BuilderResourceCollection - Object that includes an array of Builder resources and a possible link for next set type BuilderResourceCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of Builder resources - Value []*BuilderResource `json:"value,omitempty"` + Value []*BuilderResource } // BuildpackBindingClientBeginCreateOrUpdateOptions contains the optional parameters for the BuildpackBindingClient.BeginCreateOrUpdate @@ -626,6 +1155,12 @@ type BuildpackBindingClientGetOptions struct { // placeholder for future optional parameters } +// BuildpackBindingClientListForClusterOptions contains the optional parameters for the BuildpackBindingClient.NewListForClusterPager +// method. +type BuildpackBindingClientListForClusterOptions struct { + // placeholder for future optional parameters +} + // BuildpackBindingClientListOptions contains the optional parameters for the BuildpackBindingClient.NewListPager method. type BuildpackBindingClientListOptions struct { // placeholder for future optional parameters @@ -634,65 +1169,65 @@ type BuildpackBindingClientListOptions struct { // BuildpackBindingLaunchProperties - Buildpack Binding Launch Properties type BuildpackBindingLaunchProperties struct { // Non-sensitive properties for launchProperties - Properties map[string]*string `json:"properties,omitempty"` + Properties map[string]*string // Sensitive properties for launchProperties - Secrets map[string]*string `json:"secrets,omitempty"` + Secrets map[string]*string } // BuildpackBindingProperties - Properties of a buildpack binding type BuildpackBindingProperties struct { // Buildpack Binding Type - BindingType *BindingType `json:"bindingType,omitempty"` + BindingType *BindingType // The object describes the buildpack binding launch properties - LaunchProperties *BuildpackBindingLaunchProperties `json:"launchProperties,omitempty"` + LaunchProperties *BuildpackBindingLaunchProperties // READ-ONLY; State of the Buildpack Binding. - ProvisioningState *BuildpackBindingProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *BuildpackBindingProvisioningState } // BuildpackBindingResource - Buildpack Binding Resource object type BuildpackBindingResource struct { // Properties of a buildpack binding - Properties *BuildpackBindingProperties `json:"properties,omitempty"` + Properties *BuildpackBindingProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // BuildpackBindingResourceCollection - Object that includes an array of BuildpackBinding resources and a possible link for // next set type BuildpackBindingResourceCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of BuildpackBinding resources - Value []*BuildpackBindingResource `json:"value,omitempty"` + Value []*BuildpackBindingResource } // BuildpackProperties - Buildpack properties payload type BuildpackProperties struct { // Id of the buildpack - ID *string `json:"id,omitempty"` + ID *string } // BuildpacksGroupProperties - Buildpack group properties of the Builder type BuildpacksGroupProperties struct { // Buildpacks in the buildpack group - Buildpacks []*BuildpackProperties `json:"buildpacks,omitempty"` + Buildpacks []*BuildpackProperties // Buildpack group name - Name *string `json:"name,omitempty"` + Name *string } // CertificatePropertiesClassification provides polymorphic access to related types. @@ -707,28 +1242,31 @@ type CertificatePropertiesClassification interface { // CertificateProperties - Certificate resource payload. type CertificateProperties struct { // REQUIRED; The type of the certificate source. - Type *string `json:"type,omitempty"` + Type *string // READ-ONLY; The activate date of certificate. - ActivateDate *string `json:"activateDate,omitempty" azure:"ro"` + ActivateDate *string // READ-ONLY; The domain list of certificate. - DNSNames []*string `json:"dnsNames,omitempty" azure:"ro"` + DNSNames []*string // READ-ONLY; The expiration date of certificate. - ExpirationDate *string `json:"expirationDate,omitempty" azure:"ro"` + ExpirationDate *string // READ-ONLY; The issue date of certificate. - IssuedDate *string `json:"issuedDate,omitempty" azure:"ro"` + IssuedDate *string // READ-ONLY; The issuer of certificate. - Issuer *string `json:"issuer,omitempty" azure:"ro"` + Issuer *string + + // READ-ONLY; Provisioning state of the Certificate + ProvisioningState *CertificateResourceProvisioningState // READ-ONLY; The subject name of certificate. - SubjectName *string `json:"subjectName,omitempty" azure:"ro"` + SubjectName *string // READ-ONLY; The thumbprint of certificate. - Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` + Thumbprint *string } // GetCertificateProperties implements the CertificatePropertiesClassification interface for type CertificateProperties. @@ -737,28 +1275,28 @@ func (c *CertificateProperties) GetCertificateProperties() *CertificatePropertie // CertificateResource - Certificate resource payload. type CertificateResource struct { // Properties of the certificate resource payload. - Properties CertificatePropertiesClassification `json:"properties,omitempty"` + Properties CertificatePropertiesClassification // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // CertificateResourceCollection - Collection compose of certificate resources list and a possible link for next page. type CertificateResourceCollection struct { // The link to next page of certificate list. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The certificate resources list. - Value []*CertificateResource `json:"value,omitempty"` + Value []*CertificateResource } // CertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the CertificatesClient.BeginCreateOrUpdate @@ -786,111 +1324,126 @@ type CertificatesClientListOptions struct { // ClusterResourceProperties - Service properties payload type ClusterResourceProperties struct { + // The name of the resource group that contains the infrastructure resources + InfraResourceGroup *string + + // The resource Id of the Managed Environment that the Spring Apps instance builds on + ManagedEnvironmentID *string + + // Purchasing 3rd party product of the Service resource. + MarketplaceResource *MarketplaceResource + // Network profile of the Service - NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + NetworkProfile *NetworkProfile + + // Additional Service settings in vnet injection instance + VnetAddons *ServiceVNetAddons + ZoneRedundant *bool // READ-ONLY; Fully qualified dns name of the service instance - Fqdn *string `json:"fqdn,omitempty" azure:"ro"` + Fqdn *string + + // READ-ONLY; Power state of the Service + PowerState *PowerState // READ-ONLY; Provisioning state of the Service - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ProvisioningState // READ-ONLY; ServiceInstanceEntity GUID which uniquely identifies a created resource - ServiceID *string `json:"serviceId,omitempty" azure:"ro"` + ServiceID *string // READ-ONLY; Version of the Service - Version *int32 `json:"version,omitempty" azure:"ro"` + Version *int32 } // ConfigServerGitProperty - Property of git. type ConfigServerGitProperty struct { // REQUIRED; URI of the repository - URI *string `json:"uri,omitempty"` + URI *string // Public sshKey of git repository. - HostKey *string `json:"hostKey,omitempty"` + HostKey *string // SshKey algorithm of git repository. - HostKeyAlgorithm *string `json:"hostKeyAlgorithm,omitempty"` + HostKeyAlgorithm *string // Label of the repository - Label *string `json:"label,omitempty"` + Label *string // Password of git repository basic auth. - Password *string `json:"password,omitempty"` + Password *string // Private sshKey algorithm of git repository. - PrivateKey *string `json:"privateKey,omitempty"` + PrivateKey *string // Repositories of git. - Repositories []*GitPatternRepository `json:"repositories,omitempty"` + Repositories []*GitPatternRepository // Searching path of the repository - SearchPaths []*string `json:"searchPaths,omitempty"` + SearchPaths []*string // Strict host key checking or not. - StrictHostKeyChecking *bool `json:"strictHostKeyChecking,omitempty"` + StrictHostKeyChecking *bool // Username of git repository basic auth. - Username *string `json:"username,omitempty"` + Username *string } // ConfigServerProperties - Config server git properties payload type ConfigServerProperties struct { // Settings of config server. - ConfigServer *ConfigServerSettings `json:"configServer,omitempty"` + ConfigServer *ConfigServerSettings // Error when apply config server settings. - Error *Error `json:"error,omitempty"` + Error *Error // READ-ONLY; State of the config server. - ProvisioningState *ConfigServerState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ConfigServerState } // ConfigServerResource - Config Server resource type ConfigServerResource struct { // Properties of the Config Server resource - Properties *ConfigServerProperties `json:"properties,omitempty"` + Properties *ConfigServerProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ConfigServerSettings - The settings of config server. type ConfigServerSettings struct { // Property of git environment. - GitProperty *ConfigServerGitProperty `json:"gitProperty,omitempty"` + GitProperty *ConfigServerGitProperty } // ConfigServerSettingsErrorRecord - Error record of the config server settings type ConfigServerSettingsErrorRecord struct { // The detail error messages of the record - Messages []*string `json:"messages,omitempty"` + Messages []*string // The name of the config server settings error record - Name *string `json:"name,omitempty"` + Name *string // The uri of the config server settings error record - URI *string `json:"uri,omitempty"` + URI *string } // ConfigServerSettingsValidateResult - Validation result for config server settings type ConfigServerSettingsValidateResult struct { // The detail validation results - Details []*ConfigServerSettingsErrorRecord `json:"details,omitempty"` + Details []*ConfigServerSettingsErrorRecord // Indicate if the config server settings are valid - IsValid *bool `json:"isValid,omitempty"` + IsValid *bool } // ConfigServersClientBeginUpdatePatchOptions contains the optional parameters for the ConfigServersClient.BeginUpdatePatch @@ -920,128 +1473,128 @@ type ConfigServersClientGetOptions struct { // ConfigurationServiceGitProperty - Property of git environment. type ConfigurationServiceGitProperty struct { // Repositories of Application Configuration Service git property. - Repositories []*ConfigurationServiceGitRepository `json:"repositories,omitempty"` + Repositories []*ConfigurationServiceGitRepository } // ConfigurationServiceGitPropertyValidateResult - Validation result for configuration service settings type ConfigurationServiceGitPropertyValidateResult struct { // The detail validation results - GitReposValidationResult []*ValidationMessages `json:"gitReposValidationResult,omitempty"` + GitReposValidationResult []*ValidationMessages // Indicate if the configuration service settings are valid - IsValid *bool `json:"isValid,omitempty"` + IsValid *bool } // ConfigurationServiceGitRepository - Git repository property payload for Application Configuration Service type ConfigurationServiceGitRepository struct { // REQUIRED; Label of the repository - Label *string `json:"label,omitempty"` + Label *string // REQUIRED; Name of the repository - Name *string `json:"name,omitempty"` + Name *string // REQUIRED; Collection of patterns of the repository - Patterns []*string `json:"patterns,omitempty"` + Patterns []*string // REQUIRED; URI of the repository - URI *string `json:"uri,omitempty"` + URI *string // Public sshKey of git repository. - HostKey *string `json:"hostKey,omitempty"` + HostKey *string // SshKey algorithm of git repository. - HostKeyAlgorithm *string `json:"hostKeyAlgorithm,omitempty"` + HostKeyAlgorithm *string // Password of git repository basic auth. - Password *string `json:"password,omitempty"` + Password *string // Private sshKey algorithm of git repository. - PrivateKey *string `json:"privateKey,omitempty"` + PrivateKey *string // Searching path of the repository - SearchPaths []*string `json:"searchPaths,omitempty"` + SearchPaths []*string // Strict host key checking or not. - StrictHostKeyChecking *bool `json:"strictHostKeyChecking,omitempty"` + StrictHostKeyChecking *bool // Username of git repository basic auth. - Username *string `json:"username,omitempty"` + Username *string } // ConfigurationServiceInstance - Collection of instances belong to the Application Configuration Service type ConfigurationServiceInstance struct { // READ-ONLY; Name of the Application Configuration Service instance - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Status of the Application Configuration Service instance - Status *string `json:"status,omitempty" azure:"ro"` + Status *string } // ConfigurationServiceProperties - Application Configuration Service properties payload type ConfigurationServiceProperties struct { // The settings of Application Configuration Service. - Settings *ConfigurationServiceSettings `json:"settings,omitempty"` + Settings *ConfigurationServiceSettings // READ-ONLY; Collection of instances belong to Application Configuration Service. - Instances []*ConfigurationServiceInstance `json:"instances,omitempty" azure:"ro"` + Instances []*ConfigurationServiceInstance // READ-ONLY; State of the Application Configuration Service. - ProvisioningState *ConfigurationServiceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ConfigurationServiceProvisioningState // READ-ONLY; The requested resource quantity for required CPU and Memory. - ResourceRequests *ConfigurationServiceResourceRequests `json:"resourceRequests,omitempty" azure:"ro"` + ResourceRequests *ConfigurationServiceResourceRequests } // ConfigurationServiceResource - Application Configuration Service resource type ConfigurationServiceResource struct { // Application Configuration Service properties payload - Properties *ConfigurationServiceProperties `json:"properties,omitempty"` + Properties *ConfigurationServiceProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ConfigurationServiceResourceCollection - Object that includes an array of configuration service resources and a possible // link for next set type ConfigurationServiceResourceCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of configuration service resources - Value []*ConfigurationServiceResource `json:"value,omitempty"` + Value []*ConfigurationServiceResource } // ConfigurationServiceResourceRequests - Resource request payload of Application Configuration Service type ConfigurationServiceResourceRequests struct { // READ-ONLY; Cpu allocated to each Application Configuration Service instance - CPU *string `json:"cpu,omitempty" azure:"ro"` + CPU *string // READ-ONLY; Instance count of the Application Configuration Service - InstanceCount *int32 `json:"instanceCount,omitempty" azure:"ro"` + InstanceCount *int32 // READ-ONLY; Memory allocated to each Application Configuration Service instance - Memory *string `json:"memory,omitempty" azure:"ro"` + Memory *string } // ConfigurationServiceSettings - The settings of Application Configuration Service. type ConfigurationServiceSettings struct { // Property of git environment. - GitProperty *ConfigurationServiceGitProperty `json:"gitProperty,omitempty"` + GitProperty *ConfigurationServiceGitProperty } // ConfigurationServiceSettingsValidateResult - Validation result for configuration service settings type ConfigurationServiceSettingsValidateResult struct { // Validation result for configuration service settings - GitPropertyValidationResult *ConfigurationServiceGitPropertyValidateResult `json:"gitPropertyValidationResult,omitempty"` + GitPropertyValidationResult *ConfigurationServiceGitPropertyValidateResult } // ConfigurationServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ConfigurationServicesClient.BeginCreateOrUpdate @@ -1076,102 +1629,156 @@ type ConfigurationServicesClientListOptions struct { // placeholder for future optional parameters } +// ContainerProbeSettings - Container liveness and readiness probe settings +type ContainerProbeSettings struct { + // Indicates whether disable the liveness and readiness probe + DisableProbe *bool +} + // ContentCertificateProperties - Properties of certificate imported from key vault. type ContentCertificateProperties struct { // REQUIRED; The type of the certificate source. - Type *string `json:"type,omitempty"` + Type *string // The content of uploaded certificate. - Content *string `json:"content,omitempty"` + Content *string // READ-ONLY; The activate date of certificate. - ActivateDate *string `json:"activateDate,omitempty" azure:"ro"` + ActivateDate *string // READ-ONLY; The domain list of certificate. - DNSNames []*string `json:"dnsNames,omitempty" azure:"ro"` + DNSNames []*string // READ-ONLY; The expiration date of certificate. - ExpirationDate *string `json:"expirationDate,omitempty" azure:"ro"` + ExpirationDate *string // READ-ONLY; The issue date of certificate. - IssuedDate *string `json:"issuedDate,omitempty" azure:"ro"` + IssuedDate *string // READ-ONLY; The issuer of certificate. - Issuer *string `json:"issuer,omitempty" azure:"ro"` + Issuer *string + + // READ-ONLY; Provisioning state of the Certificate + ProvisioningState *CertificateResourceProvisioningState // READ-ONLY; The subject name of certificate. - SubjectName *string `json:"subjectName,omitempty" azure:"ro"` + SubjectName *string // READ-ONLY; The thumbprint of certificate. - Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` + Thumbprint *string } // GetCertificateProperties implements the CertificatePropertiesClassification interface for type ContentCertificateProperties. func (c *ContentCertificateProperties) GetCertificateProperties() *CertificateProperties { return &CertificateProperties{ - Type: c.Type, - Thumbprint: c.Thumbprint, - Issuer: c.Issuer, - IssuedDate: c.IssuedDate, - ExpirationDate: c.ExpirationDate, - ActivateDate: c.ActivateDate, - SubjectName: c.SubjectName, - DNSNames: c.DNSNames, + Type: c.Type, + Thumbprint: c.Thumbprint, + Issuer: c.Issuer, + IssuedDate: c.IssuedDate, + ExpirationDate: c.ExpirationDate, + ActivateDate: c.ActivateDate, + SubjectName: c.SubjectName, + DNSNames: c.DNSNames, + ProvisioningState: c.ProvisioningState, + } +} + +// CustomContainer - Custom container payload +type CustomContainer struct { + // Arguments to the entrypoint. The docker image's CMD is used if this is not provided. + Args []*string + + // Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. + Command []*string + + // Container image of the custom container. This should be in the form of : without the server name of the registry + ContainerImage *string + + // Credential of the image registry + ImageRegistryCredential *ImageRegistryCredential + + // Language framework of the container image uploaded + LanguageFramework *string + + // The name of the registry that contains the container image + Server *string +} + +// CustomContainerUserSourceInfo - Custom container user source info +type CustomContainerUserSourceInfo struct { + // REQUIRED; Type of the source uploaded + Type *string + + // Custom container payload + CustomContainer *CustomContainer + + // Version of the source + Version *string +} + +// GetUserSourceInfo implements the UserSourceInfoClassification interface for type CustomContainerUserSourceInfo. +func (c *CustomContainerUserSourceInfo) GetUserSourceInfo() *UserSourceInfo { + return &UserSourceInfo{ + Type: c.Type, + Version: c.Version, } } // CustomDomainProperties - Custom domain of app resource payload. type CustomDomainProperties struct { // The bound certificate name of domain. - CertName *string `json:"certName,omitempty"` + CertName *string // The thumbprint of bound certificate. - Thumbprint *string `json:"thumbprint,omitempty"` + Thumbprint *string // READ-ONLY; The app name of domain. - AppName *string `json:"appName,omitempty" azure:"ro"` + AppName *string + + // READ-ONLY; Provisioning state of the Domain + ProvisioningState *CustomDomainResourceProvisioningState } // CustomDomainResource - Custom domain resource payload. type CustomDomainResource struct { // Properties of the custom domain resource. - Properties *CustomDomainProperties `json:"properties,omitempty"` + Properties *CustomDomainProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // CustomDomainResourceCollection - Collection compose of a custom domain resources list and a possible link for next page. type CustomDomainResourceCollection struct { // The link to next page of custom domain list. - NextLink *string `json:"nextLink,omitempty"` + NextLink *string // The custom domain resources list. - Value []*CustomDomainResource `json:"value,omitempty"` + Value []*CustomDomainResource } // CustomDomainValidatePayload - Custom domain validate payload. type CustomDomainValidatePayload struct { // REQUIRED; Name to be validated - Name *string `json:"name,omitempty"` + Name *string } // CustomDomainValidateResult - Validation result for custom domain. type CustomDomainValidateResult struct { // Indicates if domain name is valid. - IsValid *bool `json:"isValid,omitempty"` + IsValid *bool // Message of why domain name is invalid. - Message *string `json:"message,omitempty"` + Message *string } // CustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomDomainsClient.BeginCreateOrUpdate @@ -1203,90 +1810,258 @@ type CustomDomainsClientListOptions struct { // placeholder for future optional parameters } +// CustomPersistentDiskPropertiesClassification provides polymorphic access to related types. +// Call the interface's GetCustomPersistentDiskProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureFileVolume, *CustomPersistentDiskProperties +type CustomPersistentDiskPropertiesClassification interface { + // GetCustomPersistentDiskProperties returns the CustomPersistentDiskProperties content of the underlying type. + GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties +} + +// CustomPersistentDiskProperties - Custom persistent disk resource payload. +type CustomPersistentDiskProperties struct { + // REQUIRED; The mount path of the persistent disk. + MountPath *string + + // REQUIRED; The type of the underlying resource to mount as a persistent disk. + Type *Type + + // If set to true, it will create and mount a dedicated directory for every individual app instance. + EnableSubPath *bool + + // These are the mount options for a persistent disk. + MountOptions []*string + + // Indicates whether the persistent disk is a readOnly one. + ReadOnly *bool +} + +// GetCustomPersistentDiskProperties implements the CustomPersistentDiskPropertiesClassification interface for type CustomPersistentDiskProperties. +func (c *CustomPersistentDiskProperties) GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties { + return c +} + +// CustomPersistentDiskResource - Custom persistent disk resource payload. +type CustomPersistentDiskResource struct { + // REQUIRED; The resource id of Azure Spring Apps Storage resource. + StorageID *string + + // Properties of the custom persistent disk resource payload. + CustomPersistentDiskProperties CustomPersistentDiskPropertiesClassification +} + +// CustomScaleRule - Azure Spring Apps App Instance Custom scaling rule. +type CustomScaleRule struct { + // Authentication secrets for the custom scale rule. + Auth []*ScaleRuleAuth + + // Metadata properties to describe custom scale rule. + Metadata map[string]*string + + // Type of the custom scale rule eg: azure-servicebus, redis etc. + Type *string +} + +// CustomizedAcceleratorProperties - Customized accelerator properties payload +type CustomizedAcceleratorProperties struct { + // REQUIRED + GitRepository *AcceleratorGitRepository + AcceleratorTags []*string + Description *string + DisplayName *string + IconURL *string + + // READ-ONLY; State of the customized accelerator. + ProvisioningState *CustomizedAcceleratorProvisioningState +} + +// CustomizedAcceleratorResource - Customized accelerator resource +type CustomizedAcceleratorResource struct { + // Customized accelerator properties payload + Properties *CustomizedAcceleratorProperties + + // Sku of the customized accelerator resource + SKU *SKU + + // 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 +} + +type CustomizedAcceleratorResourceCollection struct { + NextLink *string + Value []*CustomizedAcceleratorResource +} + +// CustomizedAcceleratorValidateResult - Validation result for customized accelerator properties +type CustomizedAcceleratorValidateResult struct { + // The detail validation results + ErrorMessage *string + + // State of the customized accelerator validation result + State *CustomizedAcceleratorValidateResultState +} + +// CustomizedAcceleratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the CustomizedAcceleratorsClient.BeginCreateOrUpdate +// method. +type CustomizedAcceleratorsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CustomizedAcceleratorsClientBeginDeleteOptions contains the optional parameters for the CustomizedAcceleratorsClient.BeginDelete +// method. +type CustomizedAcceleratorsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CustomizedAcceleratorsClientGetOptions contains the optional parameters for the CustomizedAcceleratorsClient.Get method. +type CustomizedAcceleratorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// CustomizedAcceleratorsClientListOptions contains the optional parameters for the CustomizedAcceleratorsClient.NewListPager +// method. +type CustomizedAcceleratorsClientListOptions struct { + // placeholder for future optional parameters +} + +// CustomizedAcceleratorsClientValidateOptions contains the optional parameters for the CustomizedAcceleratorsClient.Validate +// method. +type CustomizedAcceleratorsClientValidateOptions struct { + // placeholder for future optional parameters +} + // DeploymentInstance - Deployment instance payload type DeploymentInstance struct { // READ-ONLY; Discovery status of the deployment instance - DiscoveryStatus *string `json:"discoveryStatus,omitempty" azure:"ro"` + DiscoveryStatus *string // READ-ONLY; Name of the deployment instance - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Failed reason of the deployment instance - Reason *string `json:"reason,omitempty" azure:"ro"` + Reason *string // READ-ONLY; Start time of the deployment instance - StartTime *string `json:"startTime,omitempty" azure:"ro"` + StartTime *string // READ-ONLY; Status of the deployment instance - Status *string `json:"status,omitempty" azure:"ro"` + Status *string // READ-ONLY; Availability zone information of the deployment instance - Zone *string `json:"zone,omitempty" azure:"ro"` + Zone *string +} + +// DeploymentList - A list of deployments resource ids. +type DeploymentList struct { + // A list of deployment resource ids. + Deployments []*string } // DeploymentResource - Deployment resource payload type DeploymentResource struct { // Properties of the Deployment resource - Properties *DeploymentResourceProperties `json:"properties,omitempty"` + Properties *DeploymentResourceProperties // Sku of the Deployment resource - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // DeploymentResourceCollection - Object that includes an array of App resources and a possible link for next set type DeploymentResourceCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of Deployment resources - Value []*DeploymentResource `json:"value,omitempty"` + Value []*DeploymentResource } // DeploymentResourceProperties - Deployment resource properties payload type DeploymentResourceProperties struct { // Indicates whether the Deployment is active - Active *bool `json:"active,omitempty"` + Active *bool // Deployment settings of the Deployment - DeploymentSettings *DeploymentSettings `json:"deploymentSettings,omitempty"` + DeploymentSettings *DeploymentSettings // Uploaded source information of the deployment. - Source UserSourceInfoClassification `json:"source,omitempty"` + Source UserSourceInfoClassification // READ-ONLY; Collection of instances belong to the Deployment - Instances []*DeploymentInstance `json:"instances,omitempty" azure:"ro"` + Instances []*DeploymentInstance // READ-ONLY; Provisioning state of the Deployment - ProvisioningState *DeploymentResourceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *DeploymentResourceProvisioningState // READ-ONLY; Status of the Deployment - Status *DeploymentResourceStatus `json:"status,omitempty" azure:"ro"` + Status *DeploymentResourceStatus } // DeploymentSettings - Deployment settings payload type DeploymentSettings struct { // Collection of addons - AddonConfigs map[string]map[string]any `json:"addonConfigs,omitempty"` + AddonConfigs map[string]any + + // Container liveness and readiness probe settings + ContainerProbeSettings *ContainerProbeSettings // Collection of environment variables - EnvironmentVariables map[string]*string `json:"environmentVariables,omitempty"` + EnvironmentVariables map[string]*string + + // Periodic probe of App Instance liveness. App Instance will be restarted if the probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + LivenessProbe *Probe + + // Periodic probe of App Instance service readiness. App Instance will be removed from service endpoints if the probe fails. + // More info: + // https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + ReadinessProbe *Probe // The requested resource quantity for required CPU and Memory. It is recommended that using this field to represent the required // CPU and Memory, the old field cpu and memoryInGB will be deprecated // later. - ResourceRequests *ResourceRequests `json:"resourceRequests,omitempty"` + ResourceRequests *ResourceRequests + + // Scaling properties for the Azure Spring Apps App Instance. + Scale *Scale + + // StartupProbe indicates that the App Instance has successfully initialized. If specified, no other probes are executed until + // this completes successfully. If this probe fails, the Pod will be restarted, + // just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a App Instance's + // lifecycle, when it might take a long time to load data or warm a cache, + // than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + StartupProbe *Probe + + // Optional duration in seconds the App Instance needs to terminate gracefully. May be decreased in delete request. Value + // must be non-negative integer. The value zero indicates stop immediately via the + // kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace + // period is the duration in seconds after the processes running in the App + // Instance are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this + // value longer than the expected cleanup time for your process. Defaults to 90 + // seconds. + TerminationGracePeriodSeconds *int32 } // DeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdate @@ -1302,6 +2077,22 @@ type DeploymentsClientBeginDeleteOptions struct { ResumeToken string } +// DeploymentsClientBeginDisableRemoteDebuggingOptions contains the optional parameters for the DeploymentsClient.BeginDisableRemoteDebugging +// method. +type DeploymentsClientBeginDisableRemoteDebuggingOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DeploymentsClientBeginEnableRemoteDebuggingOptions contains the optional parameters for the DeploymentsClient.BeginEnableRemoteDebugging +// method. +type DeploymentsClientBeginEnableRemoteDebuggingOptions struct { + // Parameters for enable remote debugging + RemoteDebuggingPayload *RemoteDebuggingPayload + // Resumes the LRO from the provided token. + ResumeToken string +} + // DeploymentsClientBeginGenerateHeapDumpOptions contains the optional parameters for the DeploymentsClient.BeginGenerateHeapDump // method. type DeploymentsClientBeginGenerateHeapDumpOptions struct { @@ -1356,6 +2147,12 @@ type DeploymentsClientGetOptions struct { // placeholder for future optional parameters } +// DeploymentsClientGetRemoteDebuggingConfigOptions contains the optional parameters for the DeploymentsClient.GetRemoteDebuggingConfig +// method. +type DeploymentsClientGetRemoteDebuggingConfigOptions struct { + // placeholder for future optional parameters +} + // DeploymentsClientListForClusterOptions contains the optional parameters for the DeploymentsClient.NewListForClusterPager // method. type DeploymentsClientListForClusterOptions struct { @@ -1369,79 +2166,674 @@ type DeploymentsClientListOptions struct { Version []string } +// DevToolPortalFeatureDetail - Detail settings for Dev Tool Portal feature +type DevToolPortalFeatureDetail struct { + // State of the plugin + State *DevToolPortalFeatureState + + // READ-ONLY; Route path to visit the plugin + Route *string +} + +// DevToolPortalFeatureSettings - Settings for Dev Tool Portal +type DevToolPortalFeatureSettings struct { + // Detail of Accelerator plugin + ApplicationAccelerator *DevToolPortalFeatureDetail + + // Detail of App Live View plugin + ApplicationLiveView *DevToolPortalFeatureDetail +} + +// DevToolPortalInstance - Collection of instances belong to the Dev Tool Portal. +type DevToolPortalInstance struct { + // READ-ONLY; Name of the Dev Tool Portal instance. + Name *string + + // READ-ONLY; Status of the Dev Tool Portal instance. It can be Pending, Running, Succeeded, Failed, Unknown. + Status *string +} + +// DevToolPortalProperties - Dev Tool Portal properties payload +type DevToolPortalProperties struct { + // Settings for Dev Tool Portal + Features *DevToolPortalFeatureSettings + + // Indicates whether the resource exposes public endpoint + Public *bool + + // Single sign-on related configuration + SsoProperties *DevToolPortalSsoProperties + + // READ-ONLY; Collection of instances belong to Dev Tool Portal. + Instances []*DevToolPortalInstance + + // 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 +} + +// DevToolPortalResource - Dev Tool Portal resource +type DevToolPortalResource struct { + // Dev Tool Portal properties payload + Properties *DevToolPortalProperties + + // 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 +} + +// DevToolPortalResourceCollection - Object that includes an array of Dev Tool Portal resources and a possible link for next +// set +type DevToolPortalResourceCollection 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 Dev Tool Portal resources + Value []*DevToolPortalResource +} + +// DevToolPortalResourceRequests - The resource quantity for required CPU and Memory of Dev Tool Portal +type DevToolPortalResourceRequests struct { + // READ-ONLY; Cpu quantity allocated to each Dev Tool Portal instance. 1 core can be represented by 1 or 1000m + CPU *string + + // READ-ONLY; Desired instance count of Dev Tool Portal. + InstanceCount *int32 + + // READ-ONLY; Memory quantity allocated to each Dev Tool Portal instance. 1 GB can be represented by 1Gi or 1024Mi. + Memory *string +} + +// DevToolPortalSsoProperties - Single sign-on related configuration +type DevToolPortalSsoProperties struct { + // The public identifier for the application + ClientID *string + + // The secret known only to the application and the authorization server + ClientSecret *string + + // The URI of a JSON file with generic OIDC provider configuration. + MetadataURL *string + + // It defines the specific actions applications can be allowed to do on a user's behalf + Scopes []*string +} + +// DevToolPortalsClientBeginCreateOrUpdateOptions contains the optional parameters for the DevToolPortalsClient.BeginCreateOrUpdate +// method. +type DevToolPortalsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DevToolPortalsClientBeginDeleteOptions contains the optional parameters for the DevToolPortalsClient.BeginDelete method. +type DevToolPortalsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DevToolPortalsClientGetOptions contains the optional parameters for the DevToolPortalsClient.Get method. +type DevToolPortalsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DevToolPortalsClientListOptions contains the optional parameters for the DevToolPortalsClient.NewListPager method. +type DevToolPortalsClientListOptions struct { + // placeholder for future optional parameters +} + // DiagnosticParameters - Diagnostic parameters of diagnostic operations type DiagnosticParameters struct { // App instance name - AppInstance *string `json:"appInstance,omitempty"` + AppInstance *string // Duration of your JFR. 1 min can be represented by 1m or 60s. - Duration *string `json:"duration,omitempty"` + Duration *string // Your target file path in your own BYOS - FilePath *string `json:"filePath,omitempty"` + FilePath *string } // Error - The error code compose of code and message. type Error struct { // The code of error. - Code *string `json:"code,omitempty"` + Code *string // The message of error. - Message *string `json:"message,omitempty"` + Message *string +} + +// ExecAction describes a "run in container" action. +type ExecAction struct { + // REQUIRED; The type of the action to take to perform the health check. + Type *ProbeActionType + + // Command is the command line to execute inside the container, the working directory for the command is root ('/') in the + // container's filesystem. The command is not run inside a shell, so traditional + // shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of + // 0 is treated as live/healthy and non-zero is unhealthy. + Command []*string +} + +// GetProbeAction implements the ProbeActionClassification interface for type ExecAction. +func (e *ExecAction) GetProbeAction() *ProbeAction { + return &ProbeAction{ + Type: e.Type, + } +} + +// GatewayAPIMetadataProperties - API metadata property for Spring Cloud Gateway +type GatewayAPIMetadataProperties struct { + // Detailed description of the APIs available on the Gateway instance (default: Generated OpenAPI 3 document that describes + // the API routes configured.) + Description *string + + // Location of additional documentation for the APIs available on the Gateway instance + Documentation *string + + // Base URL that API consumers will use to access APIs on the Gateway instance. + ServerURL *string + + // Title describing the context of the APIs available on the Gateway instance (default: Spring Cloud Gateway for K8S) + Title *string + + // Version of APIs available on this Gateway instance (default: unspecified). + Version *string +} + +// GatewayAPIRoute - API route config of the Spring Cloud Gateway +type GatewayAPIRoute struct { + // A description, will be applied to methods in the generated OpenAPI documentation. + Description *string + + // To modify the request before sending it to the target endpoint, or the received response. + Filters []*string + + // Route processing order. + Order *int32 + + // A number of conditions to evaluate a route for each request. Each predicate may be evaluated against request headers and + // parameter values. All of the predicates associated with a route must evaluate + // to true for the route to be matched to the request. + Predicates []*string + + // Enable sso validation. + SsoEnabled *bool + + // Classification tags, will be applied to methods in the generated OpenAPI documentation. + Tags []*string + + // A title, will be applied to methods in the generated OpenAPI documentation. + Title *string + + // Pass currently-authenticated user's identity token to application service, default is 'false' + TokenRelay *bool + + // Full uri, will override appName. + URI *string +} + +// GatewayCorsProperties - Cross-Origin Resource Sharing property +type GatewayCorsProperties struct { + // Whether user credentials are supported on cross-site requests. Valid values: true, false. + AllowCredentials *bool + + // Allowed headers in cross-site requests. The special value * allows actual requests to send any header. + AllowedHeaders []*string + + // Allowed HTTP methods on cross-site requests. The special value * allows all methods. If not set, GET and HEAD are allowed + // by default. + AllowedMethods []*string + + // Allowed origins to make cross-site requests. The special value * allows all domains. + AllowedOrigins []*string + + // HTTP response headers to expose for cross-site requests. + ExposedHeaders []*string + + // How long, in seconds, the response from a pre-flight request can be cached by clients. + MaxAge *int32 +} + +// GatewayCustomDomainProperties - The properties of custom domain for Spring Cloud Gateway +type GatewayCustomDomainProperties struct { + // The thumbprint of bound certificate. + Thumbprint *string +} + +// GatewayCustomDomainResource - Custom domain of the Spring Cloud Gateway +type GatewayCustomDomainResource struct { + // The properties of custom domain for Spring Cloud Gateway + Properties *GatewayCustomDomainProperties + + // 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 +} + +// GatewayCustomDomainResourceCollection - Object that includes an array of Spring Cloud Gateway custom domain resources and +// a possible link for next set +type GatewayCustomDomainResourceCollection 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 Spring Cloud Gateway custom domain resources + Value []*GatewayCustomDomainResource +} + +// GatewayCustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewayCustomDomainsClient.BeginCreateOrUpdate +// method. +type GatewayCustomDomainsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewayCustomDomainsClientBeginDeleteOptions contains the optional parameters for the GatewayCustomDomainsClient.BeginDelete +// method. +type GatewayCustomDomainsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewayCustomDomainsClientGetOptions contains the optional parameters for the GatewayCustomDomainsClient.Get method. +type GatewayCustomDomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// GatewayCustomDomainsClientListOptions contains the optional parameters for the GatewayCustomDomainsClient.NewListPager +// method. +type GatewayCustomDomainsClientListOptions struct { + // placeholder for future optional parameters +} + +// GatewayInstance - Collection of instances belong to the Spring Cloud Gateway +type GatewayInstance struct { + // READ-ONLY; Name of the Spring Cloud Gateway instance + Name *string + + // READ-ONLY; Status of the Spring Cloud Gateway instance + Status *string +} + +// GatewayOperatorProperties - Properties of the Spring Cloud Gateway Operator. +type GatewayOperatorProperties struct { + // READ-ONLY; Collection of instances belong to Spring Cloud Gateway operator. + Instances []*GatewayInstance + + // READ-ONLY; The requested resource quantity for required CPU and Memory. + ResourceRequests *GatewayOperatorResourceRequests +} + +// GatewayOperatorResourceRequests - Properties of the Spring Cloud Gateway Operator. +type GatewayOperatorResourceRequests struct { + // READ-ONLY; Cpu allocated to each Spring Cloud Gateway Operator instance. + CPU *string + + // READ-ONLY; Instance count of the Spring Cloud Gateway Operator. + InstanceCount *int32 + + // READ-ONLY; Memory allocated to each Spring Cloud Gateway Operator instance. + Memory *string +} + +// GatewayProperties - Spring Cloud Gateway properties payload +type GatewayProperties struct { + // API metadata property for Spring Cloud Gateway + APIMetadataProperties *GatewayAPIMetadataProperties + + // Collection of APM type used in Spring Cloud Gateway + ApmTypes []*ApmType + + // Cross-Origin Resource Sharing property + CorsProperties *GatewayCorsProperties + + // Environment variables of Spring Cloud Gateway + EnvironmentVariables *GatewayPropertiesEnvironmentVariables + + // Indicate if only https is allowed. + HTTPSOnly *bool + + // Indicates whether the Spring Cloud Gateway exposes endpoint. + Public *bool + + // The requested resource quantity for required CPU and Memory. + ResourceRequests *GatewayResourceRequests + + // Single sign-on related configuration + SsoProperties *SsoProperties + + // READ-ONLY; Collection of instances belong to Spring Cloud Gateway. + Instances []*GatewayInstance + + // READ-ONLY; Properties of the Spring Cloud Gateway Operator. + OperatorProperties *GatewayOperatorProperties + + // READ-ONLY; State of the Spring Cloud Gateway. + ProvisioningState *GatewayProvisioningState + + // READ-ONLY; URL of the Spring Cloud Gateway, exposed when 'public' is true. + URL *string +} + +// GatewayPropertiesEnvironmentVariables - Environment variables of Spring Cloud Gateway +type GatewayPropertiesEnvironmentVariables struct { + // Non-sensitive properties + Properties map[string]*string + + // Sensitive properties + Secrets map[string]*string +} + +// GatewayResource - Spring Cloud Gateway resource +type GatewayResource struct { + // Spring Cloud Gateway properties payload + Properties *GatewayProperties + + // Sku of the Spring Cloud Gateway resource + SKU *SKU + + // 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 +} + +// GatewayResourceCollection - Object that includes an array of gateway resources and a possible link for next set +type GatewayResourceCollection 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 gateway resources + Value []*GatewayResource +} + +// GatewayResourceRequests - Resource request payload of Spring Cloud Gateway. +type GatewayResourceRequests struct { + // Cpu allocated to each Spring Cloud Gateway instance. + CPU *string + + // Memory allocated to each Spring Cloud Gateway instance. + Memory *string +} + +// GatewayRouteConfigOpenAPIProperties - OpenAPI properties of Spring Cloud Gateway route config. +type GatewayRouteConfigOpenAPIProperties struct { + // The URI of OpenAPI specification. + URI *string +} + +// GatewayRouteConfigProperties - API route config of the Spring Cloud Gateway +type GatewayRouteConfigProperties struct { + // The resource Id of the Azure Spring Apps app, required unless route defines uri. + AppResourceID *string + + // To modify the request before sending it to the target endpoint, or the received response in app level. + Filters []*string + + // OpenAPI properties of Spring Cloud Gateway route config. + OpenAPI *GatewayRouteConfigOpenAPIProperties + + // A number of conditions to evaluate a route for each request in app level. Each predicate may be evaluated against request + // headers and parameter values. All of the predicates associated with a route + // must evaluate to true for the route to be matched to the request. + Predicates []*string + + // Protocol of routed Azure Spring Apps applications. + Protocol *GatewayRouteConfigProtocol + + // Array of API routes, each route contains properties such as title, uri, ssoEnabled, predicates, filters. + Routes []*GatewayAPIRoute + + // Enable Single Sign-On in app level. + SsoEnabled *bool + + // READ-ONLY; State of the Spring Cloud Gateway route config. + ProvisioningState *GatewayProvisioningState +} + +// GatewayRouteConfigResource - Spring Cloud Gateway route config resource +type GatewayRouteConfigResource struct { + // API route config of the Spring Cloud Gateway + Properties *GatewayRouteConfigProperties + + // 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 +} + +// GatewayRouteConfigResourceCollection - Object that includes an array of Spring Cloud Gateway route config resources and +// a possible link for next set +type GatewayRouteConfigResourceCollection 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 Spring Cloud Gateway route config resources + Value []*GatewayRouteConfigResource +} + +// GatewayRouteConfigsClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewayRouteConfigsClient.BeginCreateOrUpdate +// method. +type GatewayRouteConfigsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewayRouteConfigsClientBeginDeleteOptions contains the optional parameters for the GatewayRouteConfigsClient.BeginDelete +// method. +type GatewayRouteConfigsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewayRouteConfigsClientGetOptions contains the optional parameters for the GatewayRouteConfigsClient.Get method. +type GatewayRouteConfigsClientGetOptions struct { + // placeholder for future optional parameters +} + +// GatewayRouteConfigsClientListOptions contains the optional parameters for the GatewayRouteConfigsClient.NewListPager method. +type GatewayRouteConfigsClientListOptions struct { + // placeholder for future optional parameters +} + +// GatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewaysClient.BeginCreateOrUpdate method. +type GatewaysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewaysClientBeginDeleteOptions contains the optional parameters for the GatewaysClient.BeginDelete method. +type GatewaysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewaysClientBeginUpdateCapacityOptions contains the optional parameters for the GatewaysClient.BeginUpdateCapacity method. +type GatewaysClientBeginUpdateCapacityOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewaysClientGetOptions contains the optional parameters for the GatewaysClient.Get method. +type GatewaysClientGetOptions struct { + // placeholder for future optional parameters +} + +// GatewaysClientListEnvSecretsOptions contains the optional parameters for the GatewaysClient.ListEnvSecrets method. +type GatewaysClientListEnvSecretsOptions struct { + // placeholder for future optional parameters +} + +// GatewaysClientListOptions contains the optional parameters for the GatewaysClient.NewListPager method. +type GatewaysClientListOptions struct { + // placeholder for future optional parameters +} + +// GatewaysClientValidateDomainOptions contains the optional parameters for the GatewaysClient.ValidateDomain method. +type GatewaysClientValidateDomainOptions struct { + // placeholder for future optional parameters } // GitPatternRepository - Git repository property payload for config server type GitPatternRepository struct { // REQUIRED; Name of the repository - Name *string `json:"name,omitempty"` + Name *string // REQUIRED; URI of the repository - URI *string `json:"uri,omitempty"` + URI *string // Public sshKey of git repository. - HostKey *string `json:"hostKey,omitempty"` + HostKey *string // SshKey algorithm of git repository. - HostKeyAlgorithm *string `json:"hostKeyAlgorithm,omitempty"` + HostKeyAlgorithm *string // Label of the repository - Label *string `json:"label,omitempty"` + Label *string // Password of git repository basic auth. - Password *string `json:"password,omitempty"` + Password *string // Collection of pattern of the repository - Pattern []*string `json:"pattern,omitempty"` + Pattern []*string // Private sshKey algorithm of git repository. - PrivateKey *string `json:"privateKey,omitempty"` + PrivateKey *string // Searching path of the repository - SearchPaths []*string `json:"searchPaths,omitempty"` + SearchPaths []*string // Strict host key checking or not. - StrictHostKeyChecking *bool `json:"strictHostKeyChecking,omitempty"` + StrictHostKeyChecking *bool // Username of git repository basic auth. - Username *string `json:"username,omitempty"` + Username *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. + Type *ProbeActionType + + // Path to access on the HTTP server. + Path *string + + // Scheme to use for connecting to the host. Defaults to HTTP. + // Possible enum values: + // * "HTTP" means that the scheme used will be http:// + // * "HTTPS" means that the scheme used will be https:// + Scheme *HTTPSchemeType +} + +// GetProbeAction implements the ProbeActionClassification interface for type HTTPGetAction. +func (h *HTTPGetAction) GetProbeAction() *ProbeAction { + return &ProbeAction{ + Type: h.Type, + } +} + +// HTTPScaleRule - Azure Spring Apps App Instance Http scaling rule. +type HTTPScaleRule struct { + // Authentication secrets for the custom scale rule. + Auth []*ScaleRuleAuth + + // Metadata properties to describe http scale rule. + Metadata map[string]*string +} + +// ImageRegistryCredential - Credential of the image registry +type ImageRegistryCredential struct { + // The password of the image registry credential + Password *string + + // The username of the image registry credential + Username *string +} + +// IngressConfig - Ingress configuration payload for Azure Spring Apps resource. +type IngressConfig struct { + // Ingress read time out in seconds. + ReadTimeoutInSeconds *int32 +} + +// IngressSettings - App ingress settings payload. +type IngressSettings struct { + // How ingress should communicate with this app backend service. + BackendProtocol *BackendProtocol + + // Client-Certification Authentication. + ClientAuth *IngressSettingsClientAuth + + // Ingress read time out in seconds. + ReadTimeoutInSeconds *int32 + + // Ingress send time out in seconds. + SendTimeoutInSeconds *int32 + + // Type of the affinity, set this to Cookie to enable session affinity. + SessionAffinity *SessionAffinity + + // Time in seconds until the cookie expires. + SessionCookieMaxAge *int32 +} + +// IngressSettingsClientAuth - Client-Certification Authentication. +type IngressSettingsClientAuth struct { + // Collection of certificate resource id. + Certificates []*string } // JarUploadedUserSourceInfo - Uploaded Jar binary for a deployment type JarUploadedUserSourceInfo struct { // REQUIRED; Type of the source uploaded - Type *string `json:"type,omitempty"` + Type *string // JVM parameter - JvmOptions *string `json:"jvmOptions,omitempty"` + JvmOptions *string // Relative path of the storage which stores the source - RelativePath *string `json:"relativePath,omitempty"` + RelativePath *string // Runtime version of the Jar file - RuntimeVersion *string `json:"runtimeVersion,omitempty"` + RuntimeVersion *string // Version of the source - Version *string `json:"version,omitempty"` + Version *string } // GetUploadedUserSourceInfo implements the UploadedUserSourceInfoClassification interface for type JarUploadedUserSourceInfo. @@ -1464,182 +2856,201 @@ func (j *JarUploadedUserSourceInfo) GetUserSourceInfo() *UserSourceInfo { // KeyVaultCertificateProperties - Properties of certificate imported from key vault. type KeyVaultCertificateProperties struct { // REQUIRED; The certificate name of key vault. - KeyVaultCertName *string `json:"keyVaultCertName,omitempty"` + KeyVaultCertName *string // REQUIRED; The type of the certificate source. - Type *string `json:"type,omitempty"` + Type *string // REQUIRED; The vault uri of user key vault. - VaultURI *string `json:"vaultUri,omitempty"` + VaultURI *string // The certificate version of key vault. - CertVersion *string `json:"certVersion,omitempty"` + CertVersion *string // Optional. If set to true, it will not import private key from key vault. - ExcludePrivateKey *bool `json:"excludePrivateKey,omitempty"` + ExcludePrivateKey *bool // READ-ONLY; The activate date of certificate. - ActivateDate *string `json:"activateDate,omitempty" azure:"ro"` + ActivateDate *string // READ-ONLY; The domain list of certificate. - DNSNames []*string `json:"dnsNames,omitempty" azure:"ro"` + DNSNames []*string // READ-ONLY; The expiration date of certificate. - ExpirationDate *string `json:"expirationDate,omitempty" azure:"ro"` + ExpirationDate *string // READ-ONLY; The issue date of certificate. - IssuedDate *string `json:"issuedDate,omitempty" azure:"ro"` + IssuedDate *string // READ-ONLY; The issuer of certificate. - Issuer *string `json:"issuer,omitempty" azure:"ro"` + Issuer *string + + // READ-ONLY; Provisioning state of the Certificate + ProvisioningState *CertificateResourceProvisioningState // READ-ONLY; The subject name of certificate. - SubjectName *string `json:"subjectName,omitempty" azure:"ro"` + SubjectName *string // READ-ONLY; The thumbprint of certificate. - Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` + Thumbprint *string } // GetCertificateProperties implements the CertificatePropertiesClassification interface for type KeyVaultCertificateProperties. func (k *KeyVaultCertificateProperties) GetCertificateProperties() *CertificateProperties { return &CertificateProperties{ - Type: k.Type, - Thumbprint: k.Thumbprint, - Issuer: k.Issuer, - IssuedDate: k.IssuedDate, - ExpirationDate: k.ExpirationDate, - ActivateDate: k.ActivateDate, - SubjectName: k.SubjectName, - DNSNames: k.DNSNames, + Type: k.Type, + Thumbprint: k.Thumbprint, + Issuer: k.Issuer, + IssuedDate: k.IssuedDate, + ExpirationDate: k.ExpirationDate, + ActivateDate: k.ActivateDate, + SubjectName: k.SubjectName, + DNSNames: k.DNSNames, + ProvisioningState: k.ProvisioningState, } } // LoadedCertificate - Loaded certificate payload type LoadedCertificate struct { // REQUIRED; Resource Id of loaded certificate - ResourceID *string `json:"resourceId,omitempty"` + ResourceID *string // Indicate whether the certificate will be loaded into default trust store, only work for Java runtime. - LoadTrustStore *bool `json:"loadTrustStore,omitempty"` + LoadTrustStore *bool } // LogFileURLResponse - Log file URL payload type LogFileURLResponse struct { // REQUIRED; URL of the log file - URL *string `json:"url,omitempty"` + URL *string } // LogSpecification - Specifications of the Log for Azure Monitoring type LogSpecification struct { // Blob duration of the log - BlobDuration *string `json:"blobDuration,omitempty"` + BlobDuration *string // Localized friendly display name of the log - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // Name of the log - Name *string `json:"name,omitempty"` + Name *string } // ManagedIdentityProperties - Managed identity properties retrieved from ARM request headers. type ManagedIdentityProperties struct { // Principal Id of system-assigned managed identity. - PrincipalID *string `json:"principalId,omitempty"` + PrincipalID *string // Tenant Id of system-assigned managed identity. - TenantID *string `json:"tenantId,omitempty"` + TenantID *string // Type of the managed identity - Type *ManagedIdentityType `json:"type,omitempty"` + Type *ManagedIdentityType + + // Properties of user-assigned managed identities + UserAssignedIdentities map[string]*UserAssignedManagedIdentity +} + +// MarketplaceResource - Purchasing 3rd Party product for one Azure Spring Apps instance +type MarketplaceResource struct { + // The plan id of the 3rd Party Artifact that is being procured. + Plan *string + + // The 3rd Party artifact that is being procured. + Product *string + + // The publisher id of the 3rd Party Artifact that is being bought. + Publisher *string } // MetricDimension - Specifications of the Dimension of metrics type MetricDimension struct { // Localized friendly display name of the dimension - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // Name of the dimension - Name *string `json:"name,omitempty"` + Name *string // Whether this dimension should be included for the Shoebox export scenario - ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` + ToBeExportedForShoebox *bool } // MetricSpecification - Specifications of the Metrics for Azure Monitoring type MetricSpecification struct { // Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. - AggregationType *string `json:"aggregationType,omitempty"` + AggregationType *string // Name of the metric category that the metric belongs to. A metric can only belong to a single category. - Category *string `json:"category,omitempty"` + Category *string // Dimensions of the metric - Dimensions []*MetricDimension `json:"dimensions,omitempty"` + Dimensions []*MetricDimension // Localized friendly description of the metric - DisplayDescription *string `json:"displayDescription,omitempty"` + DisplayDescription *string // Localized friendly display name of the metric - DisplayName *string `json:"displayName,omitempty"` + DisplayName *string // Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. - FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + FillGapWithZero *bool // Name of the metric - Name *string `json:"name,omitempty"` + Name *string // Name of the MDM namespace. Optional. - SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` + SourceMdmNamespace *string // Supported aggregation types - SupportedAggregationTypes []*string `json:"supportedAggregationTypes,omitempty"` + SupportedAggregationTypes []*string // Supported time grain types - SupportedTimeGrainTypes []*string `json:"supportedTimeGrainTypes,omitempty"` + SupportedTimeGrainTypes []*string // Unit that makes sense for the metric - Unit *string `json:"unit,omitempty"` + Unit *string } // MonitoringSettingProperties - Monitoring Setting properties payload type MonitoringSettingProperties struct { // Indicates the versions of application insight agent - AppInsightsAgentVersions *ApplicationInsightsAgentVersions `json:"appInsightsAgentVersions,omitempty"` + AppInsightsAgentVersions *ApplicationInsightsAgentVersions // Target application insight instrumentation key, null or whitespace include empty will disable monitoringSettings - AppInsightsInstrumentationKey *string `json:"appInsightsInstrumentationKey,omitempty"` + AppInsightsInstrumentationKey *string // Indicates the sampling rate of application insight agent, should be in range [0.0, 100.0] - AppInsightsSamplingRate *float64 `json:"appInsightsSamplingRate,omitempty"` + AppInsightsSamplingRate *float64 // Error when apply Monitoring Setting changes. - Error *Error `json:"error,omitempty"` + Error *Error // Indicates whether enable the trace functionality, which will be deprecated since api version 2020-11-01-preview. Please // leverage appInsightsInstrumentationKey to indicate if monitoringSettings enabled // or not - TraceEnabled *bool `json:"traceEnabled,omitempty"` + TraceEnabled *bool // READ-ONLY; State of the Monitoring Setting. - ProvisioningState *MonitoringSettingState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *MonitoringSettingState } // MonitoringSettingResource - Monitoring Setting resource type MonitoringSettingResource struct { // Properties of the Monitoring Setting resource - Properties *MonitoringSettingProperties `json:"properties,omitempty"` + Properties *MonitoringSettingProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // MonitoringSettingsClientBeginUpdatePatchOptions contains the optional parameters for the MonitoringSettingsClient.BeginUpdatePatch @@ -1664,40 +3075,40 @@ type MonitoringSettingsClientGetOptions struct { // NameAvailability - Name availability result payload type NameAvailability struct { // Message why the name is not available - Message *string `json:"message,omitempty"` + Message *string // Indicates whether the name is available - NameAvailable *bool `json:"nameAvailable,omitempty"` + NameAvailable *bool // Reason why the name is not available - Reason *string `json:"reason,omitempty"` + Reason *string } // NameAvailabilityParameters - Name availability parameters payload type NameAvailabilityParameters struct { // REQUIRED; Name to be checked - Name *string `json:"name,omitempty"` + Name *string // REQUIRED; Type of the resource to check name availability - Type *string `json:"type,omitempty"` + Type *string } // NetCoreZipUploadedUserSourceInfo - Uploaded Jar binary for a deployment type NetCoreZipUploadedUserSourceInfo struct { // REQUIRED; Type of the source uploaded - Type *string `json:"type,omitempty"` + Type *string // The path to the .NET executable relative to zip root - NetCoreMainEntryPath *string `json:"netCoreMainEntryPath,omitempty"` + NetCoreMainEntryPath *string // Relative path of the storage which stores the source - RelativePath *string `json:"relativePath,omitempty"` + RelativePath *string // Runtime version of the .Net file - RuntimeVersion *string `json:"runtimeVersion,omitempty"` + RuntimeVersion *string // Version of the source - Version *string `json:"version,omitempty"` + Version *string } // GetUploadedUserSourceInfo implements the UploadedUserSourceInfoClassification interface for type NetCoreZipUploadedUserSourceInfo. @@ -1720,73 +3131,79 @@ func (n *NetCoreZipUploadedUserSourceInfo) GetUserSourceInfo() *UserSourceInfo { // NetworkProfile - Service network profile payload type NetworkProfile struct { // Name of the resource group containing network resources for customer apps in Azure Spring Apps - AppNetworkResourceGroup *string `json:"appNetworkResourceGroup,omitempty"` + AppNetworkResourceGroup *string // Fully qualified resource Id of the subnet to host customer apps in Azure Spring Apps - AppSubnetID *string `json:"appSubnetId,omitempty"` + AppSubnetID *string + + // Ingress configuration payload for Azure Spring Apps resource. + IngressConfig *IngressConfig + + // The egress traffic type of Azure Spring Apps VNet instances. + OutboundType *string // Azure Spring Apps service reserved CIDR - ServiceCidr *string `json:"serviceCidr,omitempty"` + ServiceCidr *string // Name of the resource group containing network resources of Azure Spring Apps Service Runtime - ServiceRuntimeNetworkResourceGroup *string `json:"serviceRuntimeNetworkResourceGroup,omitempty"` + ServiceRuntimeNetworkResourceGroup *string // Fully qualified resource Id of the subnet to host Azure Spring Apps Service Runtime - ServiceRuntimeSubnetID *string `json:"serviceRuntimeSubnetId,omitempty"` + ServiceRuntimeSubnetID *string // READ-ONLY; Desired outbound IP resources for Azure Spring Apps resource. - OutboundIPs *NetworkProfileOutboundIPs `json:"outboundIPs,omitempty" azure:"ro"` + OutboundIPs *NetworkProfileOutboundIPs // READ-ONLY; Required inbound or outbound traffics for Azure Spring Apps resource. - RequiredTraffics []*RequiredTraffic `json:"requiredTraffics,omitempty" azure:"ro"` + RequiredTraffics []*RequiredTraffic } // NetworkProfileOutboundIPs - Desired outbound IP resources for Azure Spring Apps resource. type NetworkProfileOutboundIPs struct { // READ-ONLY; A list of public IP addresses. - PublicIPs []*string `json:"publicIPs,omitempty" azure:"ro"` + PublicIPs []*string } // OperationDetail - Operation detail payload type OperationDetail struct { // Display of the operation - Display *OperationDisplay `json:"display,omitempty"` + Display *OperationDisplay // Indicates whether the operation is a data action - IsDataAction *bool `json:"isDataAction,omitempty"` + IsDataAction *bool // Name of the operation - Name *string `json:"name,omitempty"` + Name *string // Origin of the operation - Origin *string `json:"origin,omitempty"` + Origin *string // Properties of the operation - Properties *OperationProperties `json:"properties,omitempty"` + Properties *OperationProperties // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - ActionType *ActionType `json:"actionType,omitempty" azure:"ro"` + ActionType *ActionType } // OperationDisplay - Operation display payload type OperationDisplay struct { // Localized friendly description for the operation - Description *string `json:"description,omitempty"` + Description *string // Localized friendly name for the operation - Operation *string `json:"operation,omitempty"` + Operation *string // Resource provider of the operation - Provider *string `json:"provider,omitempty"` + Provider *string // Resource of the operation - Resource *string `json:"resource,omitempty"` + Resource *string } // OperationProperties - Extra Operation properties type OperationProperties struct { // Service specifications of the operation - ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` + ServiceSpecification *ServiceSpecification } // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. @@ -1797,175 +3214,318 @@ type OperationsClientListOptions struct { // PersistentDisk - Persistent disk payload type PersistentDisk struct { // Mount path of the persistent disk - MountPath *string `json:"mountPath,omitempty"` + MountPath *string // Size of the persistent disk in GB - SizeInGB *int32 `json:"sizeInGB,omitempty"` + SizeInGB *int32 // READ-ONLY; Size of the used persistent disk in GB - UsedInGB *int32 `json:"usedInGB,omitempty" azure:"ro"` + UsedInGB *int32 +} + +// PredefinedAcceleratorProperties - Predefined accelerator properties payload +type PredefinedAcceleratorProperties struct { + // State of the predefined accelerator. + State *PredefinedAcceleratorState + + // READ-ONLY + AcceleratorTags []*string + + // READ-ONLY + Description *string + + // READ-ONLY + DisplayName *string + + // READ-ONLY + IconURL *string + + // READ-ONLY; Provisioning state of the predefined accelerator. + ProvisioningState *PredefinedAcceleratorProvisioningState +} + +// PredefinedAcceleratorResource - Predefined accelerator resource +type PredefinedAcceleratorResource struct { + // Predefined accelerator properties payload + Properties *PredefinedAcceleratorProperties + + // Sku of the predefined accelerator resource + SKU *SKU + + // 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 } +type PredefinedAcceleratorResourceCollection struct { + NextLink *string + Value []*PredefinedAcceleratorResource +} + +// PredefinedAcceleratorsClientBeginDisableOptions contains the optional parameters for the PredefinedAcceleratorsClient.BeginDisable +// method. +type PredefinedAcceleratorsClientBeginDisableOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PredefinedAcceleratorsClientBeginEnableOptions contains the optional parameters for the PredefinedAcceleratorsClient.BeginEnable +// method. +type PredefinedAcceleratorsClientBeginEnableOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PredefinedAcceleratorsClientGetOptions contains the optional parameters for the PredefinedAcceleratorsClient.Get method. +type PredefinedAcceleratorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PredefinedAcceleratorsClientListOptions contains the optional parameters for the PredefinedAcceleratorsClient.NewListPager +// method. +type PredefinedAcceleratorsClientListOptions struct { + // placeholder for future optional parameters +} + +// Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive +// traffic. +type Probe struct { + // REQUIRED; Indicate whether the probe is disabled. + DisableProbe *bool + + // Minimum consecutive failures for the probe to be considered failed after having succeeded. Minimum value is 1. + FailureThreshold *int32 + + // Number of seconds after the App Instance has started before probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + InitialDelaySeconds *int32 + + // How often (in seconds) to perform the probe. Minimum value is 1. + PeriodSeconds *int32 + + // The action of the probe. + ProbeAction ProbeActionClassification + + // Minimum consecutive successes for the probe to be considered successful after having failed. Must be 1 for liveness and + // startup. Minimum value is 1. + SuccessThreshold *int32 + + // Number of seconds after which the probe times out. Minimum value is 1. + TimeoutSeconds *int32 +} + +// ProbeActionClassification provides polymorphic access to related types. +// Call the interface's GetProbeAction() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ExecAction, *HTTPGetAction, *ProbeAction, *TCPSocketAction +type ProbeActionClassification interface { + // GetProbeAction returns the ProbeAction content of the underlying type. + GetProbeAction() *ProbeAction +} + +// ProbeAction - The action of the probe. +type ProbeAction struct { + // REQUIRED; The type of the action to take to perform the health check. + Type *ProbeActionType +} + +// GetProbeAction implements the ProbeActionClassification interface for type ProbeAction. +func (p *ProbeAction) GetProbeAction() *ProbeAction { return p } + // ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location // and tags. type ProxyResource struct { // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string +} + +// QueueScaleRule - Azure Spring Apps App Instance Azure Queue based scaling rule. +type QueueScaleRule struct { + // Authentication secrets for the queue scale rule. + Auth []*ScaleRuleAuth + + // Queue length. + QueueLength *int32 + + // Queue name. + QueueName *string } // RegenerateTestKeyRequestPayload - Regenerate test key request payload type RegenerateTestKeyRequestPayload struct { // REQUIRED; Type of the test key - KeyType *TestKeyType `json:"keyType,omitempty"` + KeyType *TestKeyType +} + +// RemoteDebugging - Remote debugging config. +type RemoteDebugging struct { + // Indicate if remote debugging is enabled + Enabled *bool + + // Application debugging port + Port *int32 +} + +// RemoteDebuggingPayload - Remote debugging payload. +type RemoteDebuggingPayload struct { + // Application debugging port. + Port *int32 } // RequiredTraffic - Required inbound or outbound traffic for Azure Spring Apps resource. type RequiredTraffic struct { // READ-ONLY; The direction of required traffic - Direction *TrafficDirection `json:"direction,omitempty" azure:"ro"` + Direction *TrafficDirection // READ-ONLY; The FQDN list of required traffic - Fqdns []*string `json:"fqdns,omitempty" azure:"ro"` + Fqdns []*string // READ-ONLY; The ip list of required traffic - IPs []*string `json:"ips,omitempty" azure:"ro"` + IPs []*string // READ-ONLY; The port of required traffic - Port *int32 `json:"port,omitempty" azure:"ro"` + Port *int32 // READ-ONLY; The protocol of required traffic - Protocol *string `json:"protocol,omitempty" azure:"ro"` + Protocol *string } // Resource - The core properties of ARM resources. type Resource struct { // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ResourceRequests - Deployment resource request payload type ResourceRequests struct { // Required CPU. 1 core can be represented by 1 or 1000m. This should be 500m or 1 for Basic tier, and {500m, 1, 2, 3, 4} // for Standard tier. - CPU *string `json:"cpu,omitempty"` + CPU *string // Required memory. 1 GB can be represented by 1Gi or 1024Mi. This should be {512Mi, 1Gi, 2Gi} for Basic tier, and {512Mi, // 1Gi, 2Gi, …, 8Gi} for Standard tier. - Memory *string `json:"memory,omitempty"` + Memory *string } // ResourceSKU - Describes an available Azure Spring Apps SKU. type ResourceSKU struct { // Gets the capacity of SKU. - Capacity *SKUCapacity `json:"capacity,omitempty"` + Capacity *SKUCapacity // Gets a list of locations and availability zones in those locations where the SKU is available. - LocationInfo []*ResourceSKULocationInfo `json:"locationInfo,omitempty"` + LocationInfo []*ResourceSKULocationInfo // Gets the set of locations that the SKU is available. - Locations []*string `json:"locations,omitempty"` + Locations []*string // Gets the name of SKU. - Name *string `json:"name,omitempty"` + Name *string // Gets the type of resource the SKU applies to. - ResourceType *string `json:"resourceType,omitempty"` + ResourceType *string // Gets the restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - Restrictions []*ResourceSKURestrictions `json:"restrictions,omitempty"` + Restrictions []*ResourceSKURestrictions // Gets the tier of SKU. - Tier *string `json:"tier,omitempty"` + Tier *string } type ResourceSKUCapabilities struct { // Gets an invariant to describe the feature. - Name *string `json:"name,omitempty"` + Name *string // Gets an invariant if the feature is measured by quantity. - Value *string `json:"value,omitempty"` + Value *string } // ResourceSKUCollection - Object that includes an array of Azure Spring Apps SKU and a possible link for next set type ResourceSKUCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of resource SKU - Value []*ResourceSKU `json:"value,omitempty"` + Value []*ResourceSKU } // ResourceSKULocationInfo - Locations and availability zones where the SKU is available type ResourceSKULocationInfo struct { // Gets location of the SKU - Location *string `json:"location,omitempty"` + Location *string // Gets details of capabilities available to a SKU in specific zones. - ZoneDetails []*ResourceSKUZoneDetails `json:"zoneDetails,omitempty"` + ZoneDetails []*ResourceSKUZoneDetails // Gets list of availability zones where the SKU is supported. - Zones []*string `json:"zones,omitempty"` + Zones []*string } // ResourceSKURestrictionInfo - Information about the restriction where the SKU cannot be used type ResourceSKURestrictionInfo struct { // Gets locations where the SKU is restricted - Locations []*string `json:"locations,omitempty"` + Locations []*string // Gets list of availability zones where the SKU is restricted. - Zones []*string `json:"zones,omitempty"` + Zones []*string } // ResourceSKURestrictions - Restrictions where the SKU cannot be used type ResourceSKURestrictions struct { // Gets the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription' - ReasonCode *ResourceSKURestrictionsReasonCode `json:"reasonCode,omitempty"` + ReasonCode *ResourceSKURestrictionsReasonCode // Gets the information about the restriction where the SKU cannot be used. - RestrictionInfo *ResourceSKURestrictionInfo `json:"restrictionInfo,omitempty"` + RestrictionInfo *ResourceSKURestrictionInfo // Gets the type of restrictions. Possible values include: 'Location', 'Zone' - Type *ResourceSKURestrictionsType `json:"type,omitempty"` + Type *ResourceSKURestrictionsType // Gets the value of restrictions. If the restriction type is set to location. This would be different locations where the // SKU is restricted. - Values []*string `json:"values,omitempty"` + Values []*string } // ResourceSKUZoneDetails - Details of capabilities available to a SKU in specific zones type ResourceSKUZoneDetails struct { // Gets a list of capabilities that are available for the SKU in the specified list of zones. - Capabilities []*ResourceSKUCapabilities `json:"capabilities,omitempty"` + Capabilities []*ResourceSKUCapabilities // Gets the set of zones that the SKU is available in with the specified capabilities. - Name []*string `json:"name,omitempty"` + Name []*string } // ResourceUploadDefinition - Resource upload definition payload type ResourceUploadDefinition struct { // Source relative path - RelativePath *string `json:"relativePath,omitempty"` + RelativePath *string // Upload URL - UploadURL *string `json:"uploadUrl,omitempty"` + UploadURL *string } // RuntimeVersionsClientListRuntimeVersionsOptions contains the optional parameters for the RuntimeVersionsClient.ListRuntimeVersions @@ -1977,28 +3537,34 @@ type RuntimeVersionsClientListRuntimeVersionsOptions struct { // SKU - Sku of Azure Spring Apps type SKU struct { // Current capacity of the target resource - Capacity *int32 `json:"capacity,omitempty"` + Capacity *int32 // Name of the Sku - Name *string `json:"name,omitempty"` + Name *string // Tier of the Sku - Tier *string `json:"tier,omitempty"` + Tier *string } // SKUCapacity - The SKU capacity type SKUCapacity struct { // REQUIRED; Gets or sets the minimum. - Minimum *int32 `json:"minimum,omitempty"` + Minimum *int32 // Gets or sets the default. - Default *int32 `json:"default,omitempty"` + Default *int32 // Gets or sets the maximum. - Maximum *int32 `json:"maximum,omitempty"` + Maximum *int32 // Gets or sets the type of the scale. - ScaleType *SKUScaleType `json:"scaleType,omitempty"` + ScaleType *SKUScaleType +} + +// SKUObject - Resource Sku object used for scaling out and scaling in. +type SKUObject struct { + // Sku of the Spring Cloud Gateway resource + SKU *SKU } // SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method. @@ -2006,6 +3572,54 @@ type SKUsClientListOptions struct { // placeholder for future optional parameters } +// Scale - Azure Spring Apps scaling configurations. +type Scale struct { + // Optional. Maximum number of container replicas. Defaults to 10 if not set. + MaxReplicas *int32 + + // Optional. Minimum number of container replicas. + MinReplicas *int32 + + // Scaling rules. + Rules []*ScaleRule +} + +// ScaleRule - Azure Spring Apps App Instance scaling rule. +type ScaleRule struct { + // Azure Queue based scaling. + AzureQueue *QueueScaleRule + + // Custom scale rule. + Custom *CustomScaleRule + + // HTTP requests based scaling. + HTTP *HTTPScaleRule + + // Scale Rule Name + Name *string + + // Tcp requests based scaling. + TCP *TCPScaleRule +} + +// ScaleRuleAuth - Auth Secrets for Azure Spring Apps App Instance Scale Rule +type ScaleRuleAuth struct { + // Name of the Azure Spring Apps App Instance secret from which to pull the auth params. + SecretRef *string + + // Trigger Parameter that uses the secret + TriggerParameter *string +} + +// Secret definition. +type Secret struct { + // Secret Name. + Name *string + + // Secret Value. + Value *string +} + // ServiceRegistriesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceRegistriesClient.BeginCreateOrUpdate // method. type ServiceRegistriesClientBeginCreateOrUpdateOptions struct { @@ -2033,107 +3647,113 @@ type ServiceRegistriesClientListOptions struct { // ServiceRegistryInstance - Collection of instances belong to the Service Registry type ServiceRegistryInstance struct { // READ-ONLY; Name of the Service Registry instance - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Status of the Service Registry instance - Status *string `json:"status,omitempty" azure:"ro"` + Status *string } // ServiceRegistryProperties - Service Registry properties payload type ServiceRegistryProperties struct { // READ-ONLY; Collection of instances belong to Service Registry. - Instances []*ServiceRegistryInstance `json:"instances,omitempty" azure:"ro"` + Instances []*ServiceRegistryInstance // READ-ONLY; State of the Service Registry. - ProvisioningState *ServiceRegistryProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *ServiceRegistryProvisioningState // READ-ONLY; The requested resource quantity for required CPU and Memory. - ResourceRequests *ServiceRegistryResourceRequests `json:"resourceRequests,omitempty" azure:"ro"` + ResourceRequests *ServiceRegistryResourceRequests } // ServiceRegistryResource - Service Registry resource type ServiceRegistryResource struct { // Service Registry properties payload - Properties *ServiceRegistryProperties `json:"properties,omitempty"` + Properties *ServiceRegistryProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServiceRegistryResourceCollection - Object that includes an array of Service Registry resources and a possible link for // next set type ServiceRegistryResourceCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of Service Registry resources - Value []*ServiceRegistryResource `json:"value,omitempty"` + Value []*ServiceRegistryResource } // ServiceRegistryResourceRequests - Resource request payload of Service Registry type ServiceRegistryResourceRequests struct { // READ-ONLY; Cpu allocated to each Service Registry instance - CPU *string `json:"cpu,omitempty" azure:"ro"` + CPU *string // READ-ONLY; Instance count of the Service Registry - InstanceCount *int32 `json:"instanceCount,omitempty" azure:"ro"` + InstanceCount *int32 // READ-ONLY; Memory allocated to each Service Registry instance - Memory *string `json:"memory,omitempty" azure:"ro"` + Memory *string } // ServiceResource - Service resource type ServiceResource struct { // The GEO location of the resource. - Location *string `json:"location,omitempty"` + Location *string // Properties of the Service resource - Properties *ClusterResourceProperties `json:"properties,omitempty"` + Properties *ClusterResourceProperties // Sku of the Service resource - SKU *SKU `json:"sku,omitempty"` + SKU *SKU // Tags of the service which is a list of key value pairs that describe the resource. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // ServiceResourceList - Object that includes an array of Service resources and a possible link for next set type ServiceResourceList 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of Service resources - Value []*ServiceResource `json:"value,omitempty"` + Value []*ServiceResource } // ServiceSpecification - Service specification payload type ServiceSpecification struct { // Specifications of the Log for Azure Monitoring - LogSpecifications []*LogSpecification `json:"logSpecifications,omitempty"` + LogSpecifications []*LogSpecification // Specifications of the Metrics for Azure Monitoring - MetricSpecifications []*MetricSpecification `json:"metricSpecifications,omitempty"` + MetricSpecifications []*MetricSpecification +} + +// ServiceVNetAddons - Additional Service settings in vnet injection instance +type ServiceVNetAddons struct { + // Indicates whether the log stream in vnet injection instance could be accessed from internet. + LogStreamPublicEndpoint *bool } // ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. @@ -2148,6 +3768,18 @@ type ServicesClientBeginDeleteOptions struct { ResumeToken string } +// ServicesClientBeginStartOptions contains the optional parameters for the ServicesClient.BeginStart method. +type ServicesClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientBeginStopOptions contains the optional parameters for the ServicesClient.BeginStop method. +type ServicesClientBeginStopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. type ServicesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. @@ -2199,20 +3831,20 @@ type ServicesClientRegenerateTestKeyOptions struct { // SourceUploadedUserSourceInfo - Uploaded Java source code binary for a deployment type SourceUploadedUserSourceInfo struct { // REQUIRED; Type of the source uploaded - Type *string `json:"type,omitempty"` + Type *string // Selector for the artifact to be used for the deployment for multi-module projects. This should be the relative path to // the target module/project. - ArtifactSelector *string `json:"artifactSelector,omitempty"` + ArtifactSelector *string // Relative path of the storage which stores the source - RelativePath *string `json:"relativePath,omitempty"` + RelativePath *string // Runtime version of the source file - RuntimeVersion *string `json:"runtimeVersion,omitempty"` + RuntimeVersion *string // Version of the source - Version *string `json:"version,omitempty"` + Version *string } // GetUploadedUserSourceInfo implements the UploadedUserSourceInfoClassification interface for type SourceUploadedUserSourceInfo. @@ -2232,170 +3864,293 @@ func (s *SourceUploadedUserSourceInfo) GetUserSourceInfo() *UserSourceInfo { } } +// SsoProperties - Single sign-on related configuration +type SsoProperties struct { + // The public identifier for the application + ClientID *string + + // The secret known only to the application and the authorization server + ClientSecret *string + + // The URI of Issuer Identifier + IssuerURI *string + + // It defines the specific actions applications can be allowed to do on a user's behalf + Scope []*string +} + // StackProperties - KPack ClusterStack properties payload type StackProperties struct { // Id of the ClusterStack. - ID *string `json:"id,omitempty"` + ID *string // Version of the ClusterStack - Version *string `json:"version,omitempty"` + Version *string +} + +// StorageAccount - storage resource of type Azure Storage Account. +type StorageAccount struct { + // REQUIRED; The account key of the Azure Storage Account. + AccountKey *string + + // REQUIRED; The account name of the Azure Storage Account. + AccountName *string + + // REQUIRED; The type of the storage. + StorageType *StorageType +} + +// GetStorageProperties implements the StoragePropertiesClassification interface for type StorageAccount. +func (s *StorageAccount) GetStorageProperties() *StorageProperties { + return &StorageProperties{ + StorageType: s.StorageType, + } +} + +// StoragePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetStorageProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *StorageAccount, *StorageProperties +type StoragePropertiesClassification interface { + // GetStorageProperties returns the StorageProperties content of the underlying type. + GetStorageProperties() *StorageProperties +} + +// StorageProperties - Storage resource payload. +type StorageProperties struct { + // REQUIRED; The type of the storage. + StorageType *StorageType +} + +// GetStorageProperties implements the StoragePropertiesClassification interface for type StorageProperties. +func (s *StorageProperties) GetStorageProperties() *StorageProperties { return s } + +// StorageResource - Storage resource payload. +type StorageResource struct { + // Properties of the storage resource payload. + Properties StoragePropertiesClassification + + // 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 +} + +// StorageResourceCollection - Collection compose of storage resources list and a possible link for next page. +type StorageResourceCollection struct { + // The link to next page of storage list. + NextLink *string + + // The storage resources list. + Value []*StorageResource +} + +// StoragesClientBeginCreateOrUpdateOptions contains the optional parameters for the StoragesClient.BeginCreateOrUpdate method. +type StoragesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// StoragesClientBeginDeleteOptions contains the optional parameters for the StoragesClient.BeginDelete method. +type StoragesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// StoragesClientGetOptions contains the optional parameters for the StoragesClient.Get method. +type StoragesClientGetOptions struct { + // placeholder for future optional parameters +} + +// StoragesClientListOptions contains the optional parameters for the StoragesClient.NewListPager method. +type StoragesClientListOptions struct { + // placeholder for future optional parameters } // SupportedBuildpackResource - Supported buildpack resource payload type SupportedBuildpackResource struct { // Supported buildpack resource properties - Properties *SupportedBuildpackResourceProperties `json:"properties,omitempty"` + Properties *SupportedBuildpackResourceProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SupportedBuildpackResourceProperties - Supported buildpack resource properties type SupportedBuildpackResourceProperties struct { // The id of supported buildpack - BuildpackID *string `json:"buildpackId,omitempty"` + BuildpackID *string } // SupportedBuildpacksCollection - Object that includes an array of supported buildpacks resources and a possible link for // next set type SupportedBuildpacksCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of supported buildpacks resources - Value []*SupportedBuildpackResource `json:"value,omitempty"` + Value []*SupportedBuildpackResource } // SupportedRuntimeVersion - Supported deployment runtime version descriptor. type SupportedRuntimeVersion struct { // The platform of this runtime version (possible values: "Java" or ".NET"). - Platform *SupportedRuntimePlatform `json:"platform,omitempty"` + Platform *SupportedRuntimePlatform // The raw value which could be passed to deployment CRUD operations. - Value *SupportedRuntimeValue `json:"value,omitempty"` + Value *SupportedRuntimeValue // The detailed version (major.minor) of the platform. - Version *string `json:"version,omitempty"` + Version *string } // SupportedStackResource - Supported stack resource payload type SupportedStackResource struct { // Supported stack resource properties - Properties *SupportedStackResourceProperties `json:"properties,omitempty"` + Properties *SupportedStackResourceProperties // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // SupportedStackResourceProperties - Supported stack resource properties type SupportedStackResourceProperties struct { // The id of supported stack - StackID *string `json:"stackId,omitempty"` + StackID *string // The version of supported stack - Version *string `json:"version,omitempty"` + Version *string } // SupportedStacksCollection - Object that includes an array of supported stacks resources and a possible link for next set type SupportedStacksCollection 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 `json:"nextLink,omitempty"` + NextLink *string // Collection of supported stacks resources - Value []*SupportedStackResource `json:"value,omitempty"` + Value []*SupportedStackResource } // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). - CreatedAt *time.Time `json:"createdAt,omitempty"` + CreatedAt *time.Time // The identity that created the resource. - CreatedBy *string `json:"createdBy,omitempty"` + CreatedBy *string // The type of identity that created the resource. - CreatedByType *CreatedByType `json:"createdByType,omitempty"` + CreatedByType *CreatedByType // The timestamp of resource modification (UTC). - LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + LastModifiedAt *time.Time // The identity that last modified the resource. - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedBy *string // The type of identity that last modified the resource. - LastModifiedByType *LastModifiedByType `json:"lastModifiedByType,omitempty"` + LastModifiedByType *LastModifiedByType +} + +// TCPScaleRule - Azure Spring Apps App Instance Tcp scaling rule. +type TCPScaleRule struct { + // Authentication secrets for the tcp scale rule. + Auth []*ScaleRuleAuth + + // Metadata properties to describe tcp scale rule. + Metadata map[string]*string +} + +// TCPSocketAction describes an action based on opening a socket +type TCPSocketAction struct { + // REQUIRED; The type of the action to take to perform the health check. + Type *ProbeActionType +} + +// GetProbeAction implements the ProbeActionClassification interface for type TCPSocketAction. +func (t *TCPSocketAction) GetProbeAction() *ProbeAction { + return &ProbeAction{ + Type: t.Type, + } } // TemporaryDisk - Temporary disk payload type TemporaryDisk struct { // Mount path of the temporary disk - MountPath *string `json:"mountPath,omitempty"` + MountPath *string // Size of the temporary disk in GB - SizeInGB *int32 `json:"sizeInGB,omitempty"` + SizeInGB *int32 } // TestKeys - Test keys payload type TestKeys struct { // Indicates whether the test endpoint feature enabled or not - Enabled *bool `json:"enabled,omitempty"` + Enabled *bool // Primary key - PrimaryKey *string `json:"primaryKey,omitempty"` + PrimaryKey *string // Primary test endpoint - PrimaryTestEndpoint *string `json:"primaryTestEndpoint,omitempty"` + PrimaryTestEndpoint *string // Secondary key - SecondaryKey *string `json:"secondaryKey,omitempty"` + SecondaryKey *string // Secondary test endpoint - SecondaryTestEndpoint *string `json:"secondaryTestEndpoint,omitempty"` + SecondaryTestEndpoint *string } // TrackedResource - The resource model definition for a ARM tracked top level resource. type TrackedResource struct { // The GEO location of the resource. - Location *string `json:"location,omitempty"` + Location *string // Tags of the service which is a list of key value pairs that describe the resource. - Tags map[string]*string `json:"tags,omitempty"` + Tags map[string]*string // READ-ONLY; Fully qualified resource Id for the resource. - ID *string `json:"id,omitempty" azure:"ro"` + ID *string // READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` + Name *string // READ-ONLY; Metadata pertaining to creation and last modification of the resource. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + SystemData *SystemData // READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + Type *string } // TriggeredBuildResult - The build result triggered by a build type TriggeredBuildResult struct { // The unique build id of this build result - ID *string `json:"id,omitempty"` + ID *string } // UploadedUserSourceInfoClassification provides polymorphic access to related types. @@ -2411,13 +4166,13 @@ type UploadedUserSourceInfoClassification interface { // UploadedUserSourceInfo - Source with uploaded location type UploadedUserSourceInfo struct { // REQUIRED; Type of the source uploaded - Type *string `json:"type,omitempty"` + Type *string // Relative path of the storage which stores the source - RelativePath *string `json:"relativePath,omitempty"` + RelativePath *string // Version of the source - Version *string `json:"version,omitempty"` + Version *string } // GetUploadedUserSourceInfo implements the UploadedUserSourceInfoClassification interface for type UploadedUserSourceInfo. @@ -2431,11 +4186,20 @@ func (u *UploadedUserSourceInfo) GetUserSourceInfo() *UserSourceInfo { } } +// UserAssignedManagedIdentity - The details of the user-assigned managed identity assigned to an App. +type UserAssignedManagedIdentity struct { + // READ-ONLY; Client Id of user-assigned managed identity. + ClientID *string + + // READ-ONLY; Principal Id of user-assigned managed identity. + PrincipalID *string +} + // UserSourceInfoClassification provides polymorphic access to related types. // Call the interface's GetUserSourceInfo() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *BuildResultUserSourceInfo, *JarUploadedUserSourceInfo, *NetCoreZipUploadedUserSourceInfo, *SourceUploadedUserSourceInfo, -// - *UploadedUserSourceInfo, *UserSourceInfo +// - *BuildResultUserSourceInfo, *CustomContainerUserSourceInfo, *JarUploadedUserSourceInfo, *NetCoreZipUploadedUserSourceInfo, +// - *SourceUploadedUserSourceInfo, *UploadedUserSourceInfo, *UserSourceInfo type UserSourceInfoClassification interface { // GetUserSourceInfo returns the UserSourceInfo content of the underlying type. GetUserSourceInfo() *UserSourceInfo @@ -2444,10 +4208,10 @@ type UserSourceInfoClassification interface { // UserSourceInfo - Source information for a deployment type UserSourceInfo struct { // REQUIRED; Type of the source uploaded - Type *string `json:"type,omitempty"` + Type *string // Version of the source - Version *string `json:"version,omitempty"` + Version *string } // GetUserSourceInfo implements the UserSourceInfoClassification interface for type UserSourceInfo. @@ -2456,8 +4220,8 @@ func (u *UserSourceInfo) GetUserSourceInfo() *UserSourceInfo { return u } // ValidationMessages - Validate messages of the configuration service git repositories type ValidationMessages struct { // Detailed validation messages. - Messages []*string `json:"messages,omitempty"` + Messages []*string // The name of the configuration service git repository. - Name *string `json:"name,omitempty"` + Name *string } diff --git a/sdk/resourcemanager/appplatform/armappplatform/models_serde.go b/sdk/resourcemanager/appplatform/armappplatform/models_serde.go index c0572f985dac..9530c2fd6528 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/models_serde.go +++ b/sdk/resourcemanager/appplatform/armappplatform/models_serde.go @@ -16,15 +16,15 @@ import ( "reflect" ) -// MarshalJSON implements the json.Marshaller interface for type ActiveDeploymentCollection. -func (a ActiveDeploymentCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type APIPortalCustomDomainProperties. +func (a APIPortalCustomDomainProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "activeDeploymentNames", a.ActiveDeploymentNames) + populate(objectMap, "thumbprint", a.Thumbprint) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveDeploymentCollection. -func (a *ActiveDeploymentCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type APIPortalCustomDomainProperties. +func (a *APIPortalCustomDomainProperties) UnmarshalJSON(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) @@ -32,8 +32,8 @@ func (a *ActiveDeploymentCollection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "activeDeploymentNames": - err = unpopulate(val, "ActiveDeploymentNames", &a.ActiveDeploymentNames) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &a.Thumbprint) delete(rawMsg, key) } if err != nil { @@ -43,12 +43,10 @@ func (a *ActiveDeploymentCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AppResource. -func (a AppResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type APIPortalCustomDomainResource. +func (a APIPortalCustomDomainResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", a.ID) - populate(objectMap, "identity", a.Identity) - populate(objectMap, "location", a.Location) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) populate(objectMap, "systemData", a.SystemData) @@ -56,8 +54,8 @@ func (a AppResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AppResource. -func (a *AppResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type APIPortalCustomDomainResource. +func (a *APIPortalCustomDomainResource) UnmarshalJSON(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) @@ -68,12 +66,6 @@ func (a *AppResource) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &a.Identity) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &a.Location) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) @@ -94,16 +86,16 @@ func (a *AppResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AppResourceCollection. -func (a AppResourceCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type APIPortalCustomDomainResourceCollection. +func (a APIPortalCustomDomainResourceCollection) 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 AppResourceCollection. -func (a *AppResourceCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type APIPortalCustomDomainResourceCollection. +func (a *APIPortalCustomDomainResourceCollection) UnmarshalJSON(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) @@ -125,24 +117,54 @@ func (a *AppResourceCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AppResourceProperties. -func (a AppResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type APIPortalInstance. +func (a APIPortalInstance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "addonConfigs", a.AddonConfigs) - populate(objectMap, "enableEndToEndTLS", a.EnableEndToEndTLS) - populate(objectMap, "fqdn", a.Fqdn) + populate(objectMap, "name", a.Name) + populate(objectMap, "status", a.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIPortalInstance. +func (a *APIPortalInstance) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + 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 APIPortalProperties. +func (a APIPortalProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gatewayIds", a.GatewayIDs) populate(objectMap, "httpsOnly", a.HTTPSOnly) - populate(objectMap, "loadedCertificates", a.LoadedCertificates) - populate(objectMap, "persistentDisk", a.PersistentDisk) + populate(objectMap, "instances", a.Instances) populate(objectMap, "provisioningState", a.ProvisioningState) populate(objectMap, "public", a.Public) - populate(objectMap, "temporaryDisk", a.TemporaryDisk) + populate(objectMap, "resourceRequests", a.ResourceRequests) + populate(objectMap, "sourceUrls", a.SourceUrls) + populate(objectMap, "ssoProperties", a.SsoProperties) populate(objectMap, "url", a.URL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AppResourceProperties. -func (a *AppResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type APIPortalProperties. +func (a *APIPortalProperties) UnmarshalJSON(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) @@ -150,23 +172,14 @@ func (a *AppResourceProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "addonConfigs": - err = unpopulate(val, "AddonConfigs", &a.AddonConfigs) - delete(rawMsg, key) - case "enableEndToEndTLS": - err = unpopulate(val, "EnableEndToEndTLS", &a.EnableEndToEndTLS) - delete(rawMsg, key) - case "fqdn": - err = unpopulate(val, "Fqdn", &a.Fqdn) + case "gatewayIds": + err = unpopulate(val, "GatewayIDs", &a.GatewayIDs) delete(rawMsg, key) case "httpsOnly": err = unpopulate(val, "HTTPSOnly", &a.HTTPSOnly) delete(rawMsg, key) - case "loadedCertificates": - err = unpopulate(val, "LoadedCertificates", &a.LoadedCertificates) - delete(rawMsg, key) - case "persistentDisk": - err = unpopulate(val, "PersistentDisk", &a.PersistentDisk) + case "instances": + err = unpopulate(val, "Instances", &a.Instances) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) @@ -174,8 +187,14 @@ func (a *AppResourceProperties) UnmarshalJSON(data []byte) error { case "public": err = unpopulate(val, "Public", &a.Public) delete(rawMsg, key) - case "temporaryDisk": - err = unpopulate(val, "TemporaryDisk", &a.TemporaryDisk) + case "resourceRequests": + err = unpopulate(val, "ResourceRequests", &a.ResourceRequests) + delete(rawMsg, key) + case "sourceUrls": + err = unpopulate(val, "SourceUrls", &a.SourceUrls) + delete(rawMsg, key) + case "ssoProperties": + err = unpopulate(val, "SsoProperties", &a.SsoProperties) delete(rawMsg, key) case "url": err = unpopulate(val, "URL", &a.URL) @@ -188,15 +207,20 @@ func (a *AppResourceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ApplicationInsightsAgentVersions. -func (a ApplicationInsightsAgentVersions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type APIPortalResource. +func (a APIPortalResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "java", a.Java) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "sku", a.SKU) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationInsightsAgentVersions. -func (a *ApplicationInsightsAgentVersions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type APIPortalResource. +func (a *APIPortalResource) UnmarshalJSON(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) @@ -204,8 +228,23 @@ func (a *ApplicationInsightsAgentVersions) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "java": - err = unpopulate(val, "Java", &a.Java) + 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 "sku": + err = unpopulate(val, "SKU", &a.SKU) + 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 { @@ -215,16 +254,16 @@ func (a *ApplicationInsightsAgentVersions) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AvailableOperations. -func (a AvailableOperations) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type APIPortalResourceCollection. +func (a APIPortalResourceCollection) 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 AvailableOperations. -func (a *AvailableOperations) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type APIPortalResourceCollection. +func (a *APIPortalResourceCollection) UnmarshalJSON(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) @@ -246,15 +285,16 @@ func (a *AvailableOperations) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AvailableRuntimeVersions. -func (a AvailableRuntimeVersions) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type APIPortalResourceRequests. +func (a APIPortalResourceRequests) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", a.Value) + populate(objectMap, "cpu", a.CPU) + populate(objectMap, "memory", a.Memory) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableRuntimeVersions. -func (a *AvailableRuntimeVersions) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type APIPortalResourceRequests. +func (a *APIPortalResourceRequests) UnmarshalJSON(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) @@ -262,8 +302,11 @@ func (a *AvailableRuntimeVersions) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &a.Value) + case "cpu": + err = unpopulate(val, "CPU", &a.CPU) + delete(rawMsg, key) + case "memory": + err = unpopulate(val, "Memory", &a.Memory) delete(rawMsg, key) } if err != nil { @@ -273,939 +316,970 @@ func (a *AvailableRuntimeVersions) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BindingResource. -func (b BindingResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AcceleratorAuthSetting. +func (a AcceleratorAuthSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "systemData", b.SystemData) - populate(objectMap, "type", b.Type) + objectMap["authType"] = a.AuthType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BindingResource. -func (b *BindingResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AcceleratorAuthSetting. +func (a *AcceleratorAuthSetting) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &b.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) + case "authType": + err = unpopulate(val, "AuthType", &a.AuthType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BindingResourceCollection. -func (b BindingResourceCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AcceleratorBasicAuthSetting. +func (a AcceleratorBasicAuthSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) + objectMap["authType"] = "BasicAuth" + populate(objectMap, "password", a.Password) + populate(objectMap, "username", a.Username) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BindingResourceCollection. -func (b *BindingResourceCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AcceleratorBasicAuthSetting. +func (a *AcceleratorBasicAuthSetting) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) + case "authType": + err = unpopulate(val, "AuthType", &a.AuthType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &b.Value) + case "password": + err = unpopulate(val, "Password", &a.Password) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &a.Username) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BindingResourceProperties. -func (b BindingResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AcceleratorGitRepository. +func (a AcceleratorGitRepository) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bindingParameters", b.BindingParameters) - populate(objectMap, "createdAt", b.CreatedAt) - populate(objectMap, "generatedProperties", b.GeneratedProperties) - populate(objectMap, "key", b.Key) - populate(objectMap, "resourceId", b.ResourceID) - populate(objectMap, "resourceName", b.ResourceName) - populate(objectMap, "resourceType", b.ResourceType) - populate(objectMap, "updatedAt", b.UpdatedAt) + populate(objectMap, "authSetting", a.AuthSetting) + populate(objectMap, "branch", a.Branch) + populate(objectMap, "commit", a.Commit) + populate(objectMap, "gitTag", a.GitTag) + populate(objectMap, "intervalInSeconds", a.IntervalInSeconds) + populate(objectMap, "url", a.URL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BindingResourceProperties. -func (b *BindingResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AcceleratorGitRepository. +func (a *AcceleratorGitRepository) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "bindingParameters": - err = unpopulate(val, "BindingParameters", &b.BindingParameters) - delete(rawMsg, key) - case "createdAt": - err = unpopulate(val, "CreatedAt", &b.CreatedAt) + case "authSetting": + a.AuthSetting, err = unmarshalAcceleratorAuthSettingClassification(val) delete(rawMsg, key) - case "generatedProperties": - err = unpopulate(val, "GeneratedProperties", &b.GeneratedProperties) - delete(rawMsg, key) - case "key": - err = unpopulate(val, "Key", &b.Key) + case "branch": + err = unpopulate(val, "Branch", &a.Branch) delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &b.ResourceID) + case "commit": + err = unpopulate(val, "Commit", &a.Commit) delete(rawMsg, key) - case "resourceName": - err = unpopulate(val, "ResourceName", &b.ResourceName) + case "gitTag": + err = unpopulate(val, "GitTag", &a.GitTag) delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &b.ResourceType) + case "intervalInSeconds": + err = unpopulate(val, "IntervalInSeconds", &a.IntervalInSeconds) delete(rawMsg, key) - case "updatedAt": - err = unpopulate(val, "UpdatedAt", &b.UpdatedAt) + case "url": + err = unpopulate(val, "URL", &a.URL) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Build. -func (b Build) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AcceleratorPublicSetting. +func (a AcceleratorPublicSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "systemData", b.SystemData) - populate(objectMap, "type", b.Type) + objectMap["authType"] = "Public" return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Build. -func (b *Build) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AcceleratorPublicSetting. +func (a *AcceleratorPublicSetting) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &b.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) + case "authType": + err = unpopulate(val, "AuthType", &a.AuthType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildCollection. -func (b BuildCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AcceleratorSSHSetting. +func (a AcceleratorSSHSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) + objectMap["authType"] = "SSH" + populate(objectMap, "hostKey", a.HostKey) + populate(objectMap, "hostKeyAlgorithm", a.HostKeyAlgorithm) + populate(objectMap, "privateKey", a.PrivateKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildCollection. -func (b *BuildCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AcceleratorSSHSetting. +func (a *AcceleratorSSHSetting) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) + case "authType": + err = unpopulate(val, "AuthType", &a.AuthType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &b.Value) + case "hostKey": + err = unpopulate(val, "HostKey", &a.HostKey) + delete(rawMsg, key) + case "hostKeyAlgorithm": + err = unpopulate(val, "HostKeyAlgorithm", &a.HostKeyAlgorithm) + delete(rawMsg, key) + case "privateKey": + err = unpopulate(val, "PrivateKey", &a.PrivateKey) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildProperties. -func (b BuildProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ActiveDeploymentCollection. +func (a ActiveDeploymentCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "agentPool", b.AgentPool) - populate(objectMap, "builder", b.Builder) - populate(objectMap, "env", b.Env) - populate(objectMap, "provisioningState", b.ProvisioningState) - populate(objectMap, "relativePath", b.RelativePath) - populate(objectMap, "triggeredBuildResult", b.TriggeredBuildResult) + populate(objectMap, "activeDeploymentNames", a.ActiveDeploymentNames) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildProperties. -func (b *BuildProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ActiveDeploymentCollection. +func (a *ActiveDeploymentCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "agentPool": - err = unpopulate(val, "AgentPool", &b.AgentPool) - delete(rawMsg, key) - case "builder": - err = unpopulate(val, "Builder", &b.Builder) - delete(rawMsg, key) - case "env": - err = unpopulate(val, "Env", &b.Env) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) - delete(rawMsg, key) - case "relativePath": - err = unpopulate(val, "RelativePath", &b.RelativePath) - delete(rawMsg, key) - case "triggeredBuildResult": - err = unpopulate(val, "TriggeredBuildResult", &b.TriggeredBuildResult) + case "activeDeploymentNames": + err = unpopulate(val, "ActiveDeploymentNames", &a.ActiveDeploymentNames) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildResult. -func (b BuildResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AppResource. +func (a AppResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "systemData", b.SystemData) - populate(objectMap, "type", b.Type) + populate(objectMap, "id", a.ID) + populate(objectMap, "identity", a.Identity) + populate(objectMap, "location", a.Location) + 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 BuildResult. -func (b *BuildResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AppResource. +func (a *AppResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &b.ID) + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &a.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &b.Name) + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &b.Properties) + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &b.SystemData) + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &b.Type) + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildResultCollection. -func (b BuildResultCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AppResourceCollection. +func (a AppResourceCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildResultCollection. -func (b *BuildResultCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AppResourceCollection. +func (a *AppResourceCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &b.Value) + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildResultLog. -func (b BuildResultLog) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AppResourceProperties. +func (a AppResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "blobUrl", b.BlobURL) + populate(objectMap, "addonConfigs", a.AddonConfigs) + populate(objectMap, "customPersistentDisks", a.CustomPersistentDisks) + populate(objectMap, "enableEndToEndTLS", a.EnableEndToEndTLS) + populate(objectMap, "fqdn", a.Fqdn) + populate(objectMap, "httpsOnly", a.HTTPSOnly) + populate(objectMap, "ingressSettings", a.IngressSettings) + populate(objectMap, "loadedCertificates", a.LoadedCertificates) + populate(objectMap, "persistentDisk", a.PersistentDisk) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "public", a.Public) + populate(objectMap, "secrets", a.Secrets) + populate(objectMap, "temporaryDisk", a.TemporaryDisk) + populate(objectMap, "url", a.URL) + populate(objectMap, "vnetAddons", a.VnetAddons) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildResultLog. -func (b *BuildResultLog) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AppResourceProperties. +func (a *AppResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "blobUrl": - err = unpopulate(val, "BlobURL", &b.BlobURL) + case "addonConfigs": + err = unpopulate(val, "AddonConfigs", &a.AddonConfigs) + delete(rawMsg, key) + case "customPersistentDisks": + err = unpopulate(val, "CustomPersistentDisks", &a.CustomPersistentDisks) + delete(rawMsg, key) + case "enableEndToEndTLS": + err = unpopulate(val, "EnableEndToEndTLS", &a.EnableEndToEndTLS) + delete(rawMsg, key) + case "fqdn": + err = unpopulate(val, "Fqdn", &a.Fqdn) + delete(rawMsg, key) + case "httpsOnly": + err = unpopulate(val, "HTTPSOnly", &a.HTTPSOnly) + delete(rawMsg, key) + case "ingressSettings": + err = unpopulate(val, "IngressSettings", &a.IngressSettings) + delete(rawMsg, key) + case "loadedCertificates": + err = unpopulate(val, "LoadedCertificates", &a.LoadedCertificates) + delete(rawMsg, key) + case "persistentDisk": + err = unpopulate(val, "PersistentDisk", &a.PersistentDisk) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "public": + err = unpopulate(val, "Public", &a.Public) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &a.Secrets) + delete(rawMsg, key) + case "temporaryDisk": + err = unpopulate(val, "TemporaryDisk", &a.TemporaryDisk) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &a.URL) + delete(rawMsg, key) + case "vnetAddons": + err = unpopulate(val, "VnetAddons", &a.VnetAddons) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildResultProperties. -func (b BuildResultProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AppVNetAddons. +func (a AppVNetAddons) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "buildPodName", b.BuildPodName) - populate(objectMap, "buildStages", b.BuildStages) - populate(objectMap, "name", b.Name) - populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "publicEndpoint", a.PublicEndpoint) + populate(objectMap, "publicEndpointUrl", a.PublicEndpointURL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildResultProperties. -func (b *BuildResultProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AppVNetAddons. +func (a *AppVNetAddons) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "buildPodName": - err = unpopulate(val, "BuildPodName", &b.BuildPodName) + case "publicEndpoint": + err = unpopulate(val, "PublicEndpoint", &a.PublicEndpoint) delete(rawMsg, key) - case "buildStages": - err = unpopulate(val, "BuildStages", &b.BuildStages) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + case "publicEndpointUrl": + err = unpopulate(val, "PublicEndpointURL", &a.PublicEndpointURL) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildResultUserSourceInfo. -func (b BuildResultUserSourceInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationAcceleratorComponent. +func (a ApplicationAcceleratorComponent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "buildResultId", b.BuildResultID) - objectMap["type"] = "BuildResult" - populate(objectMap, "version", b.Version) + populate(objectMap, "instances", a.Instances) + populate(objectMap, "name", a.Name) + populate(objectMap, "resourceRequests", a.ResourceRequests) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildResultUserSourceInfo. -func (b *BuildResultUserSourceInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationAcceleratorComponent. +func (a *ApplicationAcceleratorComponent) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "buildResultId": - err = unpopulate(val, "BuildResultID", &b.BuildResultID) + case "instances": + err = unpopulate(val, "Instances", &a.Instances) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &b.Version) + case "resourceRequests": + err = unpopulate(val, "ResourceRequests", &a.ResourceRequests) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildService. -func (b BuildService) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationAcceleratorInstance. +func (a ApplicationAcceleratorInstance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "systemData", b.SystemData) - populate(objectMap, "type", b.Type) + populate(objectMap, "name", a.Name) + populate(objectMap, "status", a.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildService. -func (b *BuildService) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationAcceleratorInstance. +func (a *ApplicationAcceleratorInstance) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &b.SystemData) + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) + case "status": + err = unpopulate(val, "Status", &a.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildServiceAgentPoolProperties. -func (b BuildServiceAgentPoolProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationAcceleratorProperties. +func (a ApplicationAcceleratorProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "poolSize", b.PoolSize) - populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "components", a.Components) + populate(objectMap, "provisioningState", a.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServiceAgentPoolProperties. -func (b *BuildServiceAgentPoolProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationAcceleratorProperties. +func (a *ApplicationAcceleratorProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "poolSize": - err = unpopulate(val, "PoolSize", &b.PoolSize) + case "components": + err = unpopulate(val, "Components", &a.Components) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildServiceAgentPoolResource. -func (b BuildServiceAgentPoolResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationAcceleratorResource. +func (a ApplicationAcceleratorResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "systemData", b.SystemData) - populate(objectMap, "type", b.Type) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "sku", a.SKU) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServiceAgentPoolResource. -func (b *BuildServiceAgentPoolResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationAcceleratorResource. +func (a *ApplicationAcceleratorResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &b.ID) + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &b.Name) + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &b.Properties) + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &b.SystemData) + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &b.Type) + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildServiceAgentPoolResourceCollection. -func (b BuildServiceAgentPoolResourceCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationAcceleratorResourceCollection. +func (a ApplicationAcceleratorResourceCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServiceAgentPoolResourceCollection. -func (b *BuildServiceAgentPoolResourceCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationAcceleratorResourceCollection. +func (a *ApplicationAcceleratorResourceCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &b.Value) + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildServiceAgentPoolSizeProperties. -func (b BuildServiceAgentPoolSizeProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationAcceleratorResourceRequests. +func (a ApplicationAcceleratorResourceRequests) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cpu", b.CPU) - populate(objectMap, "memory", b.Memory) - populate(objectMap, "name", b.Name) + populate(objectMap, "cpu", a.CPU) + populate(objectMap, "instanceCount", a.InstanceCount) + populate(objectMap, "memory", a.Memory) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServiceAgentPoolSizeProperties. -func (b *BuildServiceAgentPoolSizeProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationAcceleratorResourceRequests. +func (a *ApplicationAcceleratorResourceRequests) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "cpu": - err = unpopulate(val, "CPU", &b.CPU) + err = unpopulate(val, "CPU", &a.CPU) delete(rawMsg, key) - case "memory": - err = unpopulate(val, "Memory", &b.Memory) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &a.InstanceCount) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) + case "memory": + err = unpopulate(val, "Memory", &a.Memory) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildServiceCollection. -func (b BuildServiceCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationInsightsAgentVersions. +func (a ApplicationInsightsAgentVersions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) + populate(objectMap, "java", a.Java) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServiceCollection. -func (b *BuildServiceCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationInsightsAgentVersions. +func (a *ApplicationInsightsAgentVersions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &b.Value) + case "java": + err = unpopulate(val, "Java", &a.Java) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildServiceProperties. -func (b BuildServiceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationLiveViewComponent. +func (a ApplicationLiveViewComponent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "kPackVersion", b.KPackVersion) - populate(objectMap, "provisioningState", b.ProvisioningState) - populate(objectMap, "resourceRequests", b.ResourceRequests) + populate(objectMap, "instances", a.Instances) + populateAny(objectMap, "name", a.Name) + populate(objectMap, "resourceRequests", a.ResourceRequests) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServiceProperties. -func (b *BuildServiceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationLiveViewComponent. +func (a *ApplicationLiveViewComponent) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "kPackVersion": - err = unpopulate(val, "KPackVersion", &b.KPackVersion) + case "instances": + err = unpopulate(val, "Instances", &a.Instances) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "resourceRequests": - err = unpopulate(val, "ResourceRequests", &b.ResourceRequests) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BuildServicePropertiesResourceRequests. -func (b BuildServicePropertiesResourceRequests) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "cpu", b.CPU) - populate(objectMap, "memory", b.Memory) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServicePropertiesResourceRequests. -func (b *BuildServicePropertiesResourceRequests) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "cpu": - err = unpopulate(val, "CPU", &b.CPU) - delete(rawMsg, key) - case "memory": - err = unpopulate(val, "Memory", &b.Memory) + err = unpopulate(val, "ResourceRequests", &a.ResourceRequests) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildStageProperties. -func (b BuildStageProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationLiveViewInstance. +func (a ApplicationLiveViewInstance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", b.Name) - populate(objectMap, "status", b.Status) + populate(objectMap, "name", a.Name) + populate(objectMap, "status", a.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildStageProperties. -func (b *BuildStageProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationLiveViewInstance. +func (a *ApplicationLiveViewInstance) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "name": - err = unpopulate(val, "Name", &b.Name) + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "status": - err = unpopulate(val, "Status", &b.Status) + err = unpopulate(val, "Status", &a.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuilderProperties. -func (b BuilderProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationLiveViewProperties. +func (a ApplicationLiveViewProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "buildpackGroups", b.BuildpackGroups) - populate(objectMap, "provisioningState", b.ProvisioningState) - populate(objectMap, "stack", b.Stack) + populate(objectMap, "components", a.Components) + populate(objectMap, "provisioningState", a.ProvisioningState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuilderProperties. -func (b *BuilderProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationLiveViewProperties. +func (a *ApplicationLiveViewProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "buildpackGroups": - err = unpopulate(val, "BuildpackGroups", &b.BuildpackGroups) + case "components": + err = unpopulate(val, "Components", &a.Components) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) - delete(rawMsg, key) - case "stack": - err = unpopulate(val, "Stack", &b.Stack) + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuilderResource. -func (b BuilderResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationLiveViewResource. +func (a ApplicationLiveViewResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "systemData", b.SystemData) - populate(objectMap, "type", b.Type) + populate(objectMap, "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 BuilderResource. -func (b *BuilderResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationLiveViewResource. +func (a *ApplicationLiveViewResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &b.ID) + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &b.Name) + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &b.Properties) + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &b.SystemData) + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &b.Type) + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuilderResourceCollection. -func (b BuilderResourceCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationLiveViewResourceCollection. +func (a ApplicationLiveViewResourceCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuilderResourceCollection. -func (b *BuilderResourceCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationLiveViewResourceCollection. +func (a *ApplicationLiveViewResourceCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &b.Value) + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildpackBindingLaunchProperties. -func (b BuildpackBindingLaunchProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ApplicationLiveViewResourceRequests. +func (a ApplicationLiveViewResourceRequests) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "secrets", b.Secrets) + populate(objectMap, "cpu", a.CPU) + populate(objectMap, "instanceCount", a.InstanceCount) + populate(objectMap, "memory", a.Memory) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildpackBindingLaunchProperties. -func (b *BuildpackBindingLaunchProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationLiveViewResourceRequests. +func (a *ApplicationLiveViewResourceRequests) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &b.Properties) + case "cpu": + err = unpopulate(val, "CPU", &a.CPU) delete(rawMsg, key) - case "secrets": - err = unpopulate(val, "Secrets", &b.Secrets) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &a.InstanceCount) + delete(rawMsg, key) + case "memory": + err = unpopulate(val, "Memory", &a.Memory) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildpackBindingProperties. -func (b BuildpackBindingProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AvailableOperations. +func (a AvailableOperations) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "bindingType", b.BindingType) - populate(objectMap, "launchProperties", b.LaunchProperties) - populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildpackBindingProperties. -func (b *BuildpackBindingProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableOperations. +func (a *AvailableOperations) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "bindingType": - err = unpopulate(val, "BindingType", &b.BindingType) - delete(rawMsg, key) - case "launchProperties": - err = unpopulate(val, "LaunchProperties", &b.LaunchProperties) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildpackBindingResource. -func (b BuildpackBindingResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AvailableRuntimeVersions. +func (a AvailableRuntimeVersions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "systemData", b.SystemData) - populate(objectMap, "type", b.Type) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildpackBindingResource. -func (b *BuildpackBindingResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableRuntimeVersions. +func (a *AvailableRuntimeVersions) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &b.ID) + 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 AzureFileVolume. +func (a AzureFileVolume) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enableSubPath", a.EnableSubPath) + populate(objectMap, "mountOptions", a.MountOptions) + populate(objectMap, "mountPath", a.MountPath) + populate(objectMap, "readOnly", a.ReadOnly) + populate(objectMap, "shareName", a.ShareName) + objectMap["type"] = TypeAzureFileVolume + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFileVolume. +func (a *AzureFileVolume) UnmarshalJSON(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 "enableSubPath": + err = unpopulate(val, "EnableSubPath", &a.EnableSubPath) + delete(rawMsg, key) + case "mountOptions": + err = unpopulate(val, "MountOptions", &a.MountOptions) + delete(rawMsg, key) + case "mountPath": + err = unpopulate(val, "MountPath", &a.MountPath) + delete(rawMsg, key) + case "readOnly": + err = unpopulate(val, "ReadOnly", &a.ReadOnly) + delete(rawMsg, key) + case "shareName": + err = unpopulate(val, "ShareName", &a.ShareName) + 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 BindingResource. +func (b BindingResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BindingResource. +func (b *BindingResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &b.Name) @@ -1227,16 +1301,16 @@ func (b *BuildpackBindingResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildpackBindingResourceCollection. -func (b BuildpackBindingResourceCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BindingResourceCollection. +func (b BindingResourceCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", b.NextLink) populate(objectMap, "value", b.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildpackBindingResourceCollection. -func (b *BuildpackBindingResourceCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BindingResourceCollection. +func (b *BindingResourceCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", b, err) @@ -1258,15 +1332,22 @@ func (b *BuildpackBindingResourceCollection) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildpackProperties. -func (b BuildpackProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BindingResourceProperties. +func (b BindingResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) + populate(objectMap, "bindingParameters", b.BindingParameters) + populate(objectMap, "createdAt", b.CreatedAt) + populate(objectMap, "generatedProperties", b.GeneratedProperties) + populate(objectMap, "key", b.Key) + populate(objectMap, "resourceId", b.ResourceID) + populate(objectMap, "resourceName", b.ResourceName) + populate(objectMap, "resourceType", b.ResourceType) + populate(objectMap, "updatedAt", b.UpdatedAt) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildpackProperties. -func (b *BuildpackProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BindingResourceProperties. +func (b *BindingResourceProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", b, err) @@ -1274,8 +1355,29 @@ func (b *BuildpackProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &b.ID) + case "bindingParameters": + err = unpopulate(val, "BindingParameters", &b.BindingParameters) + delete(rawMsg, key) + case "createdAt": + err = unpopulate(val, "CreatedAt", &b.CreatedAt) + delete(rawMsg, key) + case "generatedProperties": + err = unpopulate(val, "GeneratedProperties", &b.GeneratedProperties) + delete(rawMsg, key) + case "key": + err = unpopulate(val, "Key", &b.Key) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &b.ResourceID) + delete(rawMsg, key) + case "resourceName": + err = unpopulate(val, "ResourceName", &b.ResourceName) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &b.ResourceType) + delete(rawMsg, key) + case "updatedAt": + err = unpopulate(val, "UpdatedAt", &b.UpdatedAt) delete(rawMsg, key) } if err != nil { @@ -1285,16 +1387,19 @@ func (b *BuildpackProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BuildpacksGroupProperties. -func (b BuildpacksGroupProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Build. +func (b Build) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "buildpacks", b.Buildpacks) + populate(objectMap, "id", b.ID) populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuildpacksGroupProperties. -func (b *BuildpacksGroupProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Build. +func (b *Build) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", b, err) @@ -1302,12 +1407,21 @@ func (b *BuildpacksGroupProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "buildpacks": - err = unpopulate(val, "Buildpacks", &b.Buildpacks) + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", b, err) @@ -1316,1335 +1430,3945 @@ func (b *BuildpacksGroupProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateProperties. -func (c CertificateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BuildCollection. +func (b BuildCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "activateDate", c.ActivateDate) - populate(objectMap, "dnsNames", c.DNSNames) - populate(objectMap, "expirationDate", c.ExpirationDate) - populate(objectMap, "issuedDate", c.IssuedDate) - populate(objectMap, "issuer", c.Issuer) - populate(objectMap, "subjectName", c.SubjectName) - populate(objectMap, "thumbprint", c.Thumbprint) - objectMap["type"] = c.Type + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateProperties. -func (c *CertificateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildCollection. +func (b *BuildCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "activateDate": - err = unpopulate(val, "ActivateDate", &c.ActivateDate) + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) delete(rawMsg, key) - case "dnsNames": - err = unpopulate(val, "DNSNames", &c.DNSNames) + case "value": + err = unpopulate(val, "Value", &b.Value) delete(rawMsg, key) - case "expirationDate": - err = unpopulate(val, "ExpirationDate", &c.ExpirationDate) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildProperties. +func (b BuildProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "agentPool", b.AgentPool) + populate(objectMap, "builder", b.Builder) + populate(objectMap, "env", b.Env) + populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "relativePath", b.RelativePath) + populate(objectMap, "resourceRequests", b.ResourceRequests) + populate(objectMap, "triggeredBuildResult", b.TriggeredBuildResult) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildProperties. +func (b *BuildProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "agentPool": + err = unpopulate(val, "AgentPool", &b.AgentPool) delete(rawMsg, key) - case "issuedDate": - err = unpopulate(val, "IssuedDate", &c.IssuedDate) + case "builder": + err = unpopulate(val, "Builder", &b.Builder) delete(rawMsg, key) - case "issuer": - err = unpopulate(val, "Issuer", &c.Issuer) + case "env": + err = unpopulate(val, "Env", &b.Env) delete(rawMsg, key) - case "subjectName": - err = unpopulate(val, "SubjectName", &c.SubjectName) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) + case "relativePath": + err = unpopulate(val, "RelativePath", &b.RelativePath) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "resourceRequests": + err = unpopulate(val, "ResourceRequests", &b.ResourceRequests) + delete(rawMsg, key) + case "triggeredBuildResult": + err = unpopulate(val, "TriggeredBuildResult", &b.TriggeredBuildResult) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateResource. -func (c CertificateResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BuildResourceRequests. +func (b BuildResourceRequests) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) + populate(objectMap, "cpu", b.CPU) + populate(objectMap, "memory", b.Memory) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateResource. -func (c *CertificateResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildResourceRequests. +func (b *BuildResourceRequests) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, 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) + case "cpu": + err = unpopulate(val, "CPU", &b.CPU) delete(rawMsg, key) - case "properties": - c.Properties, err = unmarshalCertificatePropertiesClassification(val) + case "memory": + err = unpopulate(val, "Memory", &b.Memory) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildResult. +func (b BuildResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildResult. +func (b *BuildResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildResultCollection. +func (b BuildResultCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildResultCollection. +func (b *BuildResultCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &b.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildResultLog. +func (b BuildResultLog) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobUrl", b.BlobURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildResultLog. +func (b *BuildResultLog) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobUrl": + err = unpopulate(val, "BlobURL", &b.BlobURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildResultProperties. +func (b BuildResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "buildPodName", b.BuildPodName) + populate(objectMap, "buildStages", b.BuildStages) + populate(objectMap, "error", b.Error) + populate(objectMap, "name", b.Name) + populate(objectMap, "provisioningState", b.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildResultProperties. +func (b *BuildResultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "buildPodName": + err = unpopulate(val, "BuildPodName", &b.BuildPodName) + delete(rawMsg, key) + case "buildStages": + err = unpopulate(val, "BuildStages", &b.BuildStages) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &b.Error) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildResultUserSourceInfo. +func (b BuildResultUserSourceInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "buildResultId", b.BuildResultID) + objectMap["type"] = "BuildResult" + populate(objectMap, "version", b.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildResultUserSourceInfo. +func (b *BuildResultUserSourceInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "buildResultId": + err = unpopulate(val, "BuildResultID", &b.BuildResultID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &b.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildService. +func (b BuildService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildService. +func (b *BuildService) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildServiceAgentPoolProperties. +func (b BuildServiceAgentPoolProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "poolSize", b.PoolSize) + populate(objectMap, "provisioningState", b.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServiceAgentPoolProperties. +func (b *BuildServiceAgentPoolProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "poolSize": + err = unpopulate(val, "PoolSize", &b.PoolSize) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildServiceAgentPoolResource. +func (b BuildServiceAgentPoolResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServiceAgentPoolResource. +func (b *BuildServiceAgentPoolResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildServiceAgentPoolResourceCollection. +func (b BuildServiceAgentPoolResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServiceAgentPoolResourceCollection. +func (b *BuildServiceAgentPoolResourceCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &b.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildServiceAgentPoolSizeProperties. +func (b BuildServiceAgentPoolSizeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cpu", b.CPU) + populate(objectMap, "memory", b.Memory) + populate(objectMap, "name", b.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServiceAgentPoolSizeProperties. +func (b *BuildServiceAgentPoolSizeProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cpu": + err = unpopulate(val, "CPU", &b.CPU) + delete(rawMsg, key) + case "memory": + err = unpopulate(val, "Memory", &b.Memory) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildServiceCollection. +func (b BuildServiceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServiceCollection. +func (b *BuildServiceCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &b.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildServiceProperties. +func (b BuildServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kPackVersion", b.KPackVersion) + populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "resourceRequests", b.ResourceRequests) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServiceProperties. +func (b *BuildServiceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kPackVersion": + err = unpopulate(val, "KPackVersion", &b.KPackVersion) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + delete(rawMsg, key) + case "resourceRequests": + err = unpopulate(val, "ResourceRequests", &b.ResourceRequests) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildServicePropertiesResourceRequests. +func (b BuildServicePropertiesResourceRequests) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cpu", b.CPU) + populate(objectMap, "memory", b.Memory) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildServicePropertiesResourceRequests. +func (b *BuildServicePropertiesResourceRequests) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cpu": + err = unpopulate(val, "CPU", &b.CPU) + delete(rawMsg, key) + case "memory": + err = unpopulate(val, "Memory", &b.Memory) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildStageProperties. +func (b BuildStageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exitCode", b.ExitCode) + populate(objectMap, "name", b.Name) + populate(objectMap, "reason", b.Reason) + populate(objectMap, "status", b.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildStageProperties. +func (b *BuildStageProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "exitCode": + err = unpopulate(val, "ExitCode", &b.ExitCode) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &b.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &b.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuilderProperties. +func (b BuilderProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "buildpackGroups", b.BuildpackGroups) + populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "stack", b.Stack) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuilderProperties. +func (b *BuilderProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "buildpackGroups": + err = unpopulate(val, "BuildpackGroups", &b.BuildpackGroups) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + delete(rawMsg, key) + case "stack": + err = unpopulate(val, "Stack", &b.Stack) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuilderResource. +func (b BuilderResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuilderResource. +func (b *BuilderResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuilderResourceCollection. +func (b BuilderResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuilderResourceCollection. +func (b *BuilderResourceCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &b.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildpackBindingLaunchProperties. +func (b BuildpackBindingLaunchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "secrets", b.Secrets) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildpackBindingLaunchProperties. +func (b *BuildpackBindingLaunchProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "secrets": + err = unpopulate(val, "Secrets", &b.Secrets) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildpackBindingProperties. +func (b BuildpackBindingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bindingType", b.BindingType) + populate(objectMap, "launchProperties", b.LaunchProperties) + populate(objectMap, "provisioningState", b.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildpackBindingProperties. +func (b *BuildpackBindingProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bindingType": + err = unpopulate(val, "BindingType", &b.BindingType) + delete(rawMsg, key) + case "launchProperties": + err = unpopulate(val, "LaunchProperties", &b.LaunchProperties) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildpackBindingResource. +func (b BuildpackBindingResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "systemData", b.SystemData) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildpackBindingResource. +func (b *BuildpackBindingResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &b.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildpackBindingResourceCollection. +func (b BuildpackBindingResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildpackBindingResourceCollection. +func (b *BuildpackBindingResourceCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &b.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildpackProperties. +func (b BuildpackProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildpackProperties. +func (b *BuildpackProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BuildpacksGroupProperties. +func (b BuildpacksGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "buildpacks", b.Buildpacks) + populate(objectMap, "name", b.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BuildpacksGroupProperties. +func (b *BuildpacksGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "buildpacks": + err = unpopulate(val, "Buildpacks", &b.Buildpacks) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateProperties. +func (c CertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "activateDate", c.ActivateDate) + 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"] = c.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateProperties. +func (c *CertificateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "activateDate": + err = unpopulate(val, "ActivateDate", &c.ActivateDate) + 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 CertificateResource. +func (c CertificateResource) 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 CertificateResource. +func (c *CertificateResource) UnmarshalJSON(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": + c.Properties, err = unmarshalCertificatePropertiesClassification(val) + 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 CertificateResourceCollection. +func (c CertificateResourceCollection) 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 CertificateResourceCollection. +func (c *CertificateResourceCollection) UnmarshalJSON(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 ClusterResourceProperties. +func (c ClusterResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fqdn", c.Fqdn) + populate(objectMap, "infraResourceGroup", c.InfraResourceGroup) + populate(objectMap, "managedEnvironmentId", c.ManagedEnvironmentID) + populate(objectMap, "marketplaceResource", c.MarketplaceResource) + populate(objectMap, "networkProfile", c.NetworkProfile) + populate(objectMap, "powerState", c.PowerState) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "serviceId", c.ServiceID) + populate(objectMap, "version", c.Version) + populate(objectMap, "vnetAddons", c.VnetAddons) + populate(objectMap, "zoneRedundant", c.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterResourceProperties. +func (c *ClusterResourceProperties) UnmarshalJSON(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 "fqdn": + err = unpopulate(val, "Fqdn", &c.Fqdn) + delete(rawMsg, key) + case "infraResourceGroup": + err = unpopulate(val, "InfraResourceGroup", &c.InfraResourceGroup) + delete(rawMsg, key) + case "managedEnvironmentId": + err = unpopulate(val, "ManagedEnvironmentID", &c.ManagedEnvironmentID) + delete(rawMsg, key) + case "marketplaceResource": + err = unpopulate(val, "MarketplaceResource", &c.MarketplaceResource) + delete(rawMsg, key) + case "networkProfile": + err = unpopulate(val, "NetworkProfile", &c.NetworkProfile) + delete(rawMsg, key) + case "powerState": + err = unpopulate(val, "PowerState", &c.PowerState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "serviceId": + err = unpopulate(val, "ServiceID", &c.ServiceID) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &c.Version) + delete(rawMsg, key) + case "vnetAddons": + err = unpopulate(val, "VnetAddons", &c.VnetAddons) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &c.ZoneRedundant) + 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 ConfigServerGitProperty. +func (c ConfigServerGitProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hostKey", c.HostKey) + populate(objectMap, "hostKeyAlgorithm", c.HostKeyAlgorithm) + populate(objectMap, "label", c.Label) + populate(objectMap, "password", c.Password) + populate(objectMap, "privateKey", c.PrivateKey) + populate(objectMap, "repositories", c.Repositories) + populate(objectMap, "searchPaths", c.SearchPaths) + populate(objectMap, "strictHostKeyChecking", c.StrictHostKeyChecking) + populate(objectMap, "uri", c.URI) + populate(objectMap, "username", c.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigServerGitProperty. +func (c *ConfigServerGitProperty) UnmarshalJSON(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 "hostKey": + err = unpopulate(val, "HostKey", &c.HostKey) + delete(rawMsg, key) + case "hostKeyAlgorithm": + err = unpopulate(val, "HostKeyAlgorithm", &c.HostKeyAlgorithm) + delete(rawMsg, key) + case "label": + err = unpopulate(val, "Label", &c.Label) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &c.Password) + delete(rawMsg, key) + case "privateKey": + err = unpopulate(val, "PrivateKey", &c.PrivateKey) + delete(rawMsg, key) + case "repositories": + err = unpopulate(val, "Repositories", &c.Repositories) + delete(rawMsg, key) + case "searchPaths": + err = unpopulate(val, "SearchPaths", &c.SearchPaths) + delete(rawMsg, key) + case "strictHostKeyChecking": + err = unpopulate(val, "StrictHostKeyChecking", &c.StrictHostKeyChecking) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &c.URI) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &c.Username) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigServerProperties. +func (c ConfigServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configServer", c.ConfigServer) + populate(objectMap, "error", c.Error) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigServerProperties. +func (c *ConfigServerProperties) UnmarshalJSON(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 "configServer": + err = unpopulate(val, "ConfigServer", &c.ConfigServer) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &c.Error) + 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 ConfigServerResource. +func (c ConfigServerResource) 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 ConfigServerResource. +func (c *ConfigServerResource) UnmarshalJSON(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 ConfigServerSettings. +func (c ConfigServerSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gitProperty", c.GitProperty) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigServerSettings. +func (c *ConfigServerSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "gitProperty": + err = unpopulate(val, "GitProperty", &c.GitProperty) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigServerSettingsErrorRecord. +func (c ConfigServerSettingsErrorRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "messages", c.Messages) + populate(objectMap, "name", c.Name) + populate(objectMap, "uri", c.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigServerSettingsErrorRecord. +func (c *ConfigServerSettingsErrorRecord) UnmarshalJSON(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 "messages": + err = unpopulate(val, "Messages", &c.Messages) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &c.URI) + 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 ConfigServerSettingsValidateResult. +func (c ConfigServerSettingsValidateResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "details", c.Details) + populate(objectMap, "isValid", c.IsValid) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigServerSettingsValidateResult. +func (c *ConfigServerSettingsValidateResult) UnmarshalJSON(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 "details": + err = unpopulate(val, "Details", &c.Details) + delete(rawMsg, key) + case "isValid": + err = unpopulate(val, "IsValid", &c.IsValid) + 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 ConfigurationServiceGitProperty. +func (c ConfigurationServiceGitProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "repositories", c.Repositories) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceGitProperty. +func (c *ConfigurationServiceGitProperty) UnmarshalJSON(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 "repositories": + err = unpopulate(val, "Repositories", &c.Repositories) + 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 ConfigurationServiceGitPropertyValidateResult. +func (c ConfigurationServiceGitPropertyValidateResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gitReposValidationResult", c.GitReposValidationResult) + populate(objectMap, "isValid", c.IsValid) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceGitPropertyValidateResult. +func (c *ConfigurationServiceGitPropertyValidateResult) UnmarshalJSON(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 "gitReposValidationResult": + err = unpopulate(val, "GitReposValidationResult", &c.GitReposValidationResult) + delete(rawMsg, key) + case "isValid": + err = unpopulate(val, "IsValid", &c.IsValid) + 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 ConfigurationServiceGitRepository. +func (c ConfigurationServiceGitRepository) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hostKey", c.HostKey) + populate(objectMap, "hostKeyAlgorithm", c.HostKeyAlgorithm) + populate(objectMap, "label", c.Label) + populate(objectMap, "name", c.Name) + populate(objectMap, "password", c.Password) + populate(objectMap, "patterns", c.Patterns) + populate(objectMap, "privateKey", c.PrivateKey) + populate(objectMap, "searchPaths", c.SearchPaths) + populate(objectMap, "strictHostKeyChecking", c.StrictHostKeyChecking) + populate(objectMap, "uri", c.URI) + populate(objectMap, "username", c.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceGitRepository. +func (c *ConfigurationServiceGitRepository) UnmarshalJSON(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 "hostKey": + err = unpopulate(val, "HostKey", &c.HostKey) + delete(rawMsg, key) + case "hostKeyAlgorithm": + err = unpopulate(val, "HostKeyAlgorithm", &c.HostKeyAlgorithm) + delete(rawMsg, key) + case "label": + err = unpopulate(val, "Label", &c.Label) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &c.Password) + delete(rawMsg, key) + case "patterns": + err = unpopulate(val, "Patterns", &c.Patterns) + delete(rawMsg, key) + case "privateKey": + err = unpopulate(val, "PrivateKey", &c.PrivateKey) + delete(rawMsg, key) + case "searchPaths": + err = unpopulate(val, "SearchPaths", &c.SearchPaths) + delete(rawMsg, key) + case "strictHostKeyChecking": + err = unpopulate(val, "StrictHostKeyChecking", &c.StrictHostKeyChecking) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &c.URI) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &c.Username) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceInstance. +func (c ConfigurationServiceInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", c.Name) + populate(objectMap, "status", c.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceInstance. +func (c *ConfigurationServiceInstance) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + 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 ConfigurationServiceProperties. +func (c ConfigurationServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "instances", c.Instances) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "resourceRequests", c.ResourceRequests) + populate(objectMap, "settings", c.Settings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceProperties. +func (c *ConfigurationServiceProperties) UnmarshalJSON(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 "instances": + err = unpopulate(val, "Instances", &c.Instances) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "resourceRequests": + err = unpopulate(val, "ResourceRequests", &c.ResourceRequests) + delete(rawMsg, key) + case "settings": + err = unpopulate(val, "Settings", &c.Settings) + 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 ConfigurationServiceResource. +func (c ConfigurationServiceResource) 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 ConfigurationServiceResource. +func (c *ConfigurationServiceResource) UnmarshalJSON(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 ConfigurationServiceResourceCollection. +func (c ConfigurationServiceResourceCollection) 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 ConfigurationServiceResourceCollection. +func (c *ConfigurationServiceResourceCollection) UnmarshalJSON(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 ConfigurationServiceResourceRequests. +func (c ConfigurationServiceResourceRequests) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cpu", c.CPU) + populate(objectMap, "instanceCount", c.InstanceCount) + populate(objectMap, "memory", c.Memory) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceResourceRequests. +func (c *ConfigurationServiceResourceRequests) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cpu": + err = unpopulate(val, "CPU", &c.CPU) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &c.InstanceCount) + delete(rawMsg, key) + case "memory": + err = unpopulate(val, "Memory", &c.Memory) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceSettings. +func (c ConfigurationServiceSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gitProperty", c.GitProperty) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceSettings. +func (c *ConfigurationServiceSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "gitProperty": + err = unpopulate(val, "GitProperty", &c.GitProperty) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceSettingsValidateResult. +func (c ConfigurationServiceSettingsValidateResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "gitPropertyValidationResult", c.GitPropertyValidationResult) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceSettingsValidateResult. +func (c *ConfigurationServiceSettingsValidateResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "gitPropertyValidationResult": + err = unpopulate(val, "GitPropertyValidationResult", &c.GitPropertyValidationResult) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContainerProbeSettings. +func (c ContainerProbeSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "disableProbe", c.DisableProbe) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerProbeSettings. +func (c *ContainerProbeSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "disableProbe": + err = unpopulate(val, "DisableProbe", &c.DisableProbe) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type 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": + err = unpopulate(val, "Server", &c.Server) + 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 CustomContainerUserSourceInfo. +func (c CustomContainerUserSourceInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customContainer", c.CustomContainer) + objectMap["type"] = "Container" + populate(objectMap, "version", c.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomContainerUserSourceInfo. +func (c *CustomContainerUserSourceInfo) UnmarshalJSON(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 "customContainer": + err = unpopulate(val, "CustomContainer", &c.CustomContainer) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &c.Version) + 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 CustomDomainProperties. +func (c CustomDomainProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appName", c.AppName) + populate(objectMap, "certName", c.CertName) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "thumbprint", c.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainProperties. +func (c *CustomDomainProperties) UnmarshalJSON(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 "appName": + err = unpopulate(val, "AppName", &c.AppName) + delete(rawMsg, key) + case "certName": + err = unpopulate(val, "CertName", &c.CertName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomDomainResource. +func (c CustomDomainResource) 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 CustomDomainResource. +func (c *CustomDomainResource) UnmarshalJSON(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 CustomDomainResourceCollection. +func (c CustomDomainResourceCollection) 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 CustomDomainResourceCollection. +func (c *CustomDomainResourceCollection) UnmarshalJSON(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 CustomDomainValidatePayload. +func (c CustomDomainValidatePayload) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", c.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainValidatePayload. +func (c *CustomDomainValidatePayload) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomDomainValidateResult. +func (c CustomDomainValidateResult) 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 CustomDomainValidateResult. +func (c *CustomDomainValidateResult) UnmarshalJSON(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 CustomPersistentDiskProperties. +func (c CustomPersistentDiskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enableSubPath", c.EnableSubPath) + populate(objectMap, "mountOptions", c.MountOptions) + populate(objectMap, "mountPath", c.MountPath) + populate(objectMap, "readOnly", c.ReadOnly) + objectMap["type"] = c.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomPersistentDiskProperties. +func (c *CustomPersistentDiskProperties) UnmarshalJSON(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 "enableSubPath": + err = unpopulate(val, "EnableSubPath", &c.EnableSubPath) + delete(rawMsg, key) + case "mountOptions": + err = unpopulate(val, "MountOptions", &c.MountOptions) + delete(rawMsg, key) + case "mountPath": + err = unpopulate(val, "MountPath", &c.MountPath) + delete(rawMsg, key) + case "readOnly": + err = unpopulate(val, "ReadOnly", &c.ReadOnly) + 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 CustomPersistentDiskResource. +func (c CustomPersistentDiskResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "customPersistentDiskProperties", c.CustomPersistentDiskProperties) + populate(objectMap, "storageId", c.StorageID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomPersistentDiskResource. +func (c *CustomPersistentDiskResource) UnmarshalJSON(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 "customPersistentDiskProperties": + c.CustomPersistentDiskProperties, err = unmarshalCustomPersistentDiskPropertiesClassification(val) + delete(rawMsg, key) + case "storageId": + err = unpopulate(val, "StorageID", &c.StorageID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomScaleRule. +func (c CustomScaleRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "auth", c.Auth) + populate(objectMap, "metadata", c.Metadata) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomScaleRule. +func (c *CustomScaleRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "auth": + err = unpopulate(val, "Auth", &c.Auth) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &c.Metadata) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomizedAcceleratorProperties. +func (c CustomizedAcceleratorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "acceleratorTags", c.AcceleratorTags) + populate(objectMap, "description", c.Description) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "gitRepository", c.GitRepository) + populate(objectMap, "iconUrl", c.IconURL) + populate(objectMap, "provisioningState", c.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomizedAcceleratorProperties. +func (c *CustomizedAcceleratorProperties) UnmarshalJSON(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 "acceleratorTags": + err = unpopulate(val, "AcceleratorTags", &c.AcceleratorTags) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "gitRepository": + err = unpopulate(val, "GitRepository", &c.GitRepository) + delete(rawMsg, key) + case "iconUrl": + err = unpopulate(val, "IconURL", &c.IconURL) + 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 CustomizedAcceleratorResource. +func (c CustomizedAcceleratorResource) 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, "sku", c.SKU) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomizedAcceleratorResource. +func (c *CustomizedAcceleratorResource) UnmarshalJSON(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 "sku": + err = unpopulate(val, "SKU", &c.SKU) + 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 CustomizedAcceleratorResourceCollection. +func (c CustomizedAcceleratorResourceCollection) 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 CustomizedAcceleratorResourceCollection. +func (c *CustomizedAcceleratorResourceCollection) UnmarshalJSON(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 CustomizedAcceleratorValidateResult. +func (c CustomizedAcceleratorValidateResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorMessage", c.ErrorMessage) + populate(objectMap, "state", c.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomizedAcceleratorValidateResult. +func (c *CustomizedAcceleratorValidateResult) UnmarshalJSON(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 "errorMessage": + err = unpopulate(val, "ErrorMessage", &c.ErrorMessage) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + 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 DeploymentInstance. +func (d DeploymentInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "discoveryStatus", d.DiscoveryStatus) + populate(objectMap, "name", d.Name) + populate(objectMap, "reason", d.Reason) + populate(objectMap, "startTime", d.StartTime) + populate(objectMap, "status", d.Status) + populate(objectMap, "zone", d.Zone) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentInstance. +func (d *DeploymentInstance) UnmarshalJSON(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 "discoveryStatus": + err = unpopulate(val, "DiscoveryStatus", &d.DiscoveryStatus) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &d.Reason) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &d.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + case "zone": + err = unpopulate(val, "Zone", &d.Zone) + 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 DeploymentList. +func (d DeploymentList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deployments", d.Deployments) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentList. +func (d *DeploymentList) UnmarshalJSON(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 "deployments": + err = unpopulate(val, "Deployments", &d.Deployments) + 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 DeploymentResource. +func (d DeploymentResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentResource. +func (d *DeploymentResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeploymentResourceCollection. +func (d DeploymentResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentResourceCollection. +func (d *DeploymentResourceCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeploymentResourceProperties. +func (d DeploymentResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "active", d.Active) + populate(objectMap, "deploymentSettings", d.DeploymentSettings) + populate(objectMap, "instances", d.Instances) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "source", d.Source) + populate(objectMap, "status", d.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentResourceProperties. +func (d *DeploymentResourceProperties) UnmarshalJSON(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 "active": + err = unpopulate(val, "Active", &d.Active) + delete(rawMsg, key) + case "deploymentSettings": + err = unpopulate(val, "DeploymentSettings", &d.DeploymentSettings) + 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 "source": + d.Source, err = unmarshalUserSourceInfoClassification(val) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeploymentSettings. +func (d DeploymentSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "addonConfigs", d.AddonConfigs) + populate(objectMap, "containerProbeSettings", d.ContainerProbeSettings) + populate(objectMap, "environmentVariables", d.EnvironmentVariables) + populate(objectMap, "livenessProbe", d.LivenessProbe) + populate(objectMap, "readinessProbe", d.ReadinessProbe) + populate(objectMap, "resourceRequests", d.ResourceRequests) + populate(objectMap, "scale", d.Scale) + populate(objectMap, "startupProbe", d.StartupProbe) + populate(objectMap, "terminationGracePeriodSeconds", d.TerminationGracePeriodSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentSettings. +func (d *DeploymentSettings) UnmarshalJSON(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 "addonConfigs": + err = unpopulate(val, "AddonConfigs", &d.AddonConfigs) + delete(rawMsg, key) + case "containerProbeSettings": + err = unpopulate(val, "ContainerProbeSettings", &d.ContainerProbeSettings) + delete(rawMsg, key) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &d.EnvironmentVariables) + delete(rawMsg, key) + case "livenessProbe": + err = unpopulate(val, "LivenessProbe", &d.LivenessProbe) + delete(rawMsg, key) + case "readinessProbe": + err = unpopulate(val, "ReadinessProbe", &d.ReadinessProbe) + delete(rawMsg, key) + case "resourceRequests": + err = unpopulate(val, "ResourceRequests", &d.ResourceRequests) + delete(rawMsg, key) + case "scale": + err = unpopulate(val, "Scale", &d.Scale) + delete(rawMsg, key) + case "startupProbe": + err = unpopulate(val, "StartupProbe", &d.StartupProbe) + delete(rawMsg, key) + case "terminationGracePeriodSeconds": + err = unpopulate(val, "TerminationGracePeriodSeconds", &d.TerminationGracePeriodSeconds) + 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) + populate(objectMap, "route", d.Route) + populate(objectMap, "state", d.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DevToolPortalFeatureDetail. +func (d *DevToolPortalFeatureDetail) UnmarshalJSON(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 "route": + err = unpopulate(val, "Route", &d.Route) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &d.State) + 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 DevToolPortalFeatureSettings. +func (d DevToolPortalFeatureSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationAccelerator", d.ApplicationAccelerator) + populate(objectMap, "applicationLiveView", d.ApplicationLiveView) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DevToolPortalFeatureSettings. +func (d *DevToolPortalFeatureSettings) UnmarshalJSON(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 "applicationAccelerator": + err = unpopulate(val, "ApplicationAccelerator", &d.ApplicationAccelerator) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "applicationLiveView": + err = unpopulate(val, "ApplicationLiveView", &d.ApplicationLiveView) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CertificateResourceCollection. -func (c CertificateResourceCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DevToolPortalInstance. +func (d DevToolPortalInstance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "name", d.Name) + populate(objectMap, "status", d.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateResourceCollection. -func (c *CertificateResourceCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DevToolPortalInstance. +func (d *DevToolPortalInstance) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "status": + err = unpopulate(val, "Status", &d.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterResourceProperties. -func (c ClusterResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DevToolPortalProperties. +func (d DevToolPortalProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "fqdn", c.Fqdn) - populate(objectMap, "networkProfile", c.NetworkProfile) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "serviceId", c.ServiceID) - populate(objectMap, "version", c.Version) - populate(objectMap, "zoneRedundant", c.ZoneRedundant) + 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) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterResourceProperties. -func (c *ClusterResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DevToolPortalProperties. +func (d *DevToolPortalProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "fqdn": - err = unpopulate(val, "Fqdn", &c.Fqdn) + case "features": + err = unpopulate(val, "Features", &d.Features) delete(rawMsg, key) - case "networkProfile": - err = unpopulate(val, "NetworkProfile", &c.NetworkProfile) + case "instances": + err = unpopulate(val, "Instances", &d.Instances) delete(rawMsg, key) case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) delete(rawMsg, key) - case "serviceId": - err = unpopulate(val, "ServiceID", &c.ServiceID) + case "public": + err = unpopulate(val, "Public", &d.Public) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &c.Version) + case "resourceRequests": + err = unpopulate(val, "ResourceRequests", &d.ResourceRequests) delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &c.ZoneRedundant) + case "ssoProperties": + err = unpopulate(val, "SsoProperties", &d.SsoProperties) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &d.URL) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigServerGitProperty. -func (c ConfigServerGitProperty) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DevToolPortalResource. +func (d DevToolPortalResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "hostKey", c.HostKey) - populate(objectMap, "hostKeyAlgorithm", c.HostKeyAlgorithm) - populate(objectMap, "label", c.Label) - populate(objectMap, "password", c.Password) - populate(objectMap, "privateKey", c.PrivateKey) - populate(objectMap, "repositories", c.Repositories) - populate(objectMap, "searchPaths", c.SearchPaths) - populate(objectMap, "strictHostKeyChecking", c.StrictHostKeyChecking) - populate(objectMap, "uri", c.URI) - populate(objectMap, "username", c.Username) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigServerGitProperty. -func (c *ConfigServerGitProperty) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DevToolPortalResource. +func (d *DevToolPortalResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "hostKey": - err = unpopulate(val, "HostKey", &c.HostKey) - delete(rawMsg, key) - case "hostKeyAlgorithm": - err = unpopulate(val, "HostKeyAlgorithm", &c.HostKeyAlgorithm) - delete(rawMsg, key) - case "label": - err = unpopulate(val, "Label", &c.Label) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &c.Password) - delete(rawMsg, key) - case "privateKey": - err = unpopulate(val, "PrivateKey", &c.PrivateKey) - delete(rawMsg, key) - case "repositories": - err = unpopulate(val, "Repositories", &c.Repositories) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "searchPaths": - err = unpopulate(val, "SearchPaths", &c.SearchPaths) + case "name": + err = unpopulate(val, "Name", &d.Name) delete(rawMsg, key) - case "strictHostKeyChecking": - err = unpopulate(val, "StrictHostKeyChecking", &c.StrictHostKeyChecking) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &c.URI) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &c.Username) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigServerProperties. -func (c ConfigServerProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DevToolPortalResourceCollection. +func (d DevToolPortalResourceCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "configServer", c.ConfigServer) - populate(objectMap, "error", c.Error) - populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigServerProperties. -func (c *ConfigServerProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DevToolPortalResourceCollection. +func (d *DevToolPortalResourceCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "configServer": - err = unpopulate(val, "ConfigServer", &c.ConfigServer) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &c.Error) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigServerResource. -func (c ConfigServerResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DevToolPortalResourceRequests. +func (d DevToolPortalResourceRequests) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) + populate(objectMap, "cpu", d.CPU) + populate(objectMap, "instanceCount", d.InstanceCount) + populate(objectMap, "memory", d.Memory) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigServerResource. -func (c *ConfigServerResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DevToolPortalResourceRequests. +func (d *DevToolPortalResourceRequests) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "cpu": + err = unpopulate(val, "CPU", &d.CPU) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &d.InstanceCount) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "memory": + err = unpopulate(val, "Memory", &d.Memory) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigServerSettings. -func (c ConfigServerSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DevToolPortalSsoProperties. +func (d DevToolPortalSsoProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "gitProperty", c.GitProperty) + populate(objectMap, "clientId", d.ClientID) + populate(objectMap, "clientSecret", d.ClientSecret) + populate(objectMap, "metadataUrl", d.MetadataURL) + populate(objectMap, "scopes", d.Scopes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigServerSettings. -func (c *ConfigServerSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DevToolPortalSsoProperties. +func (d *DevToolPortalSsoProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "gitProperty": - err = unpopulate(val, "GitProperty", &c.GitProperty) + case "clientId": + err = unpopulate(val, "ClientID", &d.ClientID) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &d.ClientSecret) + delete(rawMsg, key) + case "metadataUrl": + err = unpopulate(val, "MetadataURL", &d.MetadataURL) + delete(rawMsg, key) + case "scopes": + err = unpopulate(val, "Scopes", &d.Scopes) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigServerSettingsErrorRecord. -func (c ConfigServerSettingsErrorRecord) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DiagnosticParameters. +func (d DiagnosticParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "messages", c.Messages) - populate(objectMap, "name", c.Name) - populate(objectMap, "uri", c.URI) + populate(objectMap, "appInstance", d.AppInstance) + populate(objectMap, "duration", d.Duration) + populate(objectMap, "filePath", d.FilePath) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigServerSettingsErrorRecord. -func (c *ConfigServerSettingsErrorRecord) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticParameters. +func (d *DiagnosticParameters) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "messages": - err = unpopulate(val, "Messages", &c.Messages) + case "appInstance": + err = unpopulate(val, "AppInstance", &d.AppInstance) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "duration": + err = unpopulate(val, "Duration", &d.Duration) delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &c.URI) + case "filePath": + err = unpopulate(val, "FilePath", &d.FilePath) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigServerSettingsValidateResult. -func (c ConfigServerSettingsValidateResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Error. +func (e Error) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "details", c.Details) - populate(objectMap, "isValid", c.IsValid) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigServerSettingsValidateResult. -func (c *ConfigServerSettingsValidateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Error. +func (e *Error) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "details": - err = unpopulate(val, "Details", &c.Details) + case "code": + err = unpopulate(val, "Code", &e.Code) delete(rawMsg, key) - case "isValid": - err = unpopulate(val, "IsValid", &c.IsValid) + case "message": + err = unpopulate(val, "Message", &e.Message) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceGitProperty. -func (c ConfigurationServiceGitProperty) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExecAction. +func (e ExecAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "repositories", c.Repositories) + populate(objectMap, "command", e.Command) + objectMap["type"] = ProbeActionTypeExecAction return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceGitProperty. -func (c *ConfigurationServiceGitProperty) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ExecAction. +func (e *ExecAction) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } for key, val := range rawMsg { var err error switch key { - case "repositories": - err = unpopulate(val, "Repositories", &c.Repositories) + case "command": + err = unpopulate(val, "Command", &e.Command) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", e, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceGitPropertyValidateResult. -func (c ConfigurationServiceGitPropertyValidateResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayAPIMetadataProperties. +func (g GatewayAPIMetadataProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "gitReposValidationResult", c.GitReposValidationResult) - populate(objectMap, "isValid", c.IsValid) + populate(objectMap, "description", g.Description) + populate(objectMap, "documentation", g.Documentation) + populate(objectMap, "serverUrl", g.ServerURL) + populate(objectMap, "title", g.Title) + populate(objectMap, "version", g.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceGitPropertyValidateResult. -func (c *ConfigurationServiceGitPropertyValidateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayAPIMetadataProperties. +func (g *GatewayAPIMetadataProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "gitReposValidationResult": - err = unpopulate(val, "GitReposValidationResult", &c.GitReposValidationResult) + case "description": + err = unpopulate(val, "Description", &g.Description) delete(rawMsg, key) - case "isValid": - err = unpopulate(val, "IsValid", &c.IsValid) + case "documentation": + err = unpopulate(val, "Documentation", &g.Documentation) + delete(rawMsg, key) + case "serverUrl": + err = unpopulate(val, "ServerURL", &g.ServerURL) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &g.Title) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &g.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceGitRepository. -func (c ConfigurationServiceGitRepository) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayAPIRoute. +func (g GatewayAPIRoute) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "hostKey", c.HostKey) - populate(objectMap, "hostKeyAlgorithm", c.HostKeyAlgorithm) - populate(objectMap, "label", c.Label) - populate(objectMap, "name", c.Name) - populate(objectMap, "password", c.Password) - populate(objectMap, "patterns", c.Patterns) - populate(objectMap, "privateKey", c.PrivateKey) - populate(objectMap, "searchPaths", c.SearchPaths) - populate(objectMap, "strictHostKeyChecking", c.StrictHostKeyChecking) - populate(objectMap, "uri", c.URI) - populate(objectMap, "username", c.Username) + populate(objectMap, "description", g.Description) + populate(objectMap, "filters", g.Filters) + populate(objectMap, "order", g.Order) + populate(objectMap, "predicates", g.Predicates) + populate(objectMap, "ssoEnabled", g.SsoEnabled) + populate(objectMap, "tags", g.Tags) + populate(objectMap, "title", g.Title) + populate(objectMap, "tokenRelay", g.TokenRelay) + populate(objectMap, "uri", g.URI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceGitRepository. -func (c *ConfigurationServiceGitRepository) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayAPIRoute. +func (g *GatewayAPIRoute) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "hostKey": - err = unpopulate(val, "HostKey", &c.HostKey) - delete(rawMsg, key) - case "hostKeyAlgorithm": - err = unpopulate(val, "HostKeyAlgorithm", &c.HostKeyAlgorithm) + case "description": + err = unpopulate(val, "Description", &g.Description) delete(rawMsg, key) - case "label": - err = unpopulate(val, "Label", &c.Label) + case "filters": + err = unpopulate(val, "Filters", &g.Filters) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "order": + err = unpopulate(val, "Order", &g.Order) delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &c.Password) + case "predicates": + err = unpopulate(val, "Predicates", &g.Predicates) delete(rawMsg, key) - case "patterns": - err = unpopulate(val, "Patterns", &c.Patterns) + case "ssoEnabled": + err = unpopulate(val, "SsoEnabled", &g.SsoEnabled) delete(rawMsg, key) - case "privateKey": - err = unpopulate(val, "PrivateKey", &c.PrivateKey) + case "tags": + err = unpopulate(val, "Tags", &g.Tags) delete(rawMsg, key) - case "searchPaths": - err = unpopulate(val, "SearchPaths", &c.SearchPaths) + case "title": + err = unpopulate(val, "Title", &g.Title) delete(rawMsg, key) - case "strictHostKeyChecking": - err = unpopulate(val, "StrictHostKeyChecking", &c.StrictHostKeyChecking) + case "tokenRelay": + err = unpopulate(val, "TokenRelay", &g.TokenRelay) delete(rawMsg, key) case "uri": - err = unpopulate(val, "URI", &c.URI) - delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &c.Username) + err = unpopulate(val, "URI", &g.URI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceInstance. -func (c ConfigurationServiceInstance) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayCorsProperties. +func (g GatewayCorsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) - populate(objectMap, "status", c.Status) + populate(objectMap, "allowCredentials", g.AllowCredentials) + populate(objectMap, "allowedHeaders", g.AllowedHeaders) + populate(objectMap, "allowedMethods", g.AllowedMethods) + populate(objectMap, "allowedOrigins", g.AllowedOrigins) + populate(objectMap, "exposedHeaders", g.ExposedHeaders) + populate(objectMap, "maxAge", g.MaxAge) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceInstance. -func (c *ConfigurationServiceInstance) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCorsProperties. +func (g *GatewayCorsProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) + case "allowCredentials": + err = unpopulate(val, "AllowCredentials", &g.AllowCredentials) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) + case "allowedHeaders": + err = unpopulate(val, "AllowedHeaders", &g.AllowedHeaders) + delete(rawMsg, key) + case "allowedMethods": + err = unpopulate(val, "AllowedMethods", &g.AllowedMethods) + delete(rawMsg, key) + case "allowedOrigins": + err = unpopulate(val, "AllowedOrigins", &g.AllowedOrigins) + delete(rawMsg, key) + case "exposedHeaders": + err = unpopulate(val, "ExposedHeaders", &g.ExposedHeaders) + delete(rawMsg, key) + case "maxAge": + err = unpopulate(val, "MaxAge", &g.MaxAge) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceProperties. -func (c ConfigurationServiceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayCustomDomainProperties. +func (g GatewayCustomDomainProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "instances", c.Instances) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "resourceRequests", c.ResourceRequests) - populate(objectMap, "settings", c.Settings) + populate(objectMap, "thumbprint", g.Thumbprint) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceProperties. -func (c *ConfigurationServiceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCustomDomainProperties. +func (g *GatewayCustomDomainProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "instances": - err = unpopulate(val, "Instances", &c.Instances) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "resourceRequests": - err = unpopulate(val, "ResourceRequests", &c.ResourceRequests) - delete(rawMsg, key) - case "settings": - err = unpopulate(val, "Settings", &c.Settings) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &g.Thumbprint) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceResource. -func (c ConfigurationServiceResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayCustomDomainResource. +func (g GatewayCustomDomainResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceResource. -func (c *ConfigurationServiceResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCustomDomainResource. +func (g *GatewayCustomDomainResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &c.ID) + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &c.Name) + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &c.Properties) + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + err = unpopulate(val, "SystemData", &g.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &c.Type) + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceResourceCollection. -func (c ConfigurationServiceResourceCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayCustomDomainResourceCollection. +func (g GatewayCustomDomainResourceCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceResourceCollection. -func (c *ConfigurationServiceResourceCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCustomDomainResourceCollection. +func (g *GatewayCustomDomainResourceCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + err = unpopulate(val, "NextLink", &g.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &c.Value) + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceResourceRequests. -func (c ConfigurationServiceResourceRequests) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayInstance. +func (g GatewayInstance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cpu", c.CPU) - populate(objectMap, "instanceCount", c.InstanceCount) - populate(objectMap, "memory", c.Memory) + populate(objectMap, "name", g.Name) + populate(objectMap, "status", g.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceResourceRequests. -func (c *ConfigurationServiceResourceRequests) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayInstance. +func (g *GatewayInstance) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "cpu": - err = unpopulate(val, "CPU", &c.CPU) - delete(rawMsg, key) - case "instanceCount": - err = unpopulate(val, "InstanceCount", &c.InstanceCount) + case "name": + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "memory": - err = unpopulate(val, "Memory", &c.Memory) + case "status": + err = unpopulate(val, "Status", &g.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceSettings. -func (c ConfigurationServiceSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayOperatorProperties. +func (g GatewayOperatorProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "gitProperty", c.GitProperty) + populate(objectMap, "instances", g.Instances) + populate(objectMap, "resourceRequests", g.ResourceRequests) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceSettings. -func (c *ConfigurationServiceSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayOperatorProperties. +func (g *GatewayOperatorProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "gitProperty": - err = unpopulate(val, "GitProperty", &c.GitProperty) + case "instances": + err = unpopulate(val, "Instances", &g.Instances) + delete(rawMsg, key) + case "resourceRequests": + err = unpopulate(val, "ResourceRequests", &g.ResourceRequests) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConfigurationServiceSettingsValidateResult. -func (c ConfigurationServiceSettingsValidateResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayOperatorResourceRequests. +func (g GatewayOperatorResourceRequests) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "gitPropertyValidationResult", c.GitPropertyValidationResult) + populate(objectMap, "cpu", g.CPU) + populate(objectMap, "instanceCount", g.InstanceCount) + populate(objectMap, "memory", g.Memory) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfigurationServiceSettingsValidateResult. -func (c *ConfigurationServiceSettingsValidateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayOperatorResourceRequests. +func (g *GatewayOperatorResourceRequests) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "gitPropertyValidationResult": - err = unpopulate(val, "GitPropertyValidationResult", &c.GitPropertyValidationResult) + case "cpu": + err = unpopulate(val, "CPU", &g.CPU) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &g.InstanceCount) + delete(rawMsg, key) + case "memory": + err = unpopulate(val, "Memory", &g.Memory) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } 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 GatewayProperties. +func (g GatewayProperties) 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, "subjectName", c.SubjectName) - populate(objectMap, "thumbprint", c.Thumbprint) - objectMap["type"] = "ContentCertificate" + populate(objectMap, "apiMetadataProperties", g.APIMetadataProperties) + populate(objectMap, "apmTypes", g.ApmTypes) + populate(objectMap, "corsProperties", g.CorsProperties) + populate(objectMap, "environmentVariables", g.EnvironmentVariables) + populate(objectMap, "httpsOnly", g.HTTPSOnly) + populate(objectMap, "instances", g.Instances) + populate(objectMap, "operatorProperties", g.OperatorProperties) + populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "public", g.Public) + populate(objectMap, "resourceRequests", g.ResourceRequests) + populate(objectMap, "ssoProperties", g.SsoProperties) + populate(objectMap, "url", g.URL) 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 GatewayProperties. +func (g *GatewayProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "activateDate": - err = unpopulate(val, "ActivateDate", &c.ActivateDate) + case "apiMetadataProperties": + err = unpopulate(val, "APIMetadataProperties", &g.APIMetadataProperties) delete(rawMsg, key) - case "content": - err = unpopulate(val, "Content", &c.Content) + case "apmTypes": + err = unpopulate(val, "ApmTypes", &g.ApmTypes) delete(rawMsg, key) - case "dnsNames": - err = unpopulate(val, "DNSNames", &c.DNSNames) + case "corsProperties": + err = unpopulate(val, "CorsProperties", &g.CorsProperties) delete(rawMsg, key) - case "expirationDate": - err = unpopulate(val, "ExpirationDate", &c.ExpirationDate) + case "environmentVariables": + err = unpopulate(val, "EnvironmentVariables", &g.EnvironmentVariables) delete(rawMsg, key) - case "issuedDate": - err = unpopulate(val, "IssuedDate", &c.IssuedDate) + case "httpsOnly": + err = unpopulate(val, "HTTPSOnly", &g.HTTPSOnly) delete(rawMsg, key) - case "issuer": - err = unpopulate(val, "Issuer", &c.Issuer) + case "instances": + err = unpopulate(val, "Instances", &g.Instances) delete(rawMsg, key) - case "subjectName": - err = unpopulate(val, "SubjectName", &c.SubjectName) + case "operatorProperties": + err = unpopulate(val, "OperatorProperties", &g.OperatorProperties) delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "public": + err = unpopulate(val, "Public", &g.Public) + delete(rawMsg, key) + case "resourceRequests": + err = unpopulate(val, "ResourceRequests", &g.ResourceRequests) + delete(rawMsg, key) + case "ssoProperties": + err = unpopulate(val, "SsoProperties", &g.SsoProperties) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &g.URL) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomDomainProperties. -func (c CustomDomainProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayPropertiesEnvironmentVariables. +func (g GatewayPropertiesEnvironmentVariables) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "appName", c.AppName) - populate(objectMap, "certName", c.CertName) - populate(objectMap, "thumbprint", c.Thumbprint) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "secrets", g.Secrets) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainProperties. -func (c *CustomDomainProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayPropertiesEnvironmentVariables. +func (g *GatewayPropertiesEnvironmentVariables) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "appName": - err = unpopulate(val, "AppName", &c.AppName) - delete(rawMsg, key) - case "certName": - err = unpopulate(val, "CertName", &c.CertName) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) + case "secrets": + err = unpopulate(val, "Secrets", &g.Secrets) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomDomainResource. -func (c CustomDomainResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayResource. +func (g GatewayResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "sku", g.SKU) + populate(objectMap, "systemData", g.SystemData) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainResource. -func (c *CustomDomainResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResource. +func (g *GatewayResource) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &c.ID) + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &c.Name) + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &c.Properties) + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &g.SKU) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + err = unpopulate(val, "SystemData", &g.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &c.Type) + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomDomainResourceCollection. -func (c CustomDomainResourceCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayResourceCollection. +func (g GatewayResourceCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainResourceCollection. -func (c *CustomDomainResourceCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResourceCollection. +func (g *GatewayResourceCollection) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + err = unpopulate(val, "NextLink", &g.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &c.Value) + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomDomainValidatePayload. -func (c CustomDomainValidatePayload) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayResourceRequests. +func (g GatewayResourceRequests) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "name", c.Name) + populate(objectMap, "cpu", g.CPU) + populate(objectMap, "memory", g.Memory) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainValidatePayload. -func (c *CustomDomainValidatePayload) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayResourceRequests. +func (g *GatewayResourceRequests) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "name": - err = unpopulate(val, "Name", &c.Name) + case "cpu": + err = unpopulate(val, "CPU", &g.CPU) + delete(rawMsg, key) + case "memory": + err = unpopulate(val, "Memory", &g.Memory) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomDomainValidateResult. -func (c CustomDomainValidateResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayRouteConfigOpenAPIProperties. +func (g GatewayRouteConfigOpenAPIProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "isValid", c.IsValid) - populate(objectMap, "message", c.Message) + populate(objectMap, "uri", g.URI) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomDomainValidateResult. -func (c *CustomDomainValidateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayRouteConfigOpenAPIProperties. +func (g *GatewayRouteConfigOpenAPIProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, 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) + case "uri": + err = unpopulate(val, "URI", &g.URI) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeploymentInstance. -func (d DeploymentInstance) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayRouteConfigProperties. +func (g GatewayRouteConfigProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "discoveryStatus", d.DiscoveryStatus) - populate(objectMap, "name", d.Name) - populate(objectMap, "reason", d.Reason) - populate(objectMap, "startTime", d.StartTime) - populate(objectMap, "status", d.Status) - populate(objectMap, "zone", d.Zone) + populate(objectMap, "appResourceId", g.AppResourceID) + populate(objectMap, "filters", g.Filters) + populate(objectMap, "openApi", g.OpenAPI) + populate(objectMap, "predicates", g.Predicates) + populate(objectMap, "protocol", g.Protocol) + populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "routes", g.Routes) + populate(objectMap, "ssoEnabled", g.SsoEnabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentInstance. -func (d *DeploymentInstance) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayRouteConfigProperties. +func (g *GatewayRouteConfigProperties) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "discoveryStatus": - err = unpopulate(val, "DiscoveryStatus", &d.DiscoveryStatus) + case "appResourceId": + err = unpopulate(val, "AppResourceID", &g.AppResourceID) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) + case "filters": + err = unpopulate(val, "Filters", &g.Filters) delete(rawMsg, key) - case "reason": - err = unpopulate(val, "Reason", &d.Reason) + case "openApi": + err = unpopulate(val, "OpenAPI", &g.OpenAPI) delete(rawMsg, key) - case "startTime": - err = unpopulate(val, "StartTime", &d.StartTime) + case "predicates": + err = unpopulate(val, "Predicates", &g.Predicates) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) + case "protocol": + err = unpopulate(val, "Protocol", &g.Protocol) delete(rawMsg, key) - case "zone": - err = unpopulate(val, "Zone", &d.Zone) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) + delete(rawMsg, key) + case "routes": + err = unpopulate(val, "Routes", &g.Routes) + delete(rawMsg, key) + case "ssoEnabled": + err = unpopulate(val, "SsoEnabled", &g.SsoEnabled) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeploymentResource. -func (d DeploymentResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayRouteConfigResource. +func (g GatewayRouteConfigResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentResource. -func (d *DeploymentResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayRouteConfigResource. +func (g *GatewayRouteConfigResource) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &d.ID) + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &d.Name) + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &d.Properties) - delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + err = unpopulate(val, "SystemData", &g.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &d.Type) + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeploymentResourceCollection. -func (d DeploymentResourceCollection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GatewayRouteConfigResourceCollection. +func (g GatewayRouteConfigResourceCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentResourceCollection. -func (d *DeploymentResourceCollection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayRouteConfigResourceCollection. +func (g *GatewayRouteConfigResourceCollection) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + err = unpopulate(val, "NextLink", &g.NextLink) delete(rawMsg, key) case "value": - err = unpopulate(val, "Value", &d.Value) + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeploymentResourceProperties. -func (d DeploymentResourceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitPatternRepository. +func (g GitPatternRepository) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "active", d.Active) - populate(objectMap, "deploymentSettings", d.DeploymentSettings) - populate(objectMap, "instances", d.Instances) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "source", d.Source) - populate(objectMap, "status", d.Status) + populate(objectMap, "hostKey", g.HostKey) + populate(objectMap, "hostKeyAlgorithm", g.HostKeyAlgorithm) + populate(objectMap, "label", g.Label) + populate(objectMap, "name", g.Name) + populate(objectMap, "password", g.Password) + populate(objectMap, "pattern", g.Pattern) + populate(objectMap, "privateKey", g.PrivateKey) + populate(objectMap, "searchPaths", g.SearchPaths) + populate(objectMap, "strictHostKeyChecking", g.StrictHostKeyChecking) + populate(objectMap, "uri", g.URI) + populate(objectMap, "username", g.Username) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentResourceProperties. -func (d *DeploymentResourceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitPatternRepository. +func (g *GitPatternRepository) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "active": - err = unpopulate(val, "Active", &d.Active) + case "hostKey": + err = unpopulate(val, "HostKey", &g.HostKey) delete(rawMsg, key) - case "deploymentSettings": - err = unpopulate(val, "DeploymentSettings", &d.DeploymentSettings) + case "hostKeyAlgorithm": + err = unpopulate(val, "HostKeyAlgorithm", &g.HostKeyAlgorithm) delete(rawMsg, key) - case "instances": - err = unpopulate(val, "Instances", &d.Instances) + case "label": + err = unpopulate(val, "Label", &g.Label) delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + case "name": + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "source": - d.Source, err = unmarshalUserSourceInfoClassification(val) + case "password": + err = unpopulate(val, "Password", &g.Password) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) + case "pattern": + err = unpopulate(val, "Pattern", &g.Pattern) + delete(rawMsg, key) + case "privateKey": + err = unpopulate(val, "PrivateKey", &g.PrivateKey) + delete(rawMsg, key) + case "searchPaths": + err = unpopulate(val, "SearchPaths", &g.SearchPaths) + delete(rawMsg, key) + case "strictHostKeyChecking": + err = unpopulate(val, "StrictHostKeyChecking", &g.StrictHostKeyChecking) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &g.URI) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &g.Username) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DeploymentSettings. -func (d DeploymentSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HTTPGetAction. +func (h HTTPGetAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "addonConfigs", d.AddonConfigs) - populate(objectMap, "environmentVariables", d.EnvironmentVariables) - populate(objectMap, "resourceRequests", d.ResourceRequests) + populate(objectMap, "path", h.Path) + populate(objectMap, "scheme", h.Scheme) + objectMap["type"] = ProbeActionTypeHTTPGetAction return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeploymentSettings. -func (d *DeploymentSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPGetAction. +func (h *HTTPGetAction) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", h, err) } for key, val := range rawMsg { var err error switch key { - case "addonConfigs": - err = unpopulate(val, "AddonConfigs", &d.AddonConfigs) + case "path": + err = unpopulate(val, "Path", &h.Path) delete(rawMsg, key) - case "environmentVariables": - err = unpopulate(val, "EnvironmentVariables", &d.EnvironmentVariables) + case "scheme": + err = unpopulate(val, "Scheme", &h.Scheme) delete(rawMsg, key) - case "resourceRequests": - err = unpopulate(val, "ResourceRequests", &d.ResourceRequests) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HTTPScaleRule. +func (h HTTPScaleRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "auth", h.Auth) + populate(objectMap, "metadata", h.Metadata) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPScaleRule. +func (h *HTTPScaleRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "auth": + err = unpopulate(val, "Auth", &h.Auth) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &h.Metadata) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImageRegistryCredential. +func (i ImageRegistryCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "password", i.Password) + populate(objectMap, "username", i.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImageRegistryCredential. +func (i *ImageRegistryCredential) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "password": + err = unpopulate(val, "Password", &i.Password) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &i.Username) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DiagnosticParameters. -func (d DiagnosticParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IngressConfig. +func (i IngressConfig) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "appInstance", d.AppInstance) - populate(objectMap, "duration", d.Duration) - populate(objectMap, "filePath", d.FilePath) + populate(objectMap, "readTimeoutInSeconds", i.ReadTimeoutInSeconds) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticParameters. -func (d *DiagnosticParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IngressConfig. +func (i *IngressConfig) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "appInstance": - err = unpopulate(val, "AppInstance", &d.AppInstance) - delete(rawMsg, key) - case "duration": - err = unpopulate(val, "Duration", &d.Duration) - delete(rawMsg, key) - case "filePath": - err = unpopulate(val, "FilePath", &d.FilePath) + case "readTimeoutInSeconds": + err = unpopulate(val, "ReadTimeoutInSeconds", &i.ReadTimeoutInSeconds) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Error. -func (e Error) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IngressSettings. +func (i IngressSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", e.Code) - populate(objectMap, "message", e.Message) + populate(objectMap, "backendProtocol", i.BackendProtocol) + populate(objectMap, "clientAuth", i.ClientAuth) + populate(objectMap, "readTimeoutInSeconds", i.ReadTimeoutInSeconds) + populate(objectMap, "sendTimeoutInSeconds", i.SendTimeoutInSeconds) + populate(objectMap, "sessionAffinity", i.SessionAffinity) + populate(objectMap, "sessionCookieMaxAge", i.SessionCookieMaxAge) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Error. -func (e *Error) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IngressSettings. +func (i *IngressSettings) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &e.Code) + case "backendProtocol": + err = unpopulate(val, "BackendProtocol", &i.BackendProtocol) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) + case "clientAuth": + err = unpopulate(val, "ClientAuth", &i.ClientAuth) + delete(rawMsg, key) + case "readTimeoutInSeconds": + err = unpopulate(val, "ReadTimeoutInSeconds", &i.ReadTimeoutInSeconds) + delete(rawMsg, key) + case "sendTimeoutInSeconds": + err = unpopulate(val, "SendTimeoutInSeconds", &i.SendTimeoutInSeconds) + delete(rawMsg, key) + case "sessionAffinity": + err = unpopulate(val, "SessionAffinity", &i.SessionAffinity) + delete(rawMsg, key) + case "sessionCookieMaxAge": + err = unpopulate(val, "SessionCookieMaxAge", &i.SessionCookieMaxAge) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GitPatternRepository. -func (g GitPatternRepository) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type IngressSettingsClientAuth. +func (i IngressSettingsClientAuth) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "hostKey", g.HostKey) - populate(objectMap, "hostKeyAlgorithm", g.HostKeyAlgorithm) - populate(objectMap, "label", g.Label) - populate(objectMap, "name", g.Name) - populate(objectMap, "password", g.Password) - populate(objectMap, "pattern", g.Pattern) - populate(objectMap, "privateKey", g.PrivateKey) - populate(objectMap, "searchPaths", g.SearchPaths) - populate(objectMap, "strictHostKeyChecking", g.StrictHostKeyChecking) - populate(objectMap, "uri", g.URI) - populate(objectMap, "username", g.Username) + populate(objectMap, "certificates", i.Certificates) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GitPatternRepository. -func (g *GitPatternRepository) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type IngressSettingsClientAuth. +func (i *IngressSettingsClientAuth) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } for key, val := range rawMsg { var err error switch key { - case "hostKey": - err = unpopulate(val, "HostKey", &g.HostKey) - delete(rawMsg, key) - case "hostKeyAlgorithm": - err = unpopulate(val, "HostKeyAlgorithm", &g.HostKeyAlgorithm) - delete(rawMsg, key) - case "label": - err = unpopulate(val, "Label", &g.Label) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "password": - err = unpopulate(val, "Password", &g.Password) - delete(rawMsg, key) - case "pattern": - err = unpopulate(val, "Pattern", &g.Pattern) - delete(rawMsg, key) - case "privateKey": - err = unpopulate(val, "PrivateKey", &g.PrivateKey) - delete(rawMsg, key) - case "searchPaths": - err = unpopulate(val, "SearchPaths", &g.SearchPaths) - delete(rawMsg, key) - case "strictHostKeyChecking": - err = unpopulate(val, "StrictHostKeyChecking", &g.StrictHostKeyChecking) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &g.URI) - delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &g.Username) + case "certificates": + err = unpopulate(val, "Certificates", &i.Certificates) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", i, err) } } return nil @@ -2704,6 +5428,7 @@ func (k KeyVaultCertificateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "issuedDate", k.IssuedDate) populate(objectMap, "issuer", k.Issuer) populate(objectMap, "keyVaultCertName", k.KeyVaultCertName) + populate(objectMap, "provisioningState", k.ProvisioningState) populate(objectMap, "subjectName", k.SubjectName) populate(objectMap, "thumbprint", k.Thumbprint) objectMap["type"] = "KeyVaultCertificate" @@ -2744,6 +5469,9 @@ func (k *KeyVaultCertificateProperties) UnmarshalJSON(data []byte) error { case "keyVaultCertName": err = unpopulate(val, "KeyVaultCertName", &k.KeyVaultCertName) delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &k.ProvisioningState) + delete(rawMsg, key) case "subjectName": err = unpopulate(val, "SubjectName", &k.SubjectName) delete(rawMsg, key) @@ -2863,6 +5591,7 @@ func (m ManagedIdentityProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "principalId", m.PrincipalID) populate(objectMap, "tenantId", m.TenantID) populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) return json.Marshal(objectMap) } @@ -2884,6 +5613,44 @@ func (m *ManagedIdentityProperties) UnmarshalJSON(data []byte) error { case "type": err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MarketplaceResource. +func (m MarketplaceResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "plan", m.Plan) + populate(objectMap, "product", m.Product) + populate(objectMap, "publisher", m.Publisher) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MarketplaceResource. +func (m *MarketplaceResource) UnmarshalJSON(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 "plan": + err = unpopulate(val, "Plan", &m.Plan) + delete(rawMsg, key) + case "product": + err = unpopulate(val, "Product", &m.Product) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &m.Publisher) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -3198,7 +5965,9 @@ func (n NetworkProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "appNetworkResourceGroup", n.AppNetworkResourceGroup) populate(objectMap, "appSubnetId", n.AppSubnetID) + populate(objectMap, "ingressConfig", n.IngressConfig) populate(objectMap, "outboundIPs", n.OutboundIPs) + populate(objectMap, "outboundType", n.OutboundType) populate(objectMap, "requiredTraffics", n.RequiredTraffics) populate(objectMap, "serviceCidr", n.ServiceCidr) populate(objectMap, "serviceRuntimeNetworkResourceGroup", n.ServiceRuntimeNetworkResourceGroup) @@ -3221,9 +5990,15 @@ func (n *NetworkProfile) UnmarshalJSON(data []byte) error { case "appSubnetId": err = unpopulate(val, "AppSubnetID", &n.AppSubnetID) delete(rawMsg, key) + case "ingressConfig": + err = unpopulate(val, "IngressConfig", &n.IngressConfig) + delete(rawMsg, key) case "outboundIPs": err = unpopulate(val, "OutboundIPs", &n.OutboundIPs) delete(rawMsg, key) + case "outboundType": + err = unpopulate(val, "OutboundType", &n.OutboundType) + delete(rawMsg, key) case "requiredTraffics": err = unpopulate(val, "RequiredTraffics", &n.RequiredTraffics) delete(rawMsg, key) @@ -3346,55 +6121,264 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { case "provider": err = unpopulate(val, "Provider", &o.Provider) delete(rawMsg, key) - case "resource": - err = unpopulate(val, "Resource", &o.Resource) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationProperties. +func (o OperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceSpecification", o.ServiceSpecification) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties. +func (o *OperationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PersistentDisk. +func (p PersistentDisk) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "mountPath", p.MountPath) + populate(objectMap, "sizeInGB", p.SizeInGB) + populate(objectMap, "usedInGB", p.UsedInGB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PersistentDisk. +func (p *PersistentDisk) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mountPath": + err = unpopulate(val, "MountPath", &p.MountPath) + delete(rawMsg, key) + case "sizeInGB": + err = unpopulate(val, "SizeInGB", &p.SizeInGB) + delete(rawMsg, key) + case "usedInGB": + err = unpopulate(val, "UsedInGB", &p.UsedInGB) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PredefinedAcceleratorProperties. +func (p PredefinedAcceleratorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "acceleratorTags", p.AcceleratorTags) + populate(objectMap, "description", p.Description) + populate(objectMap, "displayName", p.DisplayName) + populate(objectMap, "iconUrl", p.IconURL) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "state", p.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PredefinedAcceleratorProperties. +func (p *PredefinedAcceleratorProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "acceleratorTags": + err = unpopulate(val, "AcceleratorTags", &p.AcceleratorTags) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &p.DisplayName) + delete(rawMsg, key) + case "iconUrl": + err = unpopulate(val, "IconURL", &p.IconURL) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &p.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PredefinedAcceleratorResource. +func (p PredefinedAcceleratorResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "sku", p.SKU) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PredefinedAcceleratorResource. +func (p *PredefinedAcceleratorResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &p.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PredefinedAcceleratorResourceCollection. +func (p PredefinedAcceleratorResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PredefinedAcceleratorResourceCollection. +func (p *PredefinedAcceleratorResourceCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationProperties. -func (o OperationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Probe. +func (p Probe) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "serviceSpecification", o.ServiceSpecification) + populate(objectMap, "disableProbe", p.DisableProbe) + populate(objectMap, "failureThreshold", p.FailureThreshold) + populate(objectMap, "initialDelaySeconds", p.InitialDelaySeconds) + populate(objectMap, "periodSeconds", p.PeriodSeconds) + populate(objectMap, "probeAction", p.ProbeAction) + populate(objectMap, "successThreshold", p.SuccessThreshold) + populate(objectMap, "timeoutSeconds", p.TimeoutSeconds) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties. -func (o *OperationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Probe. +func (p *Probe) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } for key, val := range rawMsg { var err error switch key { - case "serviceSpecification": - err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) + case "disableProbe": + err = unpopulate(val, "DisableProbe", &p.DisableProbe) + delete(rawMsg, key) + case "failureThreshold": + err = unpopulate(val, "FailureThreshold", &p.FailureThreshold) + delete(rawMsg, key) + case "initialDelaySeconds": + err = unpopulate(val, "InitialDelaySeconds", &p.InitialDelaySeconds) + delete(rawMsg, key) + case "periodSeconds": + err = unpopulate(val, "PeriodSeconds", &p.PeriodSeconds) + delete(rawMsg, key) + case "probeAction": + p.ProbeAction, err = unmarshalProbeActionClassification(val) + delete(rawMsg, key) + case "successThreshold": + err = unpopulate(val, "SuccessThreshold", &p.SuccessThreshold) + delete(rawMsg, key) + case "timeoutSeconds": + err = unpopulate(val, "TimeoutSeconds", &p.TimeoutSeconds) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", p, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PersistentDisk. -func (p PersistentDisk) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ProbeAction. +func (p ProbeAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "mountPath", p.MountPath) - populate(objectMap, "sizeInGB", p.SizeInGB) - populate(objectMap, "usedInGB", p.UsedInGB) + objectMap["type"] = p.Type return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PersistentDisk. -func (p *PersistentDisk) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProbeAction. +func (p *ProbeAction) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -3402,14 +6386,8 @@ func (p *PersistentDisk) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "mountPath": - err = unpopulate(val, "MountPath", &p.MountPath) - delete(rawMsg, key) - case "sizeInGB": - err = unpopulate(val, "SizeInGB", &p.SizeInGB) - delete(rawMsg, key) - case "usedInGB": - err = unpopulate(val, "UsedInGB", &p.UsedInGB) + case "type": + err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) } if err != nil { @@ -3458,6 +6436,41 @@ func (p *ProxyResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type QueueScaleRule. +func (q QueueScaleRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "auth", q.Auth) + populate(objectMap, "queueLength", q.QueueLength) + populate(objectMap, "queueName", q.QueueName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueueScaleRule. +func (q *QueueScaleRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "auth": + err = unpopulate(val, "Auth", &q.Auth) + delete(rawMsg, key) + case "queueLength": + err = unpopulate(val, "QueueLength", &q.QueueLength) + delete(rawMsg, key) + case "queueName": + err = unpopulate(val, "QueueName", &q.QueueName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RegenerateTestKeyRequestPayload. func (r RegenerateTestKeyRequestPayload) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3485,6 +6498,64 @@ func (r *RegenerateTestKeyRequestPayload) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RemoteDebugging. +func (r RemoteDebugging) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", r.Enabled) + populate(objectMap, "port", r.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RemoteDebugging. +func (r *RemoteDebugging) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &r.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RemoteDebuggingPayload. +func (r RemoteDebuggingPayload) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", r.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RemoteDebuggingPayload. +func (r *RemoteDebuggingPayload) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "port": + err = unpopulate(val, "Port", &r.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RequiredTraffic. func (r RequiredTraffic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3887,8 +6958,186 @@ func (s SKU) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. -func (s *SKU) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(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 "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + 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 SKUCapacity. +func (s SKUCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "default", s.Default) + populate(objectMap, "maximum", s.Maximum) + populate(objectMap, "minimum", s.Minimum) + populate(objectMap, "scaleType", s.ScaleType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapacity. +func (s *SKUCapacity) UnmarshalJSON(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 "default": + err = unpopulate(val, "Default", &s.Default) + delete(rawMsg, key) + case "maximum": + err = unpopulate(val, "Maximum", &s.Maximum) + delete(rawMsg, key) + case "minimum": + err = unpopulate(val, "Minimum", &s.Minimum) + delete(rawMsg, key) + case "scaleType": + err = unpopulate(val, "ScaleType", &s.ScaleType) + 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 SKUObject. +func (s SKUObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sku", s.SKU) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUObject. +func (s *SKUObject) UnmarshalJSON(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 "sku": + err = unpopulate(val, "SKU", &s.SKU) + 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 Scale. +func (s Scale) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxReplicas", s.MaxReplicas) + populate(objectMap, "minReplicas", s.MinReplicas) + populate(objectMap, "rules", s.Rules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Scale. +func (s *Scale) UnmarshalJSON(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 "maxReplicas": + err = unpopulate(val, "MaxReplicas", &s.MaxReplicas) + delete(rawMsg, key) + case "minReplicas": + err = unpopulate(val, "MinReplicas", &s.MinReplicas) + delete(rawMsg, key) + case "rules": + err = unpopulate(val, "Rules", &s.Rules) + 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 ScaleRule. +func (s ScaleRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureQueue", s.AzureQueue) + populate(objectMap, "custom", s.Custom) + populate(objectMap, "http", s.HTTP) + populate(objectMap, "name", s.Name) + populate(objectMap, "tcp", s.TCP) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleRule. +func (s *ScaleRule) UnmarshalJSON(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 "azureQueue": + err = unpopulate(val, "AzureQueue", &s.AzureQueue) + delete(rawMsg, key) + case "custom": + err = unpopulate(val, "Custom", &s.Custom) + delete(rawMsg, key) + case "http": + err = unpopulate(val, "HTTP", &s.HTTP) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "tcp": + err = unpopulate(val, "TCP", &s.TCP) + 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 ScaleRuleAuth. +func (s ScaleRuleAuth) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "secretRef", s.SecretRef) + populate(objectMap, "triggerParameter", s.TriggerParameter) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScaleRuleAuth. +func (s *ScaleRuleAuth) UnmarshalJSON(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) @@ -3896,14 +7145,11 @@ func (s *SKU) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "capacity": - err = unpopulate(val, "Capacity", &s.Capacity) + case "secretRef": + err = unpopulate(val, "SecretRef", &s.SecretRef) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "tier": - err = unpopulate(val, "Tier", &s.Tier) + case "triggerParameter": + err = unpopulate(val, "TriggerParameter", &s.TriggerParameter) delete(rawMsg, key) } if err != nil { @@ -3913,18 +7159,16 @@ func (s *SKU) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SKUCapacity. -func (s SKUCapacity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Secret. +func (s Secret) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "default", s.Default) - populate(objectMap, "maximum", s.Maximum) - populate(objectMap, "minimum", s.Minimum) - populate(objectMap, "scaleType", s.ScaleType) + populate(objectMap, "name", s.Name) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapacity. -func (s *SKUCapacity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Secret. +func (s *Secret) UnmarshalJSON(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) @@ -3932,17 +7176,11 @@ func (s *SKUCapacity) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "default": - err = unpopulate(val, "Default", &s.Default) - delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &s.Maximum) - delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &s.Minimum) + case "name": + err = unpopulate(val, "Name", &s.Name) delete(rawMsg, key) - case "scaleType": - err = unpopulate(val, "ScaleType", &s.ScaleType) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -4244,6 +7482,33 @@ func (s *ServiceSpecification) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ServiceVNetAddons. +func (s ServiceVNetAddons) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "logStreamPublicEndpoint", s.LogStreamPublicEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceVNetAddons. +func (s *ServiceVNetAddons) UnmarshalJSON(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 "logStreamPublicEndpoint": + err = unpopulate(val, "LogStreamPublicEndpoint", &s.LogStreamPublicEndpoint) + 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 SourceUploadedUserSourceInfo. func (s SourceUploadedUserSourceInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4287,6 +7552,45 @@ func (s *SourceUploadedUserSourceInfo) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SsoProperties. +func (s SsoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", s.ClientID) + populate(objectMap, "clientSecret", s.ClientSecret) + populate(objectMap, "issuerUri", s.IssuerURI) + populate(objectMap, "scope", s.Scope) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SsoProperties. +func (s *SsoProperties) UnmarshalJSON(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 "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &s.ClientSecret) + delete(rawMsg, key) + case "issuerUri": + err = unpopulate(val, "IssuerURI", &s.IssuerURI) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &s.Scope) + 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 StackProperties. func (s StackProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4318,6 +7622,142 @@ func (s *StackProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type StorageAccount. +func (s StorageAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accountKey", s.AccountKey) + populate(objectMap, "accountName", s.AccountName) + objectMap["storageType"] = StorageTypeStorageAccount + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccount. +func (s *StorageAccount) UnmarshalJSON(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 "accountKey": + err = unpopulate(val, "AccountKey", &s.AccountKey) + delete(rawMsg, key) + case "accountName": + err = unpopulate(val, "AccountName", &s.AccountName) + delete(rawMsg, key) + case "storageType": + err = unpopulate(val, "StorageType", &s.StorageType) + 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 StorageProperties. +func (s StorageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["storageType"] = s.StorageType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageProperties. +func (s *StorageProperties) UnmarshalJSON(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 "storageType": + err = unpopulate(val, "StorageType", &s.StorageType) + 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 StorageResource. +func (s StorageResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageResource. +func (s *StorageResource) UnmarshalJSON(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 "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + s.Properties, err = unmarshalStoragePropertiesClassification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + 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 StorageResourceCollection. +func (s StorageResourceCollection) 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 StorageResourceCollection. +func (s *StorageResourceCollection) UnmarshalJSON(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) @@ -4606,6 +8046,64 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TCPScaleRule. +func (t TCPScaleRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "auth", t.Auth) + populate(objectMap, "metadata", t.Metadata) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TCPScaleRule. +func (t *TCPScaleRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "auth": + err = unpopulate(val, "Auth", &t.Auth) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &t.Metadata) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TCPSocketAction. +func (t TCPSocketAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["type"] = ProbeActionTypeTCPSocketAction + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TCPSocketAction. +func (t *TCPSocketAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TemporaryDisk. func (t TemporaryDisk) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4789,6 +8287,37 @@ func (u *UploadedUserSourceInfo) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UserAssignedManagedIdentity. +func (u UserAssignedManagedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedManagedIdentity. +func (u *UserAssignedManagedIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type UserSourceInfo. func (u UserSourceInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4861,6 +8390,16 @@ func populate(m map[string]any, k string, v any) { } } +func populateAny(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else { + m[k] = v + } +} + func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go b/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go index 4a715d4157a2..28608234a7fd 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client.go @@ -48,7 +48,7 @@ func NewMonitoringSettingsClient(subscriptionID string, credential azcore.TokenC // Get - Get the Monitoring Setting and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -88,7 +88,7 @@ func (client *MonitoringSettingsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -106,7 +106,7 @@ func (client *MonitoringSettingsClient) getHandleResponse(resp *http.Response) ( // BeginUpdatePatch - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -119,9 +119,7 @@ func (client *MonitoringSettingsClient) BeginUpdatePatch(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MonitoringSettingsClientUpdatePatchResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[MonitoringSettingsClientUpdatePatchResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[MonitoringSettingsClientUpdatePatchResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -130,7 +128,7 @@ func (client *MonitoringSettingsClient) BeginUpdatePatch(ctx context.Context, re // UpdatePatch - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *MonitoringSettingsClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, monitoringSettingResource MonitoringSettingResource, options *MonitoringSettingsClientBeginUpdatePatchOptions) (*http.Response, error) { req, err := client.updatePatchCreateRequest(ctx, resourceGroupName, serviceName, monitoringSettingResource, options) if err != nil { @@ -166,7 +164,7 @@ func (client *MonitoringSettingsClient) updatePatchCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, monitoringSettingResource) @@ -175,7 +173,7 @@ func (client *MonitoringSettingsClient) updatePatchCreateRequest(ctx context.Con // BeginUpdatePut - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -188,9 +186,7 @@ func (client *MonitoringSettingsClient) BeginUpdatePut(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MonitoringSettingsClientUpdatePutResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[MonitoringSettingsClientUpdatePutResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[MonitoringSettingsClientUpdatePutResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -199,7 +195,7 @@ func (client *MonitoringSettingsClient) BeginUpdatePut(ctx context.Context, reso // UpdatePut - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *MonitoringSettingsClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, monitoringSettingResource MonitoringSettingResource, options *MonitoringSettingsClientBeginUpdatePutOptions) (*http.Response, error) { req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, monitoringSettingResource, options) if err != nil { @@ -235,7 +231,7 @@ func (client *MonitoringSettingsClient) updatePutCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, monitoringSettingResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client_example_test.go index 71c5809003e2..dfe250e14d10 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/monitoringsettings_client_example_test.go @@ -15,10 +15,10 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/MonitoringSettings_Get.json +// Generated from 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 { @@ -60,7 +60,7 @@ func ExampleMonitoringSettingsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/MonitoringSettings_UpdatePut.json +// Generated from 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 { @@ -112,7 +112,7 @@ func ExampleMonitoringSettingsClient_BeginUpdatePut() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/MonitoringSettings_UpdatePatch.json +// Generated from 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 { diff --git a/sdk/resourcemanager/appplatform/armappplatform/operations_client.go b/sdk/resourcemanager/appplatform/armappplatform/operations_client.go index 54695f9d26e8..f5b812a12486 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/operations_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/operations_client.go @@ -40,7 +40,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available REST API operations of the Microsoft.AppPlatform provider. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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]{ @@ -78,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-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 index 418225dfb3b4..319176588a8d 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/operations_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/operations_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Operations_List.json +// Generated from 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 { diff --git a/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go b/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go index 260813d0c80d..b56f75c8c26a 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go +++ b/sdk/resourcemanager/appplatform/armappplatform/polymorphic_helpers.go @@ -11,6 +11,28 @@ package armappplatform import "encoding/json" +func unmarshalAcceleratorAuthSettingClassification(rawMsg json.RawMessage) (AcceleratorAuthSettingClassification, 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 AcceleratorAuthSettingClassification + switch m["authType"] { + case "BasicAuth": + b = &AcceleratorBasicAuthSetting{} + case "Public": + b = &AcceleratorPublicSetting{} + case "SSH": + b = &AcceleratorSSHSetting{} + default: + b = &AcceleratorAuthSetting{} + } + return b, json.Unmarshal(rawMsg, b) +} + func unmarshalCertificatePropertiesClassification(rawMsg json.RawMessage) (CertificatePropertiesClassification, error) { if rawMsg == nil { return nil, nil @@ -31,6 +53,64 @@ func unmarshalCertificatePropertiesClassification(rawMsg json.RawMessage) (Certi return b, json.Unmarshal(rawMsg, b) } +func unmarshalCustomPersistentDiskPropertiesClassification(rawMsg json.RawMessage) (CustomPersistentDiskPropertiesClassification, 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 CustomPersistentDiskPropertiesClassification + switch m["type"] { + case string(TypeAzureFileVolume): + b = &AzureFileVolume{} + default: + b = &CustomPersistentDiskProperties{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalProbeActionClassification(rawMsg json.RawMessage) (ProbeActionClassification, 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 ProbeActionClassification + switch m["type"] { + case string(ProbeActionTypeExecAction): + b = &ExecAction{} + case string(ProbeActionTypeHTTPGetAction): + b = &HTTPGetAction{} + case string(ProbeActionTypeTCPSocketAction): + b = &TCPSocketAction{} + default: + b = &ProbeAction{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalStoragePropertiesClassification(rawMsg json.RawMessage) (StoragePropertiesClassification, 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 StoragePropertiesClassification + switch m["storageType"] { + case string(StorageTypeStorageAccount): + b = &StorageAccount{} + default: + b = &StorageProperties{} + } + return b, json.Unmarshal(rawMsg, b) +} + func unmarshalUserSourceInfoClassification(rawMsg json.RawMessage) (UserSourceInfoClassification, error) { if rawMsg == nil { return nil, nil @@ -43,6 +123,8 @@ func unmarshalUserSourceInfoClassification(rawMsg json.RawMessage) (UserSourceIn switch m["type"] { case "BuildResult": b = &BuildResultUserSourceInfo{} + case "Container": + b = &CustomContainerUserSourceInfo{} case "Jar": b = &JarUploadedUserSourceInfo{} case "NetCoreZip": diff --git a/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go b/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go new file mode 100644 index 000000000000..f14268b54554 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client.go @@ -0,0 +1,343 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// PredefinedAcceleratorsClient contains the methods for the PredefinedAccelerators group. +// Don't use this type directly, use NewPredefinedAcceleratorsClient() instead. +type PredefinedAcceleratorsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewPredefinedAcceleratorsClient creates a new instance of PredefinedAcceleratorsClient 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 NewPredefinedAcceleratorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PredefinedAcceleratorsClient, error) { + cl, err := arm.NewClient(moduleName+".PredefinedAcceleratorsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &PredefinedAcceleratorsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginDisable - Disable predefined accelerator. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - applicationAcceleratorName - The name of the application accelerator. +// - predefinedAcceleratorName - The name of the predefined accelerator. +// - options - PredefinedAcceleratorsClientBeginDisableOptions contains the optional parameters for the PredefinedAcceleratorsClient.BeginDisable +// method. +func (client *PredefinedAcceleratorsClient) BeginDisable(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientBeginDisableOptions) (*runtime.Poller[PredefinedAcceleratorsClientDisableResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.disable(ctx, resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PredefinedAcceleratorsClientDisableResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[PredefinedAcceleratorsClientDisableResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Disable - Disable predefined accelerator. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *PredefinedAcceleratorsClient) disable(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientBeginDisableOptions) (*http.Response, error) { + req, err := client.disableCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// disableCreateRequest creates the Disable request. +func (client *PredefinedAcceleratorsClient) disableCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientBeginDisableOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/disable" + 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 applicationAcceleratorName == "" { + return nil, errors.New("parameter applicationAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationAcceleratorName}", url.PathEscape(applicationAcceleratorName)) + if predefinedAcceleratorName == "" { + return nil, errors.New("parameter predefinedAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{predefinedAcceleratorName}", url.PathEscape(predefinedAcceleratorName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginEnable - Enable predefined accelerator. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - applicationAcceleratorName - The name of the application accelerator. +// - predefinedAcceleratorName - The name of the predefined accelerator. +// - options - PredefinedAcceleratorsClientBeginEnableOptions contains the optional parameters for the PredefinedAcceleratorsClient.BeginEnable +// method. +func (client *PredefinedAcceleratorsClient) BeginEnable(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientBeginEnableOptions) (*runtime.Poller[PredefinedAcceleratorsClientEnableResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.enable(ctx, resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PredefinedAcceleratorsClientEnableResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[PredefinedAcceleratorsClientEnableResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Enable - Enable predefined accelerator. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *PredefinedAcceleratorsClient) enable(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientBeginEnableOptions) (*http.Response, error) { + req, err := client.enableCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// enableCreateRequest creates the Enable request. +func (client *PredefinedAcceleratorsClient) enableCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientBeginEnableOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}/enable" + 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 applicationAcceleratorName == "" { + return nil, errors.New("parameter applicationAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationAcceleratorName}", url.PathEscape(applicationAcceleratorName)) + if predefinedAcceleratorName == "" { + return nil, errors.New("parameter predefinedAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{predefinedAcceleratorName}", url.PathEscape(predefinedAcceleratorName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the predefined accelerator. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - applicationAcceleratorName - The name of the application accelerator. +// - predefinedAcceleratorName - The name of the predefined accelerator. +// - options - PredefinedAcceleratorsClientGetOptions contains the optional parameters for the PredefinedAcceleratorsClient.Get +// method. +func (client *PredefinedAcceleratorsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientGetOptions) (PredefinedAcceleratorsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, predefinedAcceleratorName, options) + if err != nil { + return PredefinedAcceleratorsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PredefinedAcceleratorsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PredefinedAcceleratorsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PredefinedAcceleratorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, predefinedAcceleratorName string, options *PredefinedAcceleratorsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators/{predefinedAcceleratorName}" + 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 applicationAcceleratorName == "" { + return nil, errors.New("parameter applicationAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationAcceleratorName}", url.PathEscape(applicationAcceleratorName)) + if predefinedAcceleratorName == "" { + return nil, errors.New("parameter predefinedAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{predefinedAcceleratorName}", url.PathEscape(predefinedAcceleratorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *PredefinedAcceleratorsClient) getHandleResponse(resp *http.Response) (PredefinedAcceleratorsClientGetResponse, error) { + result := PredefinedAcceleratorsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PredefinedAcceleratorResource); err != nil { + return PredefinedAcceleratorsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handle requests to list all predefined accelerators. +// +// Generated from API version 2023-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. +// - applicationAcceleratorName - The name of the application accelerator. +// - options - PredefinedAcceleratorsClientListOptions contains the optional parameters for the PredefinedAcceleratorsClient.NewListPager +// method. +func (client *PredefinedAcceleratorsClient) NewListPager(resourceGroupName string, serviceName string, applicationAcceleratorName string, options *PredefinedAcceleratorsClientListOptions) *runtime.Pager[PredefinedAcceleratorsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PredefinedAcceleratorsClientListResponse]{ + More: func(page PredefinedAcceleratorsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PredefinedAcceleratorsClientListResponse) (PredefinedAcceleratorsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, applicationAcceleratorName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PredefinedAcceleratorsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return PredefinedAcceleratorsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PredefinedAcceleratorsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PredefinedAcceleratorsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, applicationAcceleratorName string, options *PredefinedAcceleratorsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/applicationAccelerators/{applicationAcceleratorName}/predefinedAccelerators" + 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 applicationAcceleratorName == "" { + return nil, errors.New("parameter applicationAcceleratorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationAcceleratorName}", url.PathEscape(applicationAcceleratorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *PredefinedAcceleratorsClient) listHandleResponse(resp *http.Response) (PredefinedAcceleratorsClientListResponse, error) { + result := PredefinedAcceleratorsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PredefinedAcceleratorResourceCollection); err != nil { + return PredefinedAcceleratorsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client_example_test.go new file mode 100644 index 000000000000..52d6faf01130 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/predefinedaccelerators_client_example_test.go @@ -0,0 +1,164 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 18366c1f871c..22e617e496e4 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/response_types.go +++ b/sdk/resourcemanager/appplatform/armappplatform/response_types.go @@ -9,6 +9,91 @@ package armappplatform +// APIPortalCustomDomainsClientCreateOrUpdateResponse contains the response from method APIPortalCustomDomainsClient.BeginCreateOrUpdate. +type APIPortalCustomDomainsClientCreateOrUpdateResponse struct { + APIPortalCustomDomainResource +} + +// APIPortalCustomDomainsClientDeleteResponse contains the response from method APIPortalCustomDomainsClient.BeginDelete. +type APIPortalCustomDomainsClientDeleteResponse struct { + // placeholder for future response values +} + +// APIPortalCustomDomainsClientGetResponse contains the response from method APIPortalCustomDomainsClient.Get. +type APIPortalCustomDomainsClientGetResponse struct { + APIPortalCustomDomainResource +} + +// APIPortalCustomDomainsClientListResponse contains the response from method APIPortalCustomDomainsClient.NewListPager. +type APIPortalCustomDomainsClientListResponse struct { + APIPortalCustomDomainResourceCollection +} + +// APIPortalsClientCreateOrUpdateResponse contains the response from method APIPortalsClient.BeginCreateOrUpdate. +type APIPortalsClientCreateOrUpdateResponse struct { + APIPortalResource +} + +// APIPortalsClientDeleteResponse contains the response from method APIPortalsClient.BeginDelete. +type APIPortalsClientDeleteResponse struct { + // placeholder for future response values +} + +// APIPortalsClientGetResponse contains the response from method APIPortalsClient.Get. +type APIPortalsClientGetResponse struct { + APIPortalResource +} + +// APIPortalsClientListResponse contains the response from method APIPortalsClient.NewListPager. +type APIPortalsClientListResponse struct { + APIPortalResourceCollection +} + +// APIPortalsClientValidateDomainResponse contains the response from method APIPortalsClient.ValidateDomain. +type APIPortalsClientValidateDomainResponse struct { + CustomDomainValidateResult +} + +// ApplicationAcceleratorsClientCreateOrUpdateResponse contains the response from method ApplicationAcceleratorsClient.BeginCreateOrUpdate. +type ApplicationAcceleratorsClientCreateOrUpdateResponse struct { + ApplicationAcceleratorResource +} + +// ApplicationAcceleratorsClientDeleteResponse contains the response from method ApplicationAcceleratorsClient.BeginDelete. +type ApplicationAcceleratorsClientDeleteResponse struct { + // placeholder for future response values +} + +// ApplicationAcceleratorsClientGetResponse contains the response from method ApplicationAcceleratorsClient.Get. +type ApplicationAcceleratorsClientGetResponse struct { + ApplicationAcceleratorResource +} + +// ApplicationAcceleratorsClientListResponse contains the response from method ApplicationAcceleratorsClient.NewListPager. +type ApplicationAcceleratorsClientListResponse struct { + ApplicationAcceleratorResourceCollection +} + +// ApplicationLiveViewsClientCreateOrUpdateResponse contains the response from method ApplicationLiveViewsClient.BeginCreateOrUpdate. +type ApplicationLiveViewsClientCreateOrUpdateResponse struct { + ApplicationLiveViewResource +} + +// ApplicationLiveViewsClientDeleteResponse contains the response from method ApplicationLiveViewsClient.BeginDelete. +type ApplicationLiveViewsClientDeleteResponse struct { + // placeholder for future response values +} + +// ApplicationLiveViewsClientGetResponse contains the response from method ApplicationLiveViewsClient.Get. +type ApplicationLiveViewsClientGetResponse struct { + ApplicationLiveViewResource +} + +// ApplicationLiveViewsClientListResponse contains the response from method ApplicationLiveViewsClient.NewListPager. +type ApplicationLiveViewsClientListResponse struct { + ApplicationLiveViewResourceCollection +} + // AppsClientCreateOrUpdateResponse contains the response from method AppsClient.BeginCreateOrUpdate. type AppsClientCreateOrUpdateResponse struct { AppResource @@ -104,6 +189,11 @@ type BuildServiceBuilderClientGetResponse struct { BuilderResource } +// BuildServiceBuilderClientListDeploymentsResponse contains the response from method BuildServiceBuilderClient.ListDeployments. +type BuildServiceBuilderClientListDeploymentsResponse struct { + DeploymentList +} + // BuildServiceBuilderClientListResponse contains the response from method BuildServiceBuilderClient.NewListPager. type BuildServiceBuilderClientListResponse struct { BuilderResourceCollection @@ -189,6 +279,11 @@ type BuildpackBindingClientGetResponse struct { BuildpackBindingResource } +// BuildpackBindingClientListForClusterResponse contains the response from method BuildpackBindingClient.NewListForClusterPager. +type BuildpackBindingClientListForClusterResponse struct { + BuildpackBindingResourceCollection +} + // BuildpackBindingClientListResponse contains the response from method BuildpackBindingClient.NewListPager. type BuildpackBindingClientListResponse struct { BuildpackBindingResourceCollection @@ -284,6 +379,31 @@ type CustomDomainsClientUpdateResponse struct { CustomDomainResource } +// CustomizedAcceleratorsClientCreateOrUpdateResponse contains the response from method CustomizedAcceleratorsClient.BeginCreateOrUpdate. +type CustomizedAcceleratorsClientCreateOrUpdateResponse struct { + CustomizedAcceleratorResource +} + +// CustomizedAcceleratorsClientDeleteResponse contains the response from method CustomizedAcceleratorsClient.BeginDelete. +type CustomizedAcceleratorsClientDeleteResponse struct { + // placeholder for future response values +} + +// CustomizedAcceleratorsClientGetResponse contains the response from method CustomizedAcceleratorsClient.Get. +type CustomizedAcceleratorsClientGetResponse struct { + CustomizedAcceleratorResource +} + +// CustomizedAcceleratorsClientListResponse contains the response from method CustomizedAcceleratorsClient.NewListPager. +type CustomizedAcceleratorsClientListResponse struct { + CustomizedAcceleratorResourceCollection +} + +// CustomizedAcceleratorsClientValidateResponse contains the response from method CustomizedAcceleratorsClient.Validate. +type CustomizedAcceleratorsClientValidateResponse struct { + CustomizedAcceleratorValidateResult +} + // DeploymentsClientCreateOrUpdateResponse contains the response from method DeploymentsClient.BeginCreateOrUpdate. type DeploymentsClientCreateOrUpdateResponse struct { DeploymentResource @@ -294,6 +414,16 @@ type DeploymentsClientDeleteResponse struct { // placeholder for future response values } +// DeploymentsClientDisableRemoteDebuggingResponse contains the response from method DeploymentsClient.BeginDisableRemoteDebugging. +type DeploymentsClientDisableRemoteDebuggingResponse struct { + RemoteDebugging +} + +// DeploymentsClientEnableRemoteDebuggingResponse contains the response from method DeploymentsClient.BeginEnableRemoteDebugging. +type DeploymentsClientEnableRemoteDebuggingResponse struct { + RemoteDebugging +} + // DeploymentsClientGenerateHeapDumpResponse contains the response from method DeploymentsClient.BeginGenerateHeapDump. type DeploymentsClientGenerateHeapDumpResponse struct { // placeholder for future response values @@ -309,6 +439,11 @@ type DeploymentsClientGetLogFileURLResponse struct { LogFileURLResponse } +// DeploymentsClientGetRemoteDebuggingConfigResponse contains the response from method DeploymentsClient.GetRemoteDebuggingConfig. +type DeploymentsClientGetRemoteDebuggingConfigResponse struct { + RemoteDebugging +} + // DeploymentsClientGetResponse contains the response from method DeploymentsClient.Get. type DeploymentsClientGetResponse struct { DeploymentResource @@ -349,6 +484,102 @@ type DeploymentsClientUpdateResponse struct { DeploymentResource } +// DevToolPortalsClientCreateOrUpdateResponse contains the response from method DevToolPortalsClient.BeginCreateOrUpdate. +type DevToolPortalsClientCreateOrUpdateResponse struct { + DevToolPortalResource +} + +// DevToolPortalsClientDeleteResponse contains the response from method DevToolPortalsClient.BeginDelete. +type DevToolPortalsClientDeleteResponse struct { + // placeholder for future response values +} + +// DevToolPortalsClientGetResponse contains the response from method DevToolPortalsClient.Get. +type DevToolPortalsClientGetResponse struct { + DevToolPortalResource +} + +// DevToolPortalsClientListResponse contains the response from method DevToolPortalsClient.NewListPager. +type DevToolPortalsClientListResponse struct { + DevToolPortalResourceCollection +} + +// GatewayCustomDomainsClientCreateOrUpdateResponse contains the response from method GatewayCustomDomainsClient.BeginCreateOrUpdate. +type GatewayCustomDomainsClientCreateOrUpdateResponse struct { + GatewayCustomDomainResource +} + +// GatewayCustomDomainsClientDeleteResponse contains the response from method GatewayCustomDomainsClient.BeginDelete. +type GatewayCustomDomainsClientDeleteResponse struct { + // placeholder for future response values +} + +// GatewayCustomDomainsClientGetResponse contains the response from method GatewayCustomDomainsClient.Get. +type GatewayCustomDomainsClientGetResponse struct { + GatewayCustomDomainResource +} + +// GatewayCustomDomainsClientListResponse contains the response from method GatewayCustomDomainsClient.NewListPager. +type GatewayCustomDomainsClientListResponse struct { + GatewayCustomDomainResourceCollection +} + +// GatewayRouteConfigsClientCreateOrUpdateResponse contains the response from method GatewayRouteConfigsClient.BeginCreateOrUpdate. +type GatewayRouteConfigsClientCreateOrUpdateResponse struct { + GatewayRouteConfigResource +} + +// GatewayRouteConfigsClientDeleteResponse contains the response from method GatewayRouteConfigsClient.BeginDelete. +type GatewayRouteConfigsClientDeleteResponse struct { + // placeholder for future response values +} + +// GatewayRouteConfigsClientGetResponse contains the response from method GatewayRouteConfigsClient.Get. +type GatewayRouteConfigsClientGetResponse struct { + GatewayRouteConfigResource +} + +// GatewayRouteConfigsClientListResponse contains the response from method GatewayRouteConfigsClient.NewListPager. +type GatewayRouteConfigsClientListResponse struct { + GatewayRouteConfigResourceCollection +} + +// GatewaysClientCreateOrUpdateResponse contains the response from method GatewaysClient.BeginCreateOrUpdate. +type GatewaysClientCreateOrUpdateResponse struct { + GatewayResource +} + +// GatewaysClientDeleteResponse contains the response from method GatewaysClient.BeginDelete. +type GatewaysClientDeleteResponse struct { + // placeholder for future response values +} + +// GatewaysClientGetResponse contains the response from method GatewaysClient.Get. +type GatewaysClientGetResponse struct { + GatewayResource +} + +// GatewaysClientListEnvSecretsResponse contains the response from method GatewaysClient.ListEnvSecrets. +type GatewaysClientListEnvSecretsResponse struct { + // Sensitive properties for Spring Cloud Gateway + Value map[string]*string +} + +// GatewaysClientListResponse contains the response from method GatewaysClient.NewListPager. +type GatewaysClientListResponse struct { + GatewayResourceCollection +} + +// GatewaysClientUpdateCapacityResponse contains the response from method GatewaysClient.BeginUpdateCapacity. +type GatewaysClientUpdateCapacityResponse struct { + GatewayResource +} + +// GatewaysClientValidateDomainResponse contains the response from method GatewaysClient.ValidateDomain. +type GatewaysClientValidateDomainResponse struct { + CustomDomainValidateResult +} + // MonitoringSettingsClientGetResponse contains the response from method MonitoringSettingsClient.Get. type MonitoringSettingsClientGetResponse struct { MonitoringSettingResource @@ -369,6 +600,26 @@ type OperationsClientListResponse struct { AvailableOperations } +// PredefinedAcceleratorsClientDisableResponse contains the response from method PredefinedAcceleratorsClient.BeginDisable. +type PredefinedAcceleratorsClientDisableResponse struct { + // placeholder for future response values +} + +// PredefinedAcceleratorsClientEnableResponse contains the response from method PredefinedAcceleratorsClient.BeginEnable. +type PredefinedAcceleratorsClientEnableResponse struct { + // placeholder for future response values +} + +// PredefinedAcceleratorsClientGetResponse contains the response from method PredefinedAcceleratorsClient.Get. +type PredefinedAcceleratorsClientGetResponse struct { + PredefinedAcceleratorResource +} + +// PredefinedAcceleratorsClientListResponse contains the response from method PredefinedAcceleratorsClient.NewListPager. +type PredefinedAcceleratorsClientListResponse struct { + PredefinedAcceleratorResourceCollection +} + // RuntimeVersionsClientListRuntimeVersionsResponse contains the response from method RuntimeVersionsClient.ListRuntimeVersions. type RuntimeVersionsClientListRuntimeVersionsResponse struct { AvailableRuntimeVersions @@ -449,7 +700,37 @@ type ServicesClientRegenerateTestKeyResponse struct { TestKeys } +// ServicesClientStartResponse contains the response from method ServicesClient.BeginStart. +type ServicesClientStartResponse struct { + // placeholder for future response values +} + +// ServicesClientStopResponse contains the response from method ServicesClient.BeginStop. +type ServicesClientStopResponse struct { + // placeholder for future response values +} + // ServicesClientUpdateResponse contains the response from method ServicesClient.BeginUpdate. type ServicesClientUpdateResponse struct { ServiceResource } + +// StoragesClientCreateOrUpdateResponse contains the response from method StoragesClient.BeginCreateOrUpdate. +type StoragesClientCreateOrUpdateResponse struct { + StorageResource +} + +// StoragesClientDeleteResponse contains the response from method StoragesClient.BeginDelete. +type StoragesClientDeleteResponse struct { + // placeholder for future response values +} + +// StoragesClientGetResponse contains the response from method StoragesClient.Get. +type StoragesClientGetResponse struct { + StorageResource +} + +// StoragesClientListResponse contains the response from method StoragesClient.NewListPager. +type StoragesClientListResponse struct { + StorageResourceCollection +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go b/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go index 09eac661bbf7..ee6fdd183cd0 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client.go @@ -41,7 +41,7 @@ func NewRuntimeVersionsClient(credential azcore.TokenCredential, options *arm.Cl // ListRuntimeVersions - Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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) { @@ -67,7 +67,7 @@ func (client *RuntimeVersionsClient) listRuntimeVersionsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-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 index 9f16fe175ec8..c9cb5513973d 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/runtimeversions_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/RuntimeVersions_ListRuntimeVersions.json +// Generated from 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 { diff --git a/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client.go b/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client.go index 9684434af0a4..0817d89a4c2d 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client.go @@ -48,7 +48,7 @@ func NewServiceRegistriesClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Create the default Service Registry or update the existing Service Registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -61,9 +61,7 @@ func (client *ServiceRegistriesClient) BeginCreateOrUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceRegistriesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ServiceRegistriesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[ServiceRegistriesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,7 +70,7 @@ func (client *ServiceRegistriesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Create the default Service Registry or update the existing Service Registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *ServiceRegistriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, serviceRegistryName string, options *ServiceRegistriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, serviceRegistryName, options) if err != nil { @@ -112,7 +110,7 @@ func (client *ServiceRegistriesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -121,7 +119,7 @@ func (client *ServiceRegistriesClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Disable the default Service Registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -134,9 +132,7 @@ func (client *ServiceRegistriesClient) BeginDelete(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceRegistriesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ServiceRegistriesClientDeleteResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[ServiceRegistriesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -145,7 +141,7 @@ func (client *ServiceRegistriesClient) BeginDelete(ctx context.Context, resource // Delete - Disable the default Service Registry. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *ServiceRegistriesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, serviceRegistryName string, options *ServiceRegistriesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, serviceRegistryName, options) if err != nil { @@ -185,7 +181,7 @@ func (client *ServiceRegistriesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,7 +190,7 @@ func (client *ServiceRegistriesClient) deleteCreateRequest(ctx context.Context, // Get - Get the Service Registry and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -239,7 +235,7 @@ func (client *ServiceRegistriesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,7 +252,7 @@ func (client *ServiceRegistriesClient) getHandleResponse(resp *http.Response) (S // NewListPager - Handles requests to list all resources in a Service. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -310,7 +306,7 @@ func (client *ServiceRegistriesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-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 index 74eb6e02c4e4..5dc85c1292a4 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/serviceregistries_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ServiceRegistries_Get.json +// Generated from 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 { @@ -67,7 +67,7 @@ func ExampleServiceRegistriesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ServiceRegistries_CreateOrUpdate.json +// Generated from 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 { @@ -121,7 +121,7 @@ func ExampleServiceRegistriesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ServiceRegistries_Delete.json +// Generated from 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 { @@ -142,7 +142,7 @@ func ExampleServiceRegistriesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ServiceRegistries_List.json +// Generated from 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 { diff --git a/sdk/resourcemanager/appplatform/armappplatform/services_client.go b/sdk/resourcemanager/appplatform/armappplatform/services_client.go index f4697a199ae2..727d00e7822f 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/services_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/services_client.go @@ -48,7 +48,7 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Checks that the resource name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview // - location - the region // - availabilityParameters - Parameters supplied to the operation. // - options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability @@ -84,7 +84,7 @@ func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, availabilityParameters) @@ -102,7 +102,7 @@ func (client *ServicesClient) checkNameAvailabilityHandleResponse(resp *http.Res // BeginCreateOrUpdate - Create a new Service or update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -115,9 +115,7 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ServicesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[ServicesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -126,7 +124,7 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a new Service or update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, resource ServiceResource, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, resource, options) if err != nil { @@ -162,7 +160,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) @@ -171,7 +169,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Operation to delete a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -182,9 +180,7 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ServicesClientDeleteResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[ServicesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -193,7 +189,7 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Operation to delete a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -229,7 +225,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +234,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // DisableTestEndpoint - Disable test endpoint functionality for a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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 +275,7 @@ func (client *ServicesClient) disableTestEndpointCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -288,7 +284,7 @@ func (client *ServicesClient) disableTestEndpointCreateRequest(ctx context.Conte // EnableTestEndpoint - Enable test endpoint functionality for a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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 +325,7 @@ func (client *ServicesClient) enableTestEndpointCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +343,7 @@ func (client *ServicesClient) enableTestEndpointHandleResponse(resp *http.Respon // Get - Get a Service and its properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -387,7 +383,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -404,7 +400,7 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // NewListPager - Handles requests to list all resources in a resource group. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -452,7 +448,7 @@ func (client *ServicesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -469,7 +465,7 @@ func (client *ServicesClient) listHandleResponse(resp *http.Response) (ServicesC // NewListBySubscriptionPager - Handles requests to list all resources in a subscription. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-01-01-preview // - options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager // method. func (client *ServicesClient) NewListBySubscriptionPager(options *ServicesClientListBySubscriptionOptions) *runtime.Pager[ServicesClientListBySubscriptionResponse] { @@ -512,7 +508,7 @@ func (client *ServicesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -530,7 +526,7 @@ func (client *ServicesClient) listBySubscriptionHandleResponse(resp *http.Respon // ListTestKeys - List test keys for a Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -570,7 +566,7 @@ func (client *ServicesClient) listTestKeysCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -588,7 +584,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 2022-04-01 +// Generated from API version 2023-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. @@ -630,7 +626,7 @@ func (client *ServicesClient) regenerateTestKeyCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regenerateTestKeyRequest) @@ -645,10 +641,140 @@ func (client *ServicesClient) regenerateTestKeyHandleResponse(resp *http.Respons return result, nil } +// BeginStart - Start a Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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 - ServicesClientBeginStartOptions contains the optional parameters for the ServicesClient.BeginStart method. +func (client *ServicesClient) BeginStart(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStartOptions) (*runtime.Poller[ServicesClientStartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.start(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ServicesClientStartResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[ServicesClientStartResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Start - Start a Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *ServicesClient) start(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStartOptions) (*http.Response, error) { + req, err := client.startCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startCreateRequest creates the Start request. +func (client *ServicesClient) startCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStop - Stop a Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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 - ServicesClientBeginStopOptions contains the optional parameters for the ServicesClient.BeginStop method. +func (client *ServicesClient) BeginStop(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStopOptions) (*runtime.Poller[ServicesClientStopResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stop(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ServicesClientStopResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[ServicesClientStopResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Stop - Stop a Service. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *ServicesClient) stop(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStopOptions) (*http.Response, error) { + req, err := client.stopCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopCreateRequest creates the Stop request. +func (client *ServicesClient) stopCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginUpdate - Operation to update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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. @@ -660,9 +786,7 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServicesClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ServicesClientUpdateResponse](resp, client.internal.Pipeline(), nil) } else { return runtime.NewPollerFromResumeToken[ServicesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -671,7 +795,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 2022-04-01 +// Generated from API version 2023-01-01-preview func (client *ServicesClient) update(ctx context.Context, resourceGroupName string, serviceName string, resource ServiceResource, options *ServicesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, resource, options) if err != nil { @@ -707,7 +831,7 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/services_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/services_client_example_test.go index f06f623bbe46..8314b4ba21e7 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/services_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/services_client_example_test.go @@ -15,11 +15,11 @@ import ( "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" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_Get.json -func ExampleServicesClient_Get() { +// Generated from 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) @@ -54,6 +54,9 @@ func ExampleServicesClient_Get() { // }, // 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"), @@ -95,7 +98,54 @@ func ExampleServicesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_CreateOrUpdate.json +// Generated from 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 { @@ -186,7 +236,172 @@ func ExampleServicesClient_BeginCreateOrUpdate_servicesCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_CreateOrUpdate_VNetInjection.json +// Generated from 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 { @@ -204,12 +419,18 @@ func ExampleServicesClient_BeginCreateOrUpdate_servicesCreateOrUpdateVNetInjecti }, 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"), + 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"), @@ -281,6 +502,9 @@ func ExampleServicesClient_BeginCreateOrUpdate_servicesCreateOrUpdateVNetInjecti // }, // ProvisioningState: to.Ptr(armappplatform.ProvisioningStateSucceeded), // ServiceID: to.Ptr("12345678abcd1234abcd12345678abcd"), + // VnetAddons: &armappplatform.ServiceVNetAddons{ + // LogStreamPublicEndpoint: to.Ptr(true), + // }, // }, // SKU: &armappplatform.SKU{ // Name: to.Ptr("S0"), @@ -289,7 +513,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_servicesCreateOrUpdateVNetInjecti // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_Delete.json +// Generated from 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 { @@ -310,7 +534,7 @@ func ExampleServicesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_Update.json +// Generated from 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 { @@ -401,7 +625,7 @@ func ExampleServicesClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_ListTestKeys.json +// Generated from 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 { @@ -428,7 +652,7 @@ func ExampleServicesClient_ListTestKeys() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_RegenerateTestKey.json +// Generated from 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 { @@ -457,7 +681,7 @@ func ExampleServicesClient_RegenerateTestKey() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_DisableTestEndpoint.json +// Generated from 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 { @@ -474,7 +698,7 @@ func ExampleServicesClient_DisableTestEndpoint() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_EnableTestEndpoint.json +// Generated from 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 { @@ -501,7 +725,49 @@ func ExampleServicesClient_EnableTestEndpoint() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_CheckNameAvailability.json +// Generated from 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 { @@ -529,7 +795,7 @@ func ExampleServicesClient_CheckNameAvailability() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_ListBySubscription.json +// Generated from 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 { @@ -571,6 +837,9 @@ func ExampleServicesClient_NewListBySubscriptionPager() { // }, // 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"), @@ -609,12 +878,39 @@ func ExampleServicesClient_NewListBySubscriptionPager() { // 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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_List.json +// Generated from 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 { @@ -656,6 +952,9 @@ func ExampleServicesClient_NewListPager() { // }, // 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"), @@ -694,6 +993,33 @@ func ExampleServicesClient_NewListPager() { // 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 ecf44416e30e..eb178fb7e147 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/skus_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/skus_client.go @@ -47,7 +47,7 @@ func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, opt // NewListPager - Lists all of the available skus of the Microsoft.AppPlatform provider. // -// Generated from API version 2022-04-01 +// Generated from API version 2023-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]{ @@ -89,7 +89,7 @@ func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2023-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 index 89bf042f7aa8..e7275f6ebf7a 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/skus_client_example_test.go +++ b/sdk/resourcemanager/appplatform/armappplatform/skus_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform" + "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/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Skus_List.json +// Generated from 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 { diff --git a/sdk/resourcemanager/appplatform/armappplatform/storages_client.go b/sdk/resourcemanager/appplatform/armappplatform/storages_client.go new file mode 100644 index 000000000000..425aba62994a --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/storages_client.go @@ -0,0 +1,321 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armappplatform + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// StoragesClient contains the methods for the Storages group. +// Don't use this type directly, use NewStoragesClient() instead. +type StoragesClient struct { + internal *arm.Client + subscriptionID string +} + +// NewStoragesClient creates a new instance of StoragesClient 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 NewStoragesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StoragesClient, error) { + cl, err := arm.NewClient(moduleName+".StoragesClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &StoragesClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update storage resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - storageName - The name of the storage resource. +// - storageResource - Parameters for the create or update operation +// - options - StoragesClientBeginCreateOrUpdateOptions contains the optional parameters for the StoragesClient.BeginCreateOrUpdate +// method. +func (client *StoragesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, storageName string, storageResource StorageResource, options *StoragesClientBeginCreateOrUpdateOptions) (*runtime.Poller[StoragesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, storageName, storageResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[StoragesClientCreateOrUpdateResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[StoragesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// CreateOrUpdate - Create or update storage resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *StoragesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, storageName string, storageResource StorageResource, options *StoragesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, storageName, storageResource, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *StoragesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, storageName string, storageResource StorageResource, options *StoragesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" + 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 storageName == "" { + return nil, errors.New("parameter storageName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{storageName}", url.PathEscape(storageName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, storageResource) +} + +// BeginDelete - Delete the storage resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - storageName - The name of the storage resource. +// - options - StoragesClientBeginDeleteOptions contains the optional parameters for the StoragesClient.BeginDelete method. +func (client *StoragesClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientBeginDeleteOptions) (*runtime.Poller[StoragesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, storageName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[StoragesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + } else { + return runtime.NewPollerFromResumeToken[StoragesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete the storage resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +func (client *StoragesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, storageName, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *StoragesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" + 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 storageName == "" { + return nil, errors.New("parameter storageName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{storageName}", url.PathEscape(storageName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the storage resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-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. +// - storageName - The name of the storage resource. +// - options - StoragesClientGetOptions contains the optional parameters for the StoragesClient.Get method. +func (client *StoragesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientGetOptions) (StoragesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, storageName, options) + if err != nil { + return StoragesClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StoragesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StoragesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *StoragesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" + 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 storageName == "" { + return nil, errors.New("parameter storageName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{storageName}", url.PathEscape(storageName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *StoragesClient) getHandleResponse(resp *http.Response) (StoragesClientGetResponse, error) { + result := StoragesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StorageResource); err != nil { + return StoragesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all the storages of one Azure Spring Apps resource. +// +// Generated from API version 2023-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 - StoragesClientListOptions contains the optional parameters for the StoragesClient.NewListPager method. +func (client *StoragesClient) NewListPager(resourceGroupName string, serviceName string, options *StoragesClientListOptions) *runtime.Pager[StoragesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[StoragesClientListResponse]{ + More: func(page StoragesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *StoragesClientListResponse) (StoragesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return StoragesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StoragesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StoragesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *StoragesClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *StoragesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-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 *StoragesClient) listHandleResponse(resp *http.Response) (StoragesClientListResponse, error) { + result := StoragesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StorageResourceCollection); err != nil { + return StoragesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/storages_client_example_test.go b/sdk/resourcemanager/appplatform/armappplatform/storages_client_example_test.go new file mode 100644 index 000000000000..176c20d890fc --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/storages_client_example_test.go @@ -0,0 +1,169 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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"), + // }, + // }}, + // } + } +}